ALERT Examples


Example 1:

 

  

ALERT

STOP,"Program Files Not Found",RESULT

 

This instruction displays a STOP alert box on the screen with the informational message "Program Files Not Found". The alert remains on the screen until the message is acknowledged.

 

Example 2:

 

  

ALERT

PLAIN,"Do you want subtotals generated?",RESULT

 

This instruction displays a PLAIN alert box on the screen with the question "Do you want subtotals generated?". It then waits until YES, NO or CANCEL is responded. The RESULT field is set based on the response was given.

 

Example 3:

 

  

PARAMTEXT

“AAM”,”DATAFILE”

  

ALERT

STOP,"The ^0 file ^1 was not found.",RESULT

 

The ALERT instruction displays a message that "The AAM file DATAFILE was not found.".

 

Example 4:

 

STYLE

INTEGER

1,"0x24"

  

ALERT

TYPE=STYLE,"Continue searching?":

  

 

RESULT,"Item not found"

 

A message box is displayed with the question mark icon, the YES and NO buttons, a message of "Continue searching?" and a window title of "Item not found". Upon return, RESULT will contain a six (6) to indicate yes or a seven (7) to indicate no was selected.

 

Example 5:

 

RESULT

FORM

1

TITLE

INIT

"Alert Test"

*

 

 

.Ready the Screen

.

 

 

  

DISPLAY

*ES,*P35:2,TITLE,*P1:3,*RPTCHAR="-":80;

*

 

 

.Perform a Caution Alert

.

 

 

  

ALERT

CAUTION,"CAUTION alert message.",RESULT,TITLE

*

 

 

.Perform a Note Alert

.

 

 

  

ALERT

NOTE,"NOTE alert message.",RESULT,TITLE

*

 

 

.Perform a Plain Alert

.

 

 

  

ALERT

PLAIN,"PLAIN alert message.",RESULT,TITLE

*

 

 

.Report Response via an Alert

.

 

 

  

IF

(RESULT = 1)

  

ALERT

NOTE,"YES was pressed.",RESULT,TITLE

  

ELSE IF

(RESULT = 2)

  

ALERT

NOTE,"NO was pressed.",RESULT,TITLE

  

ELSE IF

(RESULT = 3)

  

ALERT

NOTE,"CANCEL was pressed.",RESULT,TITLE

  

ENDIF

 

*

 

 

. Perform a Stop Alert

.

 

 

  

ALERT

STOP,"STOP alert message.",RESULT,TITLE

 

This program displays each of the alert types. The user's response to the PLAIN alert is reported using a NOTE alert.

 



PL/B Language Reference AFILE Examples AND Examples