User Tools

Site Tools


en:variables

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
en:variables [2016/01/01 22:42]
127.0.0.1 external edit
en:variables [2020/02/28 10:46] (current)
Line 1: Line 1:
 ===== Variables ===== ===== Variables =====
-Variables that hold numeric values must begin with a letter, and may consist of any number of alpha-numeric characters.  They are case sensitive.  They may be used interchangeably with numeric constants.\\ +You can think of a variable as a place in the computer's memory to store things.  Each variable has a name that must begin with a letter, and may consist of any number of letters, numbers, and dollar signs.  Their names are case sensitive, the variable 'a' is not the same as the variable "A".\\ 
-\\ + 
-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. +In BASIC-256 you do not need to define a variable before you use it.  The variable is created when it is assigned a value for the first time and will retain its value until the program [[end|end]]or the variable is [[unassign|unassign]]ed
-\\ + 
-When you assign a numeric value to a string variable or add numeric value to a string (concatenate) the number will be automatically converted to a string before the operation is completed.  A string value may not be assigned directly to a numeric variable or array element without manually converting it's type using the [[int|Int]] or [[float|Float]] functions  +==== Example ==== 
-\\ +|99|Assigns the integer 99 to the variable a| 
-^Variable Assignment^^^^ +|nom "Jim"|Assigns the string "Jimto the variable nom
-^Operator^Name^Example^Comments^ +|print "Say hello to nom|Appends the string in nom the the string "Say hello to " and displays the result| 
-|=|Assign a Number to a Numeric Variable|a = 9| +|a = a + 1|Takes the value of a and adds one to it, then store the new value back into a| 
-|=|Assign a String to a String Variable|z$ = "Hola."+ 
-|=|Assign a Number to a String Variable|q$ = 9.9| | +==== See Also ==== 
-|+=|Add to Numeric Variable|a += 7|Same as a = a + 7 <sup>1</sup>| +  [[variableoperators|Variable Operators]] 
-|+=|Concatenate to String Variable|f$ +"."|Same as f$ f$ + "."  <sup>1</sup>+ 
-|-=|Subtract from Numeric Variable|a -9|Same as a a - 9 <sup>1</sup>+==== History ==== 
-|*=|Multiply Numeric Variable|a *2|Same as a 2 <sup>1</sup>+|1.99.99.8|variable typing was removed| 
-|/=|Divide Numeric Variable|a /8|Same as a a / 8 <sup>1</sup>|+
  
-\\ 
-<sup>1</sup> added with version 0.9.9.10 
en/variables.1451713349.txt.gz · Last modified: 2020/02/28 10:46 (external edit)