Equinox Online Help - Language Reference - A to Z

Home

Edit

Applies to
SyntaxEdit(ValueExpression, MessageExpression [, SwitchExpression] [, MaxLength])
Action[Function] Prompts you to edit data.
ScopeUsable anywhere
Notes

This function generates a dialog which prompts you to edit data in a text box.

ValueExpression is the default value to display in the dialog.

MessageExpression is a string that appears on the dialog. You should use it to tell the user what data to enter. If the optional argument, SwitchExpression, evaluates to True, then OK and Cancel buttons appear on the dialog. If SwitchExpression is False then no buttons appear. If omitted, SwitchExpression, defaults to False.

The user types in the required text and then presses the Return key or chooses the OK button. The text is returned by the function, as a string.

This function also sets the SysReply system workarea:

  • 0 Value returned (as normal)
  • -1 User pressed the Escape key, or chose the Cancel button
  • -2 No response (timeout error)
  • -3 Undefined error

You can use the PopupSize statement to define the width (but not height) of the Edit dialog, if MessageExpression is too long for the default dialog.

MaxLength is (optionally) the maximum number of characters that can be entered.

CategoryUser dialogs
See Also Alert, AlertBitmaps, AlertButtons, Beep, Edit, HelpAbout, Input, InputPassword, Message, PopupColour_PopupColor, PopupFlags, PopupFont, PopupJustification, PopupSize, PopupTitle, StatusLine
Example

The following example uses the Edit function to display the current account number in a dialog ready for the user to edit it. If the operator presses the Escape key, the operation is aborted. A maximum account number length has been set, with a value of 20 characters.

while AccountNo = ""
PopupTitle "Error"
AccountNo = Edit(AccountNo, "Edit this account number",true, 20)

if SysReply then
RestoreRecord
Exit Method
end if
end while