mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Be more strict about type conversion:
* numbers are no longer auto converted to booleans, use to_boolean or != 0
* booleans are no longer auto converted to numbers, use to_int
* strings will soon no longer be auto converted to numbers, use to_int
Added version information ("since 0.3.7") to documentation
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1006 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -22,3 +22,5 @@ The operators @or@, @and@ and @xor@ combine two booleans:
|
||||
| @true@ @false@ @true@ @false@ @true@
|
||||
| @true@ @true@ @true@ @true@ @false@
|
||||
|
||||
--See also--
|
||||
| [[fun:to_boolean]] Convert a value to a boolean
|
||||
|
||||
@@ -27,3 +27,6 @@ For example:
|
||||
| @rgba(0,0,0,0)@ transparent <div style="border:1px solid black; width:30px;height:15px;text-align:center;">over</div>
|
||||
| @rgba(255,0,0,128)@ transparent red <div style="border:1px solid black; background:rgb(255,128,128);color:rgb(128,0,0);width:30px;height:15px;text-align:center;">over</div>
|
||||
| @rgba(0,0,255,192)@ transparent blue <div style="border:1px solid black; background:rgb(64,64,255);color:rgb(0,0,192);width:30px;height:15px;text-align:center;">over</div>
|
||||
|
||||
--See also--
|
||||
| [[fun:to_color]] Convert any value to a color
|
||||
|
||||
+2
-1
@@ -12,4 +12,5 @@ Conversion from integer to real numbers happens automatically in scripting.
|
||||
> 123.1 + 456 * -1
|
||||
|
||||
--See also--
|
||||
* [[type:int]]
|
||||
| [[type:int]] Integer numbers
|
||||
| [[fun:to_real]] Convert a value to a real number
|
||||
|
||||
+2
-1
@@ -10,4 +10,5 @@ In many cases negative numbers don't make sense, but the program never complains
|
||||
> 123 + 456 * -1
|
||||
|
||||
--See also--
|
||||
* [[type:double]]
|
||||
| [[type:double]] Number type that can contain fractional values.
|
||||
| [[fun:to_int]] Convert a value to an integer number
|
||||
|
||||
+9
-2
@@ -25,10 +25,17 @@ Sections between curly braces are interpreted as script code, that is concatenta
|
||||
> "ab{1 + 1}c" == "ab2c"
|
||||
This can be nested arbitrarily.
|
||||
|
||||
The @+@ operator concatenates strings. Numbers and most other values are automatically converted to strings when needed.
|
||||
The @+@ operator concatenates strings. Numbers and most other values are automatically converted to strings when needed. This conversion can be forced with the [[fun:to_string]] function.
|
||||
|
||||
Using the @[]@ or @.@ operator characters in a string can be selected. 0 is the first character:
|
||||
> "xyz"[0] == "x"
|
||||
> "xyz".0 == "x" # same thing
|
||||
> "xyz".1 == "y"
|
||||
> "xyz".2 == "z"
|
||||
It is an error to select characters outside the string
|
||||
> "xyz".10 # error
|
||||
> "xyz".10 # error
|
||||
|
||||
--See also--
|
||||
| [[type:tagged string]] A string containg tags.
|
||||
| [[fun:to_string]] Convert any value to a [[type:string]]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user