Multi-Line Script |
Sometimes a single-line expression is insufficient to properly examine your data and compute the desired results. Accordingly, you may sometimes need to use scripts with multiple lines. Because a multi-line script is, for all intents and purposes, a simplified Visual Basic program, you can make it as sophisticated as you need it to be.
Multi-line scripts require the use of Assignment Operators. This means that the result of any function, expression, or other operation must be assigned to a variable. If you want to assign a value to the object that contains the script, you can assign it to the variable value.
Visual Basic scripts in
value = LEFT(Field("part_number"),5)
This example takes the "part_number" field from the current database record and discards all but the first five characters. Placing this result into the reserved variable "value" assigns it to the object associated with this data source.
Related Topics