StrIsBoolean

Function StrIsBoolean(a: String) : Boolean
Returns TRUE if the string supplied looks like a boolean

This is useful in a scripting engine to tell the difference between a variable name and a boolean. The function returns TRUE if the string contents are "TRUE", "FALSE", "1" or "0".

Example:

Program
  Uses
basilisk, pure2d

Begin
  InitBasilisk(TRUE)
  OpenScreen(640,480,32,FALSE,COB_SHOWCLOSE+COB_SHOWBORDER)
  
  Text(10,10,"abc: "+StrIsBoolean("abc"))
  Text(10,30,"123: "+StrIsBoolean("123"))
  Text(10,50,"True: "+StrIsBoolean("True")) // FALSE - Must be uppercase!
  Text(10,70,"False: "+StrIsBoolean("False")) // FALSE - Must be uppercase!
  Text(10,90,"TRUE: "+StrIsBoolean("TRUE"))
  Text(10,110,"FALSE: "+StrIsBoolean("FALSE"))
  Text(10,130,"00: "+StrIsBoolean("00"))
  Text(10,150,"0: "+StrIsBoolean("0"))
  Text(10,170,"1: "+StrIsBoolean("1"))
  
  While Not ExitRequested
   Flip
   Pause
(2)
  Wend
     
End