LIBRARY rexxgui
guierr = "SYNTAX"
guiheading = 1
DO nr_loops = 1 TO 2
rc = guisay("Press enter rather than clicking on the OK button to see the error")
filename = "c:\any filename\anywhere"
lrecl = get_lrecl(filename)
END
RETURN 0
get_lrecl:
PROCEDURE EXPOSE lrecl_entry
ARG filename
guicreatewindow('NORMAL')
guiaddctltext('filename_text', filename)
lrecl_entry = "10"
guiaddctltext('lrecl_entry', lrecl_entry)
again:
DO FOREVER
guigetmsg()
IF EXISTS('GuiObject') == 0 THEN DO
IF EXISTS('GuiSignal') THEN DO
END
END
CATCH SYNTAX
CONDITION()
SIGNAL again
CATCH HALT
FINALLY
guidestroywindow()
END
RETURN 0
wm_click_ok_button:
guigetctlvalue('lrecl_entry')
SELECT
WHEN 0 = DATATYPE(lrecl_entry, "W") THEN
rc = wdwsay.rex("Not a valid LRECL", "STOP|")
WHEN lrecl_entry < 2 THEN
rc = wdwsay.rex("Enter a valid LRECL (2 or more)", "STOP|")
OTHERWISE
DO
guisendmsg(,'POST CLOSE')
END
END
RETURN |