Please enable JavaScript to view this site.

Vernon CMS Help

Purpose/Function

Evaluates Visual Basic Script (VBScript) expressions.

Argument syntax and parameters

For information about VBScript, please refer to the Microsoft Developer Network (MSDN).

To include Vernon CMS fields in the VBScript expression, enclose the internal field name or FMC (Field Mark Count) of the field inside curly brackets. For example:

{NAME} & ": " & ({USER_SYM_1#N} + {USER_SYM_2#N})

In addition to including the internal field name or FMC of the field, you may also need to include the following (delimited by '#'):

oThe letter 'N' to indicate that the result is expected to be numeric, e.g. {ITEM_COUNT#N}

oThe letter 'A' to indicate that the result is expected to be text, e.g. {RECORD_STATUS#A}

oThe letter 'V' to indicate that the expression should operate per value (for multi-valued fields), e.g. {DDE_FILENAME#VA}

Field Conversions

You may also wish to include an optional field conversion for authority, date or currency fields.

For example:

{PROD_PRI_PLACE#VA#DICT}

where 'PROD_PRI_PLACE' is the internal field name for the Production Place field in the Object file.

'VA' indicates that the result is expected to be text, and specifies that if there is more than one entry in the Production Place field the VBScript expression should operate on each entry individually.

'DICT' instructs the system to use the default conversion (as per the dictionary) for this field.

Field conversions can be applied to fields within the expression, as well as to the symbolic result (by entering the conversion in the Conversion field). A conversion is only required at field level if the field needs to be converted before the expression is evaluated.

Field conversions must not contain any '{}' or '#' characters.

Cond() function

The Cond() function evaluates conditional expressions. It returns one of two options based on a test. You specify the condition. If the condition is met, option one will be returned. If the condition is not met, option two will be returned.

The basic structure of a conditional expression is as follows:

Cond(test, option1, option2)

where test, option1 and option2 can be any valid EvalVB expressions.

For example, you may want to create a User Symbolic to display Artist/Maker Place of Birth, with the Next Higher Term in brackets next to the term, e.g. Portland (Oregon). However, if the Place of Birth has no Next Higher Term, you don't want empty brackets, such as United States of America (). You could create a conditional expression to check the Next Higher Term field for data. If the field contains data, it will be displayed between brackets. If the field does not contain data, nothing will be displayed. The argument would be as follows:

{AU_NAME} & Cond({AU_NEXT_TERM#A}, " (" & {AU_NEXT_TERM#A#DICT} & ")", "")

where test is {AU_NEXT_TERM#A}, option1 is " (" & {AU_NEXT_TERM#A#DICT} & ")" and option2 is "".

No conversion is required for this test as the expression is simply checking for the presence or absence of data. If your test relied on specific data, you would need to convert the field from its internal format, e.g. {AU_NAME} & Cond({AU_NEXT_TERM#A#DICT} = "United States of America".

Complex scripts

To use another language (e.g. JavaScript) or to use supporting script subroutines, save the subroutines as a text file and call it in the expression. For example:

LOAD|SCRIPTS\USERSYMx.EVL|userSymX("{FIELD}", "{FIELD}" etc.)

where the source code for userSymX() is in Wincoll\SCRIPTS\USERSYMx.EVL and FIELD is a Vernon CMS internal field name or FMC.