cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
alekol
Level 3

Progress Bar

HI.
Is it possible to set progress bar size larger than MAX_INT and how?

thanks
Labels (1)
0 Kudos
(1) Reply
TheTraveler
Level 8

You could try this idea. Set the bountries to be 0 to 100. Then use this:


NUMBER nPosition;
NUMBER nIndex;
NUMBER nSize;
Begin
nPostion = ((nIndex * 100) / nSize);

End;


So the nIndex should be where you are in whatever you are doing and the nSize should be the Total size of whatever you are doing. So nPosition is where you are between 0 to 100.

Now, keep in mind, the datatype NUMBER doesn't store floating point numbers. So it will automatically round down to the nearest integer.

VERY IMPORTANT: You must multiply the index by 100 first before you divide it by your size. You see, Install Shield doesn't do floating point calculations. If you don't believe me, try this.

    STRING strMsg;
Begin
nPostion = ((nIndex / nSize) * 100);
Sprintf(strMsg, "%d", nPostion);
MessageBox(strMsg, INFORMATION);

nPostion = ((nIndex * 100) / nSize);
Sprintf(strMsg, "%d", nPostion);
MessageBox(strMsg, INFORMATION);
0 Kudos