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 an 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_eventloop()
   RETURNING status BOOLEAN
Waits for a user interaction event.
fgl_getenv(
   variable STRING )
  RETURNING result STRING
Returns the value of the environment variable.
fgl_getfile(
   src STRING,
   dst STRING )
Retrieves a file from the front-end context to the virtual machine context.
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 product version number of Genero.
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 virtual machine context to the front end context.
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.