Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Parameters are passed to the message and the ticks on the progress bar are updated as processing occurs. Coding it is a fairly straightforward affair as outlined in the MSG_EQUATES record.  Below Below is a message that displays the progress of a process, allowing the user to cancel the process by pressing the Cancel button. allowing the user to cancel.  The The message is 500 pixels wide.

...

Below is sample code that calls Msg() during the processing of 100 orders, producing the message shown above. 

Code Block
$Insert Msg_Equates
declare function msg
*
* to display a gauge (percent bar), use the "G" type; sub-types are C (show
* cancel button) and Y (yield on each cycle):
*
orderCnt = 100
Def = ""
Def<MCAPTION$> = "Processing Orders..."
Def<MTYPE$ > = "GC"
Def<MEXTENT$> = OrderCnt
Def<MTEXTWIDTH$> = 200
MsgUp = Msg(@window, Def)
for Order = 1 to OrderCnt
  gosub ProcessOrder
  * update the gauge and check if cancel was pressed
  while Msg(@window, MsgUp, Order, MSGINSTUPDATE$)
next Order
retval = Msg(@window, MsgUp) ;* take down the gauge
return 0
ProcessOrder:
*
*  Process order number "OrderCnt"
*
for i = 1 to 1000000
next i
return