Built-in functions

Table 1. Built-in functions
Function Description
ARG_VAL(
   position INTEGER )
  RETURNING result STRING
Returns a command line argument by position.
ARR_COUNT()
  RETURNING result INTEGER
Returns the number of rows entered during a INPUT ARRAY statement.
ARR_CURR()
  RETURNING result INTEGER
Returns the current row in a DISPLAY ARRAY or INPUT ARRAY.
DOWNSHIFT(
   source STRING )
  RETURNING result STRING
Converts a string to lowercase.
ERR_GET(
   errnum INTEGER ) 
  RETURNING result STRING
Returns the text corresponding to an error number.
ERR_PRINT(
   errnum INTEGER )
Prints in the error line the text corresponding to an error number.
ERR_QUIT(
   errnum INTEGER )
Prints in the error line the text corresponding to an error number and terminates the program.
ERRORLOG(
   text STRING )
Copies the string passed as parameter into the error log file.
FGL_BUFFERTOUCHED()
  RETURNING result INTEGER
Returns TRUE if the input buffer was modified in the current field.
FGL_DB_DRIVER_TYPE()
  RETURNING drvtype CHAR(3)
Returns the 3-letter identifier/code of the current database driver.
FGL_DECIMAL_TRUNCATE(
   value DECIMAL,
   decimals INTEGER )
  RETURNING result DECIMAL
Returns a decimal truncated to the precision passed as parameter.
FGL_DECIMAL_SQRT(
   value DECIMAL )
  RETURNING result DECIMAL
Computes the square root of the decimal passed as parameter.
FGL_DECIMAL_EXP(
   value DECIMAL )
  RETURNING result DECIMAL
Returns the value of Euler's constant (e) raised to the power of the decimal passed as parameter.
FGL_DECIMAL_LOGN(
   value DECIMAL )
  RETURNING result DECIMAL
Returns the natural logarithm of the decimal passed as parameter.
FGL_DECIMAL_POWER(
      base DECIMAL,
      exp DECIMAL ) 
    RETURNING result DECIMAL
Raises decimal to the power of the real exponent.
FGL_DIALOG_GETBUFFER()
  RETURNING result STRING
Returns the text of the input buffer of the current field.
FGL_DIALOG_GETBUFFERLENGTH()
  RETURNING result INTEGER
Returns the number of rows to feed a paged DISPLAY ARRAY.
FGL_DIALOG_GETBUFFERSTART()
  RETURNING result INTEGER
Returns the row offset of the page to feed a paged display array.
FGL_DIALOG_GETCURSOR()
  RETURNING index INTEGER
Returns the position of the edit cursor in the current field.
FGL_DIALOG_GETFIELDNAME()
  RETURNING result STRING
Returns the name of the current input field.
FGL_DIALOG_GETKEYLABEL(
   keyname STRING )
  RETURNING result STRING
Returns the label associated to a key for the current interactive instruction.
FGL_DIALOG_GETSELECTIONEND()
  RETURNING position INTEGER
Returns the position of the last selected character in the current field.
FGL_DIALOG_INFIELD(
   field-name STRING )
  RETURNING result INTEGER
This function checks for the current input field.
FGL_DIALOG_SETBUFFER(
   value STRING )
Sets the input buffer of the current field.
FGL_DIALOG_SETCURRLINE(
  line INTEGER,
  row INTEGER )
This function moves to a specific row in a record list.
FGL_DIALOG_SETCURSOR(
   position INTEGER )
This function sets the position of the edit cursor in the current field.
FGL_DIALOG_SETFIELDORDER(
   active INTEGER )
This function enables or disables field order constraint.
FGL_DIALOG_SETKEYLABEL(
   keyname STRING,
   label STRING )
Sets the label associated to a key for the current interactive instruction.
FGL_DIALOG_SETSELECTION(
   cursor INTEGER,
   end INTEGER )
Selects the text in the current field.
FGL_DRAWBOX(
   height INTEGER,
   width INTEGER,
   line INTEGER,
   column INTEGER,
   color INTEGER )
