home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / libbasic / checkbox.bas < prev    next >
BASIC Source File  |  1993-02-07  |  752b  |  45 lines

  1.  
  2.  
  3.     ' This code demonstrates how to use checkboxes in your
  4.     ' Liberty BASIC programs
  5.  
  6.     nomainwin
  7.  
  8.     button #1, " &Ok ", [quit], UL, 120, 90
  9.     checkbox #1.cb, "I am a checkbox", [set], [reset], 10, 10, 130, 20
  10.     button #1, " Set ", [set], UL, 10, 50
  11.     button #1, " Reset ", [reset], UL, 50, 50
  12.     textbox #1.text, 10, 90, 100, 24
  13.  
  14.     WindowWidth = 180
  15.     WindowHeight = 160
  16.     open "Checkbox test" for dialog as #1
  17.  
  18. [inputLoop]
  19.     input r$ 
  20.  
  21. [set]
  22.  
  23.     print #1.cb, "set"
  24.     goto [readCb]
  25.  
  26.  
  27. [reset]
  28.  
  29.   print #1.cb, "reset"
  30.     goto [readCb]
  31.  
  32.   end
  33.  
  34. [readCb]
  35.  
  36.     print #1.cb, "value?"
  37.     input #1.cb, t$
  38.     print #1.text, "I am "; t$
  39.     goto [inputLoop]
  40.  
  41. [quit]
  42.  
  43.     close #1
  44.     end
  45.