Progress BarRe: Does JSL provide a "busy" indicator similar to a spinning wheel or bar?
here's an example of a progress indicator made in JSL; it uses a namespace to encapsulate the code. The last few lines are a test, try setting workload bigger or smaller. For smooth performance the progress:set function must be called fairly often. The progress:init function needs to know the total amount of work that will be done to get the percentage right.
Edit: attached a copy of the JSL, apparently the inline JSL may not display correctly.

progress = New Namespace(
"progress"
);
progress:init = Function( {workload},
progress:TotalWork = workload;
progress:Current = -1;
progress:tick = Tick Seconds();
progress:Window = New Window( "progress",
H List Box(
Spacer Box( size( 20, 20 ) ),
progress:busy = Busy Light( <<SIZE> 1 / 30,
progress:tick = now;
If( pct != progress:Current,
progress:Current = pct;
progress:left << size( progress:Current, 20 );
progress:right << size( 100 - progress:Current, 20 );
progress:text << settext( Char( pct ) || "%" );
);
progress:busy << advance;
Wait( 0 );
)
);
progress:term = Function( {},
progress:Window << closeWindow
);
/////////////////////////
// test
/////////////////////////
workload = 1e6; // 1e6 is about 5 seconds
progress:init( workload );
For( i = 1, i <= workload, i++,
progress:set( i )
);
progress:term();</SIZE>
Re: Progress BarGood question.
The test you are asking about is designed to prevent updating the display more than 30 times per second, which would be a waste of time. In fact without that test, the example would update the display a million times and take a very long time to run.
The example assumes there are 1e6 files. You should write a loop similar to the last 6 lines of code, doing your file processing just before progress:set(i). And change the 1e6 to your number of files.
Re: Progress BarHi Craige
Thanks for your sharing about progress bar.
I 'd like to monitor how many files has been processed with progress bar.
So that, my "Workload" is not about 'time' but 'Count'. (N files in folder)
Is that mean I should delete "progress:tick" and the sentence
If( now - progress:tick > 1 / 30,
progress:tick = now;
Could you give me some advises.
Thanks.