Marked as: Easy
Hello,
here's an example on how to create a function that display a progressbar.
call rxProgress 23, 214, 2 /* row 0 is the topmost row */
/* part, of_total, display_on_row */
rxProgress: Procedure
if datatype( ARG(1), 'N' ) & datatype( ARG(2), 'N' ) then
do
if datatype( ARG(3), 'W' ) then
parse value SysCurPos( ARG(3), 0 ) with prev_row prev_col
progress = 76 * ARG(1) % ARG(2)
say left( copies( '█', progress )||copies( '░', 76 - progress ), 76 )||right( ( ( 100 * ARG(1) ) % ARG(2) )||'%', 4 )
if datatype( ARG(3), 'W' ) then
call SysCurPos prev_row, prev_col
end
Return 0
The datatype statement is missing a quote on the N literal.
if datatype( ARG(1), 'N ) & datatype( ARG(2), 'N' ) then
Fixed :-)
Thanks