Variable
A variable expression.
Example
app = cf.GetApplication() project = app:NewProject() -- Create two variables, "freq" and "lambda" freqVar = project.Variables:Add("freq", 46e6, "The operating frequency") lambdaVar = project.Variables:Add("lambda", "c0/freq") print("Name: "..lambdaVar.Name) print("Expression: "..lambdaVar.Expression) print("Value: "..lambdaVar.Value) -- Use the predefined variable 'c0' to calculate a local lambda value c0 = project.Variables["c0"] lambda = c0.Value/46e6 print("Lambda: "..lambda)
Usage locations (object properties)
The following objects have properties using the Variable object:
Property List
- Description
- The variable description. (Read/Write string)
- Expression
- The variable expression. (Read/Write string)
- Name
- The variable name. (Read/Write string)
- Type
- The object type string. (Read only string)
- Value
- The evaluated variable value. (Read only number)
Method List
Property Details
- Description
- The variable description.
- Type
- string
- Access
- Read/Write
- Expression
- The variable expression.
- Type
- string
- Access
- Read/Write
- Name
- The variable name.
- Type
- string
- Access
- Read/Write
- Type
- The object type string.
- Type
- string
- Access
- Read only
- Value
- The evaluated variable value.
- Type
- number
- Access
- Read only
Method Details
- Delete ()
- Delete the variable.
- Duplicate ()
- Duplicates the variable.
- Return
- Variable
- The duplicated variable expression.