lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


By far my most common use of goto is to conditionally repeat a chunk,
usually when error checking the return of dialog APIs, instead of
using repeat ... until; e.g.,
::name::

strName = Nc_GUI_InputDlg("Enter Your Name", "", "", 0, 0)
if strName == "" then
  Nc_GUI_InfoBox("Entry of at least one character in the name field is
mandatory.", 1)
  goto name
end

Best regards,

Paul