Marked as: Easy
Hello,
The code below describe a way to show and update a message every second indicating that the script is busy processing infromation. It changes the character "\", "|", "/" or "-" in front of the message to give the impression of a rotating motion.
start_time = TIME( 'R' )
...
curr_time = TIME( 'E' )
...
do while ...
if curr_time + 1 < TIME( 'E' ) then
do
call rxWorking 'Processing... Please Wait'
curr_time = TIME( 'E' )
end
end
rxWorking: Procedure Expose cfg.
if datatype( ARG(1), 'W' ) then
parse value SysCurPos( ARG(1), 0 ) with prev_row prev_col
SELECT
WHEN cfg.counter = 1 THEN
say left( '/ '||ARG(2), 80 )
WHEN cfg.counter = 2 THEN
say left( '- '||ARG(2), 80 )
WHEN cfg.counter = 3 THEN
say left( '\ '||ARG(2), 80 )
OTHERWISE
cfg.counter = 0
say left( '| '||ARG(2), 80 )
END
cfg.counter = cfg.counter + 1
if datatype( ARG(1), 'W' ) then
call SysCurPos prev_row, prev_col
Return 0