Description
Allows you to use a dictionary row to return a value to your program. Acts as a function, returning the value in its place.
Syntax
{DICTIONARYRECORDKEY}
Remarks
The system variables @DICT, @ID, and @RECORD must be set before braces can be used. The braces use the dictionary name, the current record key, and the current record to extract data from a field.
When the system variables are set, enter an existing dictionary record key in the braces.
The braces are useful for program readability. They are also useful when the field name is known but the position may have been changed. When the field name is not known, the Calculate function is used. When the position will not change and if speed is important, use < > (dynamic array operators).
See also
Angle Brackets operator, Calculate function
Example
/* The following example shows you how to evaluate column values by reference to the dictionary column name. */ /* The following function segment opens the SAMPLE_PRODUCTS table, then the dictionary of that table, then reads the desired row, using @ID, then reads the desired column value, using the dictionary column name. It returns the price of the specified item. */ table = "SAMPLE_PRODUCTS" key = "TCHBUL" ;* the technical bulletins product UnitPrice = "" ;* initialize the return variable @ID = key Open table To tablevar Then Open "DICT ":table To @DICT Then Read @RECORD FROM tablevar, @ID Then UnitPrice = {RETAIL_PRICE} End Else status = Set_FSError( ) End ;* Read End Else status = Set_FSError( ) End ;* Open dictionary End Else status = Set_FSError( ) End ;* Open table /* Convert the value of RETAIL_PRICE, which is stored in internal format, to a display format. */ Return OConv(UnitPrice, "MD2,$") The following three code segments are equivalent: temp = {INV_AMT} temp = Calculate( INV_AMT) dict_field = "INV_AMT" field_value = Calculate(dict_field) * Notice that in each case, the dictionary * word INV_AMT is executed.