Size: 3363
Comment:
|
← Revision 15 as of 2018-01-02 11:35:32 ⇥
Size: 5588
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 4: | Line 4: |
||<tablewidth="796px" tableheight="123px"#cccccc>'''Symbol ''' ||<#cccccc>'''Name''' ||<#cccccc>'''Description ''' ||||<style="text-align:center"> || | ||<tablewidth="796px" tableheight="123px"#cccccc>'''Symbol ''' ||<#cccccc>'''Name''' ||<#cccccc>'''Description ''' ||||<style="text-align:center"> || |
Line 6: | Line 6: |
||-- ||decrement ||Subtracts 1 from the operand. ** Not implemented yet|| | ||-- ||decrement ||Subtracts 1 from the operand. || ||++ ||increment ||Adds 1 to the operand. || |
Line 8: | Line 9: |
||++ ||increment ||Adds 1 to an expression. ** Not implemented yet|| | ||++ ||increment ||Adds 1 to an expression. ** Not implemented yet || |
Line 12: | Line 13: |
|| << ||left shift ||Shifts the first operand by the given number of bits to the left. || || >> ||right shift ||Shifts the first operand by the given number of bits to the right. || |
|
Line 14: | Line 20: |
||<tablewidth="796px" tableheight="123px"#cccccc>'''Symbol ''' ||<#cccccc>'''Name''' ||<#cccccc>'''Description ''' ||||<style="text-align:center"> || | ||<tablewidth="796px" tableheight="123px"#cccccc>'''Symbol ''' ||<#cccccc>'''Name''' ||<#cccccc>'''Description ''' ||||<style="text-align:center"> || ||&& ||and ||Checks to see if both/all expressions are true. (alternatively: and) || ||`||` ||or ||Checks to see if either/any expressions are true.(alternatively: or) || |
Line 18: | Line 26: |
||!= ||inequality ||Tests for the exact opposite of the equality (==) operator. || | ||!= ||inequality ||Tests for the exact opposite of the equality (==) operator. (Alternatively: <>)|| |
Line 21: | Line 29: |
||is ||is ||Evaluates whether an object is compatible with a specific data type. || ||in ||in ||Evaluates whether the given property is part of a specific object. || ||| ||bitwise OR ||Returns a 1 in each bit position for which the corresponding bits of either or both operands are 1's. || ||^ ||bitwise XOR ||Returns a 1 in each bit position for which the corresponding bits of either but not both operands are 1's.|| ||& ||bitwise AND ||Returns a 1 in each bit position for which the corresponding bits of both operands are 1's. |
|
Line 23: | Line 37: |
||<tablewidth="796px" tableheight="43px"#cccccc>'''Symbol ''' ||<#cccccc>'''Name''' ||<#cccccc>'''Description ''' ||||<style="text-align:center"> || | ||<tablewidth="796px" tableheight="43px"#cccccc>'''Symbol ''' ||<#cccccc>'''Name''' ||<#cccccc>'''Description ''' ||||<style="text-align:center"> || |
Line 25: | Line 39: |
||+= ||Addition assignment ||Adds the value of right operand (expression2) to expression1 and assigns the result. || ||-= ||Subtraction assignment ||Subtracts the value of right operand (expression2) from expression1 and assigns the result. || ||*= ||Multiplication assignment ||Multiplies the value of the two expressions and assigns the result. || ||/= ||Division assignment ||Divides the value of the first expression by that of the second and assigns the result. || |
|
Line 27: | Line 46: |
||<tablewidth="796px" tableheight="53px"#cccccc>'''Symbol ''' ||<#cccccc>'''Name''' ||<#cccccc>'''Description ''' ||||<style="text-align:center"> || | ||<tablewidth="796px" tableheight="53px"#cccccc>'''Symbol ''' ||<#cccccc>'''Name''' ||<#cccccc>'''Description ''' ||||<style="text-align:center"> || |
Line 31: | Line 50: |
'''Other''' ||<tablewidth="796px" tableheight="53px"#cccccc>'''Symbol ''' ||<#cccccc>'''Name''' ||<#cccccc>'''Description ''' ||||<style="text-align:center"> || ||@ ||Silent mode ||When used at the start of a line it suppresses all log-based output from that single line. || ||! ||Negation/NOT || Negates the following expression. || ||? ||Conditional/ternary || if the given condition is true, the first value is given, otherwise the second is given. || |
|
Line 33: | Line 64: |
'''Arithmetic''' {{{ | '''Arithmetic''' {{{ |
Line 42: | Line 75: |
'''Comparison''' | |
Line 43: | Line 77: |
'''Comparison''' {{{ | {{{ |
Line 57: | Line 91: |
'''Assignment''' | |
Line 58: | Line 93: |
'''Assignment''' {{{ | {{{ |
Line 67: | Line 102: |
'''String''' | |
Line 68: | Line 104: |
'''String''' {{{ | {{{ |
Line 78: | Line 114: |
{{{ // let us know if the variable is true using a conditional operator. var = true echo "var " + (var == true ? "is" : "is not") + " true" Result: 11:17:03 var is true 11:17:04 Script stopped }}} |
|
Line 79: | Line 125: |
ScriptBasicSyntax | CategoryConstants |
The following symbols are characters that specify how to combine, compare, or modify the values of an expression. These will be used in performing math operations, setting variables, and comparing operators or variables in conditional statements (ifgoto, ifgosub).
Arithmetic
Symbol |
Name |
Description |
|
|
+ |
addition |
Adds numeric expressions. |
||
-- |
decrement |
Subtracts 1 from the operand. |
||
++ |
increment |
Adds 1 to the operand. |
||
/ |
division |
Divides expression1 by expression2. |
||
++ |
increment |
Adds 1 to an expression. ** Not implemented yet |
||
MOD |
modulo |
Calculates the remainder of expression1 divided by expression2. |
||
* |
multiplication |
Multiplies two numerical expressions. |
||
- |
subtraction |
Used for negating or subtracting. |
||
<< |
left shift |
Shifts the first operand by the given number of bits to the left. |
||
>> |
right shift |
Shifts the first operand by the given number of bits to the right. |
Comparison
Symbol |
Name |
Description |
|
|
&& |
and |
Checks to see if both/all expressions are true. (alternatively: and) |
||
|| |
or |
Checks to see if either/any expressions are true.(alternatively: or) |
||
== |
equality |
Tests two expressions for equality. |
||
> |
greater than |
Compares two expressions and determines whether expression1 is greater than expression2; if it is, the result is true. |
||
>= |
greater than or equal to |
Compares two expressions and determines whether expression1 is greater than or equal to expression2 (true) or expression1 is less than expression2 (false). |
||
!= |
inequality |
Tests for the exact opposite of the equality (==) operator. (Alternatively: <>) |
||
< |
less than |
Compares two expressions and determines whether expression1 is less than expression2; if so, the result is true. |
||
<= |
less than or equal to |
Compares two expressions and determines whether expression1 is less than or equal to expression2; if it is, the result is true. |
||
is |
is |
Evaluates whether an object is compatible with a specific data type. |
||
in |
in |
Evaluates whether the given property is part of a specific object. |
||
| |
bitwise OR |
Returns a 1 in each bit position for which the corresponding bits of either or both operands are 1's. |
||
^ |
bitwise XOR |
Returns a 1 in each bit position for which the corresponding bits of either but not both operands are 1's. |
||& ||bitwise AND ||Returns a 1 in each bit position for which the corresponding bits of both operands are 1's.
Assignment
Symbol |
Name |
Description |
|
|
= |
assignment |
Assigns the value of expression2 (the operand on the right) to the variable, array element, or property in expression1. |
||
+= |
Addition assignment |
Adds the value of right operand (expression2) to expression1 and assigns the result. |
||
-= |
Subtraction assignment |
Subtracts the value of right operand (expression2) from expression1 and assigns the result. |
||
*= |
Multiplication assignment |
Multiplies the value of the two expressions and assigns the result. |
||
/= |
Division assignment |
Divides the value of the first expression by that of the second and assigns the result. |
String
Symbol |
Name |
Description |
|
|
+ |
concatenation |
Concatenates (combines) strings. |
||
" |
string delimiter |
When used before and after characters, indicates that the characters have a literal value and are considered a string, not a variable, numerical value, or other element. |
Other
Symbol |
Name |
Description |
|
|
@ |
Silent mode |
When used at the start of a line it suppresses all log-based output from that single line. |
||
! |
Negation/NOT |
Negates the following expression. |
||
? |
Conditional/ternary |
if the given condition is true, the first value is given, otherwise the second is given. |
Examples:
Arithmetic
// Math! myVar=2 echo 10 * myVar Result: 17:49:02 20 17:49:03 Script stopped
Comparison
// Testing two numbers using comparison ifgoto (1 != 2) doesnot echo "They are equal!" end label doesnot echo "They are not equal!" end Result: 17:25:54 They are not equal! 17:25:55 Script stopped
Assignment
//Setting a variable called myVar and giving it a value of 1. myVar=1 echo "My variable is " + myVar Result: 17:47:31 My variable is 1 17:47:32 Script stopped
String
//Combine two strings together to form a greeting myVar="Hello" myVar2=" there!" echo myVar + myVar2 Result: 17:56:38 Hello there! 17:56:39 Script stopped
// let us know if the variable is true using a conditional operator. var = true echo "var " + (var == true ? "is" : "is not") + " true" Result: 11:17:03 var is true 11:17:04 Script stopped