Local variables

A local variable can serve as an argument once a value has been assigned to it by a previous statement, usually involving another function.

In the example, the status of a formula is checked during a Copy Method: oStatus and lShow are local variables, ObjProperty and MessageList are functions, and STATUSIND.STATUS is an argument that retrieves information from the the system database.

The first statement takes the status of the new formula and places it in the local variable, oStatus . The if/then statement determines if the value of oStatus indicates that the formula is experimental or obsolete. If this is true, then the MessageList function displays a message to the user. The message is enclosed in quotation marks in an Alert Messages box.


Dim oStatus As Object = ObjProperty ("STATUSIND.STATUS", ", ")
If (oStatus < 400 Or oStatus = 999) Then
  MessageList ("This formula is experimental or obsolete.")
End If

Brackets are used to specify optional arguments. You can omit an optional argument, if it is not needed to identify the property. Required arguments must have a value or left as empty quotation marks ("").