aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/src
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-02-04 21:52:48 +1000
committerDavid Walter Seikel2012-02-04 21:52:48 +1000
commit0626bc79168a4735df9083be616efb05bb106de6 (patch)
tree644e439264b635f23c02f02d2df49d50d88b3987 /LuaSL/src
parentFix up constant variables and local crements. (diff)
downloadSledjHamr-0626bc79168a4735df9083be616efb05bb106de6.zip
SledjHamr-0626bc79168a4735df9083be616efb05bb106de6.tar.gz
SledjHamr-0626bc79168a4735df9083be616efb05bb106de6.tar.bz2
SledjHamr-0626bc79168a4735df9083be616efb05bb106de6.tar.xz
Cooment a problem with typecasting strings to integers.
Diffstat (limited to 'LuaSL/src')
-rw-r--r--LuaSL/src/LuaSL_compile.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/LuaSL/src/LuaSL_compile.c b/LuaSL/src/LuaSL_compile.c
index d73b145..a9375d9 100644
--- a/LuaSL/src/LuaSL_compile.c
+++ b/LuaSL/src/LuaSL_compile.c
@@ -1,5 +1,23 @@
1#include "LuaSL.h" 1#include "LuaSL.h"
2 2
3/* TODO -
4Bit of a problem, but I think it will go away once llGetSubString() is implemented.
5The problem is that Lua can't convert the string "0x" to a number, though it's fine with "0x0".
6In LSL any string that does not represent a number gets converted to 0 by a typecast.
7
8In other cases the LSL code is typecasting a string to an integer, but Lua can't coz it's not a real number in the string.
9
10Sooo, should actually implement that typecast.
11
12function --[[integer]] channel()
13 return --[[(integer)]] ("0x" .. _LSL.llGetSubString( --[[(string)]] _LSL.llGetKey(), -4, -1));
14end
15
16function setBalls( --[[string]] cmd)
17 local --[[integer]] ch=channel();
18 _LSL.llSay(ch+ix, cmd);
19end
20*/
3 21
4 22
5static LSL_Leaf *evaluateFloatToken(LSL_Leaf *content, LSL_Leaf *left, LSL_Leaf *right); 23static LSL_Leaf *evaluateFloatToken(LSL_Leaf *content, LSL_Leaf *left, LSL_Leaf *right);