table.MODE_GET Function

Syntax

Data_Entry_Mode as N = Mode_Get()

Description

Get the data entry mode for the table.

Discussion

The <TBL>.MODE_GET() method returns a number that indicates the current Data_Entry_Mode for the table. The possible return values are:

Return Value and Mode
Data Entry Mode
0 View

No data entry is currently taking place.

1 Change

A Change operation is underway.

2 Enter

An Enter operation is underway.

Example

This script can be attached to an OK button on a dialog to make sure the current records is saved before the dialog is closed.

dim tbl as P
tbl = table.current()
if tbl.mode_get()> 0 then
   parent.commit()
end if
parent.close()

This script tells you which mode you are in.

dim tbl as P
tbl = table.current()
if tbl.mode_get()= 1 then
    ui_msg_box("Mode", "Change mode")
elseif tbl.mode_get()= 2 then
    ui_msg_box("Mode", "Enter mode")
else
    ui_msg_box("Mode", "View mode")
end if

See Also