Display a Progress Window in Classic Development

Summary/Background

When a process or program is being run that takes a noticeable amount of time to execute it may be beneficial to display a progress window to inform the user the status of the process or simply so that the user doesn’t think X3 is frozen. Standard X3 logic has three different types of progress windows depending on what level of information you wish to display.

Details

TEMPON – A Basic Progress Window

  • The TEMPON subprogram in GESECRAN will display a simple progress window with either pre-defined messages or a custom message.
    • Note: TEMPON includes checks against the variables GSERVEUR and GSILENCE which can prevent the window from displaying. It does NOT check GIMPORT.

Call to display the window:

Call TEMPON(LOP) From GESECRAN

LOP is a character variable that can be one of several pre-defined options, or a custom message. Possible values are:

  • V – “Validation in progress…”
  • F – “Check in progress…”
  • L – “Reading in progress…”
  • E – “Entry in progress…”
  • A – “Cancellation in progress…”
  • S – “Deletion”
  • R – “Search In Progress . . .”
  • C – “Calculation In Progress”
  • “” – “Operation in progress…”
  • “User defined message”

Examples:

Call TEMPON(“C”) From GESECRAN

Call TEMPON(“Looking for orders…”) From GESECRAN

Call to close the window:

Call TEMPOFF From GESECRAN

BOITE – A Progress Window with a Status Bar

  • The BOITE subprogram in GESECRAN will display a progress window with a calculated status bar showing the percent complete.
    • Note: BOITE includes checks against the variables GSERVEUR, GIMPORT, and GSILENCE which can prevent the window from displaying.

Call to initialize the window:

Call OUVRE_BOITE(OPE, NOMBRE) From GESECRAN   

OPE is a character variable for the title of the progress window.

NOMBRE is a decimal variable that represents the maximum value for the calculated progress bar.

  • e.g. if you want the progress bar to represent 0 – 100, NOMBRE will be set as 100.
  • There is no limitation to what this value can be.

Refresh the window / recalculate progress bar:

Call AFF_BOITE (TEXTE, NOMBRE, INTERRUPT) From GESECRAN

TEXTE is a character variable used to populate the message box on the window with what is happening.

NOMBRE is a decimal variable for the current level of completion.

  • For example, if at this point the program is 25% complete, the value would be 25% of the NOMBRE value in OUVRE_BOITE.
    • e.g. OUVRE_BOITE initialized with a value of 100, this call’s value should be 25
    • e.g. OUVTE_BOITE initialized with a value of 5, this call’s value would be 1.25

INTERRUPT is an integer variable. It must be populated with a variable or screen field, NOT hard coded.

  • This parameter does not appear to have any functionality.

Re-initialize the current window and reset the progress bar:

Call SET_BOITE(OPE, NOMBRE) From GESECRAN

OPE is a character variable used to populate the message box on the window with what is happening.

NOMBRE is a decimal variable that sets the maximum value for the calculated progress bar. This will also reset the progress bar back to 0%.

Call to close the window: Call FERME_BOITE From GESECRAN

VLC – A Progress Window with Message

  • The VLC subprogram in GESECRAN will display a progress window that contains two message fields to allow information to be displayed.
    • Note: VLC includes checks against the variables GSERVEUR, GIMPORT, and GSILENCE which can prevent the window from displaying.

Call to initialize the window:

Call OUVRE_VLC(TITVLC, INTTEX, INTNUM) From GESECRAN   

TITVLC is a character variable for the progress window title.

INTTEX is a character variable for the first message field.

INTNUM is a character variable for the second message field.

Refresh the window with new messages:

Call AFF_VLC(TEXTE, NUMERO) From GESECRAN

TEXTE is a character variable for the first message field.

NUMERO is a character variable for the second message field.

Call to close the window:

Call FERME_VLC From GESECRAN 

Scroll to Top