Draws a rectangle in the current window.
FGL_DRAWLINE(
   column INTEGER,
   line INTEGER,
   width INTEGER,
   type CHAR(1),
   color INTEGER)
Draws a line in the current window (TUI and traditional mode).
FGL_DIALOG_GETCURSOR()
  RETURNING index INTEGER
Returns the position of the edit cursor in the current field.
FGL_GETENV(
   variable STRING )
  RETURNING result STRING
Returns the value of the environment variable.
FGL_GETFILE(
   src STRING,
   dst STRING )
Transfers a file from the front end workstation to the application server machine.
FGL_GETHELP(
   help-id INTEGER )
  RETURNING result STRING
Returns the help text according to its identifier by reading the current help file.
FGL_GETKEY()
  RETURNING keynum INTEGER
Waits for a keystroke and returns the key number.
FGL_GETKEYLABEL(
   keyname STRING )
  RETURNING result STRING
Returns the default label associated to a key.
FGL_GETPID()
  RETURNING result INTEGER
Returns the system process identifier.
FGL_GETRESOURCE(
   name STRING )
  RETURNING result STRING
Returns the value of an FGLPROFILE entry.
FGL_GETVERSION()
  RETURNING result STRING
Returns the build number of the runtime system.
FGL_GETWIN_HEIGHT()
  RETURNING result INTEGER
Returns the number of rows of the current window.
FGL_GETWIN_WIDTH()
  RETURNING result INTEGER
Returns the width of the current window as a number of columns.
FGL_GETWIN_X()
  RETURNING result INTEGER
Returns the horizontal position of the current window.
FGL_GETWIN_Y()
  RETURNING result INTEGER
Returns the vertical position of the current window.
FGL_KEYVAL(
   string STRING )
  RETURNING result INTEGER
Returns the key code of a logical or physical key.
FGL_LASTKEY()
  RETURNING result INTEGER
Returns the key code corresponding to the logical key that the user most recently typed in the form.
FGL_PUTFILE(
   src STRING,
   dst STRING)
Transfers a file from the application server machine to the front end workstation.
FGL_REPORT_PRINT_BINARY_FILE(
   filename STRING )
Prints a file containing binary data during a report.
FGL_REPORT_SET_DOCUMENT_HANDLER(
   handler om.SaxDocumentHandler )
Redirects the next report to an XML document handler.
FGL_SCR_SIZE(
   screen-array STRING )
  RETURNING result INTEGER
Returns the size of the specified screen array in the current form.
FGL_SET_ARR_CURR(
   row INTEGER )
Moves to a specific row in a record list.
FGL_SETENV(
   variable STRING,
   value STRING )
Sets the value of an environment variable.
FGL_SETKEYLABEL(
   keyname STRING,
   label STRING )
Sets the default label associated to a key.
FGL_SETSIZE(
   height INTEGER,
   width INTEGER )
Sets the size of the main application window.
FGL_SETTITLE(
   label STRING )
Sets the title of the current application window.
FGL_SYSTEM(
   command STRING )
Runs a command on the application server.
FGL_WIDTH(
   expression STRING )
  RETURNING result INTEGER
Returns the number of columns needed to represent the printed version of the expression.
FGL_WINDOW_GETOPTION(
   attribute STRING )  
  RETURNING result STRING
Returns attributes of the current window.
LENGTH(
   expression STRING )
  RETURNING result INTEGER
Returns the number of the character string passed as parameter.
NUM_ARGS()
  RETURNING result INTEGER
Returns the number of program arguments.
SCR_LINE()
  RETURNING result INTEGER
Returns the index of the current row in the screen array.
SET_COUNT(
   nbrows INTEGER )
Defines the number of rows containing explicit data in a static array used by the next dialog.
SHOWHELP(
   helpnum INTEGER )
Displays a runtime help text.
STARTLOG(
   filename STRING )
Initializes error logging and opens the error log file passed as the parameter.
UPSHIFT(
   source STRING )
  RETURNING result STRING
Converts a string to uppercase.