**************************************************************************
*                                                                        *
*    This script show various SET statements and miscellaneous stuff.    *
*                                                                        *
**************************************************************************
*
Declare S1 STRING
Declare S2 STRING
Declare S3 STRING
Declare S4 STRING
Declare S5 STRING
*
Declare I1 INTEGER
Declare I2 INTEGER
Declare I3 INTEGER
*
Procedure One
*
   GotoXY 10 10
*
   Message "Choose an option:"
   GotoXY 10 12
   Message "1) Help"
   GotoXY 10 13
   Message "2) List"
   GotoXY 10 14
   Message "3) Quit"
*
   GotoXY 10 16
   Input   "Enter choice: " S1
   Message " "
*
   IF ( S1 = '1' )
      Message " "
      GoToXY 15 18
      Message "You selected HELP"
      Message " "
   ELSE
      IF ( S1 = '2' )
         Message " "
         GoToXY 15 18
         Message "You selected LIST"
         Message " "
      ELSE
         IF ( S1 = '3' )
            Message " "
            GoToXY 15 18
            Message "You selected QUIT"
            Message " "
         ELSE
            Message " "
            GoToXY 15 18
            Message "You selected BOGUS"
            Message " "
         ENDIF
      ENDIF
   ENDIF
*
EndProc
*
Procedure Two
*
*  Clear
*
   Set   S2 = 'Type in a string: '
   Set   S3 = ''
*
   GotoXY 10 10
   Input S2 S3
*
   Set   S4 = Concat( 'You entered: ', S3 )
   GoToXY 10 11
   Message S4
*
EndProc
*
Procedure Three
*
*  Clear
*
   Set   S2 = 'Type in a number: '
*
   GotoXY 10 10
   Input S2 S4
   Message " "
   GotoXY 10 11
   Input S2 S5
*
   Set   I1 = Number( S4 )
   Set   I2 = Number( S5 )
*
   Set   I3 = ( I1 + I2 )
   Set   S4 = STRING( I3 )
   Set   S5 = Concat( 'Adding them we get: ', S4 )
   GotoXY 10 13
   Message S5
*
   Set   I3 = ( I1 - I2 )
   Set   S4 = STRING( I3 )
   Set   S5 = Concat( 'Subtracting them we get: ', S4 )
   GotoXY 10 14
   Message S5
*
   Set   I3 = ( I1 * I2 )
   Set   S4 = STRING( I3 )
   Set   S5 = Concat( 'Multiplying them we get: ', S4 )
   GotoXY 10 15
   Message S5
*
   Set   I3 = ( I1 / I2 )
   Set   S4 = STRING( I3 )
   Set   S5 = Concat( 'Dividing them we get: ', S4 )
   GotoXY 10 16
   Message S5
*
EndProc
*
Clear
Call One
Delay 20
Clear
Call Two
Delay 20
Clear
Call Three
