Xbasic

Form Functions and Methods

Description

A list of the form functions and methods provided in Alpha Anywhere.

Functions

Alpha Anywhere provides the following Form functions.

Methods

Alpha Anywhere provides the following Form methods based on the default FORM object.

Some Methods, shown in the second half of the methods list, require a prefix. Prefix these methods with either:

  • the name of the form

  • topparent, when working within the form

  • the pointer returned by the FORM.LOAD(), FORM.VIEW(), or FORM.VIEWQUERIED() methods.The following script examples, attached to a button on the Customer Information form, switch the form to browse view

Using an alias is desirable when working within the form.

parentform.browse_view()
topparent.browse_view()

Using the form name can cause problems, because it can change.

customer_information.browse_view()

Using a pointer is necessary when working outside the form.

dim frm as P
frm = form.view("Customer Information")
frm.browse_view()

Methods

.ARCHIVE

Prints Layout_Name to file in the .PDF format.

.CREATE()

Creates and displays a new form for a table or set.

.DELETE()

Deletes Form_Name.

.DIALOG()

Opens Form_Name as a dialog box.

.LOAD()

Loads Form_Name into memory and returns the object pointer.

.PREVIEW()

Displays the form and the selected records in the Print Preview dialog.

.PRINT()

Obsolete, see PRINT_FORM(). PRINT()creates the selected forms and then displays the Print dialog box.

.SAVEAS()

Prints Layout_Name to file in the specified format. If no format is specified, the .PDF format is used.

.SEND()

Emails a layout as an attached file of type Format.

.VIEW()

Opens Form_Name and returns the object pointer to the form window.

.VIEWQUERIED()

Opens Form_Name and returns the object pointer to the form window.

.ZOOM_TO_RECORD()

Opens a form and displays the current record in an embedded browse.

Methods Requiring Prefixes

.ACTIVATE()

Sets focus to the object.

.ACTIVE()

Returns the name of the control (or column in the case of a Browse) with focus.

.ACTIVE_DRILLDOWN()

Returns the address of the deepest control that has focus.

.ACTIVE_PREV()

Returns the name of the control which previously had focus.

.ACTIVEPREVDRILLDOWN()

Returns the name of previously active object, drilling down into container objects.

.ALLOW_CHANGE()

Sets the Allow Changes flag. When the flag is .T., data can be edited.

.ALLOWCHANGESTATUS

Returns .T. (TRUE) if the form allows editing.

.BASEQUERYRUN

Sets the base filter and order expressions for a form.

.BROWSE_VIEW()

Toggles a form window into a browse window.

.BUTTON.PUSH()

Activates a button and runs the buttons OnPush event.

.CANCEL()

Cancels any changes made to the current record before the records is saved. Works for forms and browses.

.CHANGE_MODE()

Puts a form into change mode, just as if the user had done so by beginning to type into any field.

.CHILD()

Returns an object pointer to the Nth child of the object, or the child object called Object_Name.

.CHILD_ENUM()

Returns a CR-LF separated list of all the child objects on the form, in tab order.

.CHILDREN()

Returns the number of objects that a container object contains. Returns zero if the object is not a container.

.CLASS()

Returns the class (i.e., type) of the object.

.CLOSE()

Closes the form or browse window.

.COMMIT()

Saves the current records.

.COPY_PREV_RECORD()

Copies values from the previous record into the current record.

.COPY_PREV_FIELD()

Copies values from the corresponding field in the previous record into the current field.

.CURSOR_GET()

Returns the position of the cursor on the form.

.CURSOR_SET()

Sets the position of the cursor on the form.

.DATA_ENTRY_STYLE()

Returns the mode of the form.

.DELETE_RECORD()

Deletes the current record.

.DIAL_PHONE()

Dials the phone number in the control that currently has focus.

.DICTIONARY_GET()

Returns the name of the dictionary file that contains the form.

.DISABLE()

Makes a form unable to receive focus. May also gray the object. Works with fields, buttons, check boxes, etc.

.DOWN()

Moves the focus down as if the user had pressed the Down key. Works with forms.

