' This routine shows you how to have either 4 or 5 lined Alert boxes
' and buttons w\more than 8 characters.
' -----------------------------------------------------------------------------
'
ALERT 1,"Line 1 |Line 2 |Line 3 |Line 4 |Line 5",1,"123456789",a
'
' -----------------------------------------------------------------------------
' With this implementation /\ you can only have 4 lines of text and limited
' size buttons (notice the button doesn't go up to 9 and the text doesn't
' include Line 5), but if you use this routine...
'
' alrt$="[icon symbol][message][button text]"
' Icon symbols are  0=no icon
'                   1=Exclamation mark
'                   2=Question mark
'                   3=Stop sign
'
' return=FORM_ALERT(button,string$)
'
' return=number of the button that will release the alert box
' button=button number
' button numbers are...
'                      0=none
'                      1=first
'                      2=second
'                      3=third
' string$=address of the string that contains the message. The five lines
'         are seperated by the  |  character  ( above the backslash \ ).
' -----------------------------------------------------------------------------
'
alrt$="[1][You can have up to 30 spaces  |or characters per line, and 5 |lines of text seperated by|the straight line in the Source|Code you are now running.][123456789ABCDEFGHI]"
'
'           \/ 1=default button, the one which will be activated by <RETURN>
~FORM_ALERT(1,alrt$)
'              /\ your message
'
a=1
hal:
alrt$="[3][Let's change the default |buttons ! Hit <RETURN> and |watch the borders of the |buttons below...][ Button 1 | Button 2 | Button 3 ]"
'
'          \/ I'm INCrementing the value of "a" to set the different defaults.
~FORM_ALERT(a,alrt$)
'
IF a=>3
  GOTO example_3
ELSE
  INC a
  GOTO hal
ENDIF
' -----------------------------------------------------------------------------
' GFA assigns a variable "a" to it's "Do you wanna quit" alert. If you save
' a GFA file and choose QUIT, the YES button will be highlighted (the default).
' If GFA notices that you have modified your work since last you saved it will
' make  NO  the default button. This helps save you from quitting too soon.
'
' In your own program you could set up a variable as such...
' ------------------------------------------------------------------------------
example_3:
isav_work=FALSE           !Work hasn't been saved
macgyver:
IF isav_work=TRUE         !If it has, button 1 is the default
  a=1
ELSE                      !otherwise
  a=2                     !button 2 is the default
ENDIF
ALERT 1,"Do you really wish |to quit..? |Press <RETURN> and watch |the buttons...",a," Yes | No ",a
IF isav_work=TRUE        !If it's TRUE, end the program (or continue)
  GOTO houston
ELSE
  isav_work=TRUE         !Make it TRUE so we can get out of this !!!
  GOTO macgyver
ENDIF
' -----------------------------------------------------------------------------
' You can also "override" the DEFAULT (<RETURN>) button by only exiting IF
' the conditions below are met (b=3). The return WILL exit the box but
' doesn't have to let it go anywhere...
' -----------------------------------------------------------------------------
houston:
alrt$="[3][Let's decide which button |releases this box...|Press <RETURN>...][ 1 | 2 | 3 ]"
b=FORM_ALERT(1,alrt$)
IF b=3                !If the 3rd button is selected, regardless of the default
  EDIT                !End
ELSE
  ALERT 1,"|Sorry, wrong button...",1," Oh ",a
  GOTO houston
ENDIF
'
' Have you ever encountered the "Disk is Write-Protected" alert and haven't
' been able to use the mouse (for reasons only Atari understands, the RETRY
' button is the default...AHHHHHH !!!!!!). Well, a final hint in this extremely
' long-winded file. Whenever you create a "Write" command in your program be
' SURE to issue a Mouse command FIRST (ie: DEFMOUSE 0  or  SHOWM). That way
' the mouse will be available to the infamous Atari Alert !
