This shows you the differences between two versions of the page.
en:variables [2016/01/01 22:42] 127.0.0.1 external edit |
en:variables [2020/02/28 10:46] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Variables ===== | ||
- | Variables that hold numeric values must begin with a letter, and may consist of any number of alpha-numeric characters. | ||
- | \\ | ||
- | Variables that hold string values follow the same rules as numeric variables, but must end with a dollar sign ($). They may be used interchangeably with string constants. | ||
- | \\ | ||
- | When you assign a numeric value to a string variable or add a numeric value to a string (concatenate) the number will be automatically converted to a string before the operation is completed. | ||
- | \\ | ||
- | ^Variable Assignment^^^^ | ||
- | ^Operator^Name^Example^Comments^ | ||
- | |=|Assign a Number to a Numeric Variable|a = 9| | | ||
- | |=|Assign a String to a String Variable|z$ = " | ||
- | |=|Assign a Number to a String Variable|q$ = 9.9| | | ||
- | |+=|Add to Numeric Variable|a += 7|Same as a = a + 7 < | ||
- | |+=|Concatenate to String Variable|f$ += " | ||
- | |-=|Subtract from Numeric Variable|a -= 9|Same as a = a - 9 < | ||
- | |*=|Multiply Numeric Variable|a *= 2|Same as a = a * 2 < | ||
- | |/=|Divide Numeric Variable|a /= 8|Same as a = a / 8 < | ||
- | \\ | ||
- | < |