Customizing the metamodel > Keywords for USRPROPS > VALUESCRIPT
  
VALUESCRIPT
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 can 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 SCRIPT.
Example
The following example calls the ProcessIndexUnique function. It is in the fmtscript.bas file. This function is called only when Oracle is the DBMS chosen. The function checks to see if the Bitmap property for the Index is 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.
DEFINITION "Index"
{
PROPERTY Unique
{ PLACEMENT {PROPPOS(84, 0) PROPSIZE(100, 12)}
EDIT
Boolean LENGTH 1 VALUESCRIPT ProcessIndexUnique DEFAULT "F"
}
...
}
Example
In the following example, the ProcessSQLDataType checks to see if the Data Element inherits its type from an underlying Data Domain, and if so, fills it in. If it does not inherit its type, and the user leaves the type field empty, the function fills in Character 10 as the default when the user presses Enter or changes fields in the attribute grid.
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)}
}
...
}
See also
Keywords for USRPROPS