.DUPLICATE_RECORD()

Creates a new record that is a duplicate of the current record. Moves focus to the new record.

.ENABLE()

Makes an object able to receive focus.

.EVAL()

Interprets a string as Xbasic code.

.FETCH_FIRST()

Moves to the first record in the current query.

.FETCH_LAST()

Moves to the last record in the current query.

.FETCH_NEXT()

Moves to the next record in the current query.

.FETCH_PREV()

Moves to the previous record in the current query.

.FILTER_GET()

Returns the current filter expression for the form.

.FIND()

Does a Find by Key for value. If value is not specified, the built-in Find dialog is displayed.

.FIND_AND_REPLACE()

Displays the Find and Replace dialog box.

.FIND_BY_FORM()

Puts the form into Find by Form mode.

.FIND_CLEAR()

Clears entries from the Find by Form mode form.

.FIND_EXIT()

Cancels the Find by Form mode.

.FIND_NEXT()

Repeats the Find by Form, finding the next record.

.FIND_PREV()

Repeats the Find by Form, finding the previous record.

.FIND_RUN()

Runs the Find by Form.

.FINDBY_DEFINEDKEY()

A high level approach to displaying the Find by Key dialog box that allows you to customize its appearance and preset its filter.

.GETACTIVEOBJPARENT()

Returns a pointer to the container of the object that has focus.

.HAS_METHOD()

Returns .T. (TRUE) if the form supports the specified method.

.HIDE()

Hides an object.

.ICON_GET

Returns the name of the form's icon.

.INDEX_NAME()

Returns the name of the current primary index or query.

.INDEX_POINTER()

Returns a pointer to the current primary index or query.

.INDEX_SET()

Selects an index or query list as the primary index.

.INDEX_SETEXPLICIT()

Sets the primary index for the form.

.IndexSetDialog()

Displays the Primary Index or Query dialog box.

.IS_ON_LAST_OBJECT()

Returns .T. if the object is the last object on the form, as specified in the forms prompt order.

.ISVISIBLE()

Returns .T. (TRUE) if the form is visible.

.KINDOF()

Returns the kind of object represented by a form.

.LAST_PRESSED()

Returns the name of the last button pressed when a form is opened as a dialog.

.LEFT()

Moves the focus to the left as if the user had pressed the Left key.

.LOCATE()

Displays the Locate dialog box.

.LOCATE_NEXT()

Finds the next record with a field value matching value. If field is not specified, all fields are searched. Otherwise, only the specified field is searched.

.LOCATE_PREV()

Finds the previous record with a field value matching value. If field is not specified, all fields are searched. Otherwise, only the specified field is searched.

.MARK_RECORD()

Marks the current record.

.MAXIMIZE()

Maximizes the form window.

.MENUCHANGE()

Displays the named menu.

.MENUITEMCHECK()

Displays or removes a checkmark next to a menu entry.

.MENUITEMENABLE()

Enables or disables (grays) a menu entry.

.MENUITEMRESET()

Enables and removes any checkmarks from a menu entry.

.MINIMIZE()

Minimizes the form or browse window.

.MODE_GET()

Returns the current mode of the form. Possible modes are: VIEW, CHANGE, ENTER, QUERY and FIND.

.MULTI_SELECT()

Displays the Multi-Select Records dialog box.

.NAME()

Returns the object name.

.NAVIGATOR()

Displays the Goto which field? dialog box.

.NEW_RECORD()

Enters a new record into a form or a browse.

.NEXT()

Moves the focus to the next control in the tab order as if the user had pressed the Tab key. Works with forms and browses.

.ORDER_GET()

Returns the current order expression for the form.

.OUTPUT_FILE_OVERRIDE()

Sets the name of the file to be printed. It returns the name, if any, of the file currently set to be printed.

.PREV()

Moves the focus to the previous control in the tab order as if the user had pressed the Shift-Tab key.

.PRINTER_OVERRIDE()

Sets the printer configuration, and optionally, saves the current configuration before overwriting it.

.QUERY_BY_EXPN()

Displays the Query by Expression dialog.

.QUERY_BY_FORM()

