

In this task, the goal is to input a string and the integer 75000, from graphical user interface.



See also: User input/Text

      INSTALL @lib$+"WINLIB2"
      INSTALL @lib$+"WINLIB5"
      ES_NUMBER = 8192
 
      form% = FN_newdialog("Rosetta Code", 100, 100, 100, 64, 8, 1000)
      PROC_static(form%, "String:", 100, 8, 8, 30, 14, 0)
      PROC_editbox(form%, "Example", 101, 40, 6, 52, 14, 0)
      PROC_static(form%, "Number:", 102, 8, 26, 30, 14, 0)
      PROC_editbox(form%, "75000", 103, 40, 24, 52, 14, ES_NUMBER)
      PROC_pushbutton(form%, "Read", FN_setproc(PROCread), 30, 43, 40, 16, 0)
      PROC_showdialog(form%)
 
      REPEAT
        WAIT 1
      UNTIL !form% = 0
      QUIT
 
      DEF PROCread
      LOCAL buffer%, number%
      DIM buffer% LOCAL 255
      SYS "GetDlgItemText", !form%, 101, buffer%, 255
      SYS "GetDlgItemInt", !form%, 103, 0, 1 TO number%
      PRINT "String = """ $$buffer% """"
      PRINT "Number = " ; number%
      ENDPROC