Previous Topic

Next Topic

Book Contents

Book Index

Displaying the Contents of an AutoEdit Variable Database

The example in Figure 118 shows how the TUTSHOUT rule displays the contents of the TUTORIAL AutoEdit variable database.

Figure 118 Displaying the Contents of an AutoEdit Variable Database

ON EVENT    = TUTSHOUT

OWNER M88A     GROUP                         MODE LOG     RUNTSEC

   THRESHOLD                                                     

DESCRIPTION RULE TO SHOUT THE TUTORIAL DATABASE                 

DESCRIPTION                                                     

===================================================================

DO SHOUT    = TO OPER            URGENCY R SYSTEM          CTO282I

MESSAGE TUTSHOUT BEGUN                                          

/*            *---------------------------------------------------

/*            SET TUTORIAL AS THE DEFAULT DATABASE ACCESSED      

/*            *---------------------------------------------------

DO SET   = %%$GLOBAL = TUTORIAL                         GLOBAL  N

/*          *----------------------------------------------------

/*          SHOUT THE DATABASE                                   

/*          *----------------------------------------------------

DO SET   = %%I = 0                                      GLOBAL  N

DO SET    = %%X = %%$DBCOUNT                            GLOBAL  N

WHILE    %%I LT# %%X                                             

DO SET   = %%I = %%I %%$PLUS 1                          GLOBAL  N

DO SET   = %%$DBROW = %%I                               GLOBAL  N

DO SHOUT = TO OPER              URGENCY R SYSTEM          CTO282I

MESSAGE %%NAME %%TSOUSER %%TELEXT                                

ENDWHILE                                                         

DO                                                               

Explanation

Initialize a counter to the number of records in the TUTORIAL database:

DO SET=%%I = 0

DO SET=%%X = %%$DBCOUNT

For each record, use the DO SHOUT command to display the contents of each database column. The variable names in the MESSAGE line must match the database column names in the TUTORIAL database:

WHILE    %%I LT# %%X

.

.

DO SHOUT=TO OPER              URGENCY R SYSTEM          CTO282I

MESSAGE %%NAME %%TSOUSER %%TELEXT

ENDWHILE

Parent Topic

Working With Control-O Rules