User Functions Table

General structure

User-defined functions are stored in SF_SYSUserFunctions table. Each row of this table contains a complete definition of the Function, including the executable object of the Function in an archived form.

The table has the following structure:

Column Generalized data type Use
SF_FunctionName VARCHAR(20) Name of the user-defined Function
SF_DescriptionText BLOB Archived text of the Function's description
SF_FunctionVisual BLOB Archived graphical flowchart of the Function
SF_Parameters BLOB Archived array of the Parameter objects
SF_ReturnType INT Data type of the return variable
SF_ReturnVariable VARCHAR(255) Name of the return variable
SF_FunctionExec BLOB Archived executable object
SF_FunctionIsValid LOGICAL Flag to track readiness of the Function
SF_UserId VARCHAR(255) Login account of the user that last updated the row
SF_DateChanged CHAR(8) Date of the last update of the row (CCYYMMDD)
SF_TimeChanged CHAR(6) Time of the last update of the row (HHMMSS)
SF_TimeStamp SMALLINT Version of the row (incremented with each update)

Notes:

The table contains one row for each user-defined Function used by STEPforward.

SF_DescriptionText is an archived NSString object extracted from NSText that displays the Function's legend.

SF_FunctionVisual is an archived SFVisualTemplate object that encapsulates the contents of the Workspace window when the Function is constructed. When the Function is loaded into the Function Builder, its Workspace, Palette and Inspector windows are populated from this object that is unarchived for this purpose.

SF_Parameters is an archived NSArray object that stores objects carrying information about parameters accepted by the Function.

SF_ReturnType is the integer data type of the returned value. Functions that do not return any value have this field set to -1.

SF_FunctionExec is an archived object that stores executable objects that implement the logic of the Function. The objects are linked together in a chain of references and are executed at the run time.

SF_FunctionIsValid is a logical flag that is set to FALSE if the Function has been saved with syntactical errors. In this case SF_FunctionExec field is set to NULL, and the Function cannot be executed.