Customizing the metamodel : Keywords for USRPROPS : VALUESCRIPT
  
VALUESCRIPT
The VALUESCRIPT calls a function written in SA Basic. VALUESCRIPTS involve enforcing consistency checks of property values in an open dialog. The functions generally compute values set for properties in a dialog, and make necessary changes, in real time, to values of other properties in the dialog, so that certain consistency rules are enforced.
You may create your own functions to enforce consistency checks of property values in an open dialog. For information on how to create your own function, see the SCRIPT keyword.
Example
DEFINITION "Index"
{
PROPERTY Unique
{ PLACEMENT {PROPPOS(84, 0) PROPSIZE(100, 12)} EDIT
Boolean LENGTH 1 VALUESCRIPT ProcessIndexUnique DEFAULT "F" }
.. }
In the example above, the function ProcessIndexUnique is called. It is located in the fmtscript.bas file. This function is only called when Oracle is the DBMS chosen. The function checks to see if the Bitmap property for the Index is toggled on – if it is, the ProcessIndexUnique function toggles the Index property off if it has been set to on. The reason is that in Oracle, an Index cannot be Unique if it has been specified as a Bitmap index.
Example
Definition "Data Element"{PROPERTY "SQL Data Type" { EDIT text LIST "Standard Data Types" LENGTH 30 VALUESCRIPT ProcessSQLDataType LABEL "Data Type" "Type" "DT" PLACEMENT {PROPPOS(4, 26) PROPSIZE(80, 12)} }
...}
In the example above, the ProcessSQLDataType checks to see if the Data Element inherits its type from an underlying Data Domain, and if so, automatically fills it in. If it does not inherit its type, and the user leaves the type field empty, then the function automatically fills in Character 10 as the default as soon as the user hits the Enter key or changes fields in the attribute grid.