@GetFocusTable (Formula Language)

Returns the name, current row, or current column of the table that is in focus.

Note: This @function is new with Release 6.

Syntax

@GetFocusTable ( [ tableInfoRequest ] )

Parameters

[ tableInfoRequest ]

Keyword. The table information to be returned. One of the following:

[CELLROW]

Returns the current row number starting at "1"; returns "0" if a table is not in focus.

[CELLCOLUMN]

Returns the current column number starting at "1"; returns "0" if a table is not in focus.

[TABLENAME]

Returns the table name (Name/Id under the Table Programming tab in Table Properties); returns a null string if a table is not in focus or the table has no name.

Return value

tableInfo

Text. The requested information.

Usage

This @function works in the OnHelp event of a form. It is triggered by selecting Help - Context Help from the menu bar or pressing F1 when:

  • The cursor is in a field in a table cell when the document is in edit mode
  • Text or an object is selected in a table cell and the document is in read mode

When focus is in the tab of a tabbed table, [CELLCOLUMN] always returns zero.

You cannot use this @function in Web applications.

Examples

This onHelp event returns the name, row, and column of a table that is currently in focus.
row := @GetFocusTable([CELLROW]);
@If(row = "0"; @Prompt([OK]; "*No table*"; "Not in a table");
@Do(
column := @GetFocusTable([CELLCOLUMN]);
name0 := @GetFocusTable([TABLENAME]);
name := @If(name0 = ""; "No name"; name0);
@Prompt([OK]; "*" + name + "*";
"Row " + row + ", column " + column)))