Equinox Online Help - Language Reference - A to Z

Home

ChangeObject

Applies to
SyntaxChangeObject ObjectExpression
Action[Statement] Moves the form's input focus cursor to an object on the current page.
ScopeOnly usable in form methods.
Notes

This statement allows you to select an object on a form; the argument, ObjectExpression, is its object name. Note that an object name is a string. If supplied as a constant, it must be enclosed in quotation marks.

This statement is useful for changing the field entry order. If the user enters an invalid field value, you could use this statement to move the input focus back onto the field.

If the object cannot be located, an error number is stored in the system workarea SysError.

CategoryForms
See Also ChangeEditLine, ChangeGroup, ChangeObject, ChangePage, CurrentEventName, CurrentGroupName, CurrentObjectName, CurrentPageName, DefaultHelp, EnableGroup, EnablePage, Get, IsPageScroll, NextObjectName, Set, SetDefaultHelp, SetEquinoxTitle, SetPageScroll, SetPageTitle, ShowPage
Example

This method prevents the user from leaving the age field until a value greater than or equal to zero is entered. The method would be attached to the field's After Field event.

if age < 0 then
Beep
ChangeObject CurrentObjectName
end if

The next example validates a part code field. If the code does not exist then a parts list appears, from which the user may choose the correct item.

if part <> stock.partno then
part = Pick(partno, part, PartIdx, partno, description)

if SysReply then
ChangeObject "RestoreButton"
Exit Method
end if
end if

LineCost = LineQty * stock.unitcost
ChangeObject "SaveButton"