Switches a form to Query by Form mode.

.QUERY_BY_TABLE()

Opens the Query by Table window.

.QUERY_CLEAR()

Clears entries from the Query by Form mode form.

.QUERY_EXIT()

Exits from Query by Form mode.

.QUERY_GENIE()

Displays the Query Genie dialog box.

.QUERY_MODE()

Switches a form to the Query by Form mode specified by mode.

.QUERY_RUN()

Runs the query specified in the Query by Form window.

.QUERYRUN()

Applies a query to the current form.

.QUICK_EXPORT()

Exports the currently selected records to Excel.

.QUICK_SEARCH()

Performs the same action as the Quick Filter command.

.QUICK_SEARCHEXCL()

Opposite of the .QUICK_SEARCH() methods. Finds all records that do NOT match the value in the current control.

.QUICK_SORT()

Performs the same action as the Quick Sort command. Works with forms and browses.

.QUICKFILTER()

Returns a count of the matching records, as if you had clicked the Quick Filter icon.

.QUICKSORTEXPLICIT()

Sorts the table or set on the indicated field and then displays it in the current form.

.QUICKSORTMULTIFLD()

Displays the Custom Sort dialog box.

.QUICKSRCHEXPLICIT()

Filters the records in a form based on the value of a field.

.QUICKSRCHMULTIFLD()

Displays the multi-field Quick Filter dialog.

.RECNO_GOTO()

Displays the specified record number.

.RECORDS_GET()

Returns the number of records displayed by the form.

.REFERENCE_EXPRESSION_GET()

Returns the reference expression to reconstruct a reference to the object.

.REFRESH()

Forces a control to re-fetch data from its data source, and then to repaint itself. Works with all controls.

.REFRESH_FIELDS()

Refreshes all the fields on the form.

.REFRESH_LAYOUT()

Reloads the form.

.RESTORE()

Restores a minimized or maximized window to normal size. Works with form and browse windows.

.RESYNCH()

Re-fetches all data for the form and repaints the form. Works with forms and browses.

.RIGHT()

Moves the focus to the right as if the user had pressed the Right key.

.RIGHTCLICK()

Displays the right-click for the selected object.

.RUN_SAVED_QUERY()

Runs the saved Query operation called Query_Name. This method is equivalent to the user selecting the Query, Run saved query menu option.

.SELECT_TEXT()

Selects text in the current field from Start_Position for Length characters.

.SEND()

Emails the form.

.SESSIONHANDLE()

Returns the session handle associated with the object.

.SET_DIRTY()

Indicates that the form layout has been changed.

.SHOW()

Shows an object that may previously have been hidden using the .HIDE() method. Works with fields, buttons, check boxes, text, lines and most other objects on forms.

.SHOW_ALL()

Turns off the current query and shows all records in the table (subject to any base filter that may have been specified in the form or browses Filter/Order properties).

.SHOW_MEMO()

Opens the memo editor for a memo field.

.SIZE_GET()

Returns the size of the window in inches (width x height).

.SPECIALQUERIES()

Displays the Select Filter dialog box.

.SPELL_CHECK()

Displays the Spellchecker dialog box.

.SWAP()

Replaces the current form with a different form.

.TAB_OBJECT.TAB_GET()

Returns the tab number of the tab page that has focus.

.TAB_OBJECT.TAB_SET()

Activates the specified tab page on a tab control on a form.

.TABLE_GET()

Returns a pointer to the primary table that the form is based on.

.TOGGLE_FORMBROWSE()

Switches the form to browse mode.

.TOOLBARCHANGE()

Loads and displays the selected toolbar.

.ToolbarControlEnable()

Enables or disables the specified item on the control bar.

.TYPE()

Returns the type of data bound to an object.

.UNMARK_RECORD()

Un-marks the current record.

.UP()

Moves the focus up as if the user had pressed the Up key.

.VARIABLES()

Returns a pointer to a dot variable that contains the values of the selected variables.

.WINDOW_POSITION()

Sets the location of the form on the screen.

.ZORDER()

Sets the stacking position of a form.

See Also