Multi-Line Scripts |
You may, on occasion, need to use scripts with multiple lines, especially when a single-line expression is insufficient to properly examine your data and compute the desired results. 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.
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