* tiaxgame code:
Var $input = (8-2)
Print \$input = $input

=> $input = 6
I want "replace" from "(" to "\(" of $input,
- (no add "\" )

But not replace
And "length" $input = 1
!!!
2014-04-17 00:16 · (0)
* Graham * tiaxgame so do you want $input to equal (8-2)
and not 6
or what ?
because I do not understand nor can I see an error
Things in brackets get evaluated thats not an error
if you want to make the variable actually (8-2) you need to use either \
or replace ( and ) with ( and )
2014-04-17 00:59 (edited 2014-04-17 01:23 by Graham ) · (0)
* tiaxgame * Graham var $data = (8-2)
Var $cp = call chr $val=59
assign $data=call str_replace $subject=$data;$search=(;$replace=&#40$cp;
assign $data=call str_replace $subject=$data;$search=);$replace=&#41$cp;
Print $data

I want print (8-2)
But i can't replace it
It = 6
2014-04-17 04:26 · (0)
* Graham * tiaxgame No that will not work because expressions inside ( and ) are evaluated its not a bug
it is just the way that xtscript works and cannot be changed
if you wish to represent ( and ) in a variable they MUST be escaped or replaced by entities
ie
var $data=(8-2)
var $data=\(8-2\)
There is no other choice unless you use print_raw
print_raw (8-2)
will output (8-2) as nothing is evaluated
2014-04-17 08:28 (edited 2014-04-17 08:48 by Graham ) · (0)
* tiaxgame * Graham So if nguohp Do not
write "(8-2)" on filelist,
blog, guestbook.
xtscript treated, it will
bar "6"!??
2014-04-17 08:42 · (0)
* tiaxgame * Graham Ok! Print_raw
I will test
Thank
2014-04-17 08:45 · (0)
* Graham * tiaxgame It will also work if you put the data containing the brackets in a plain text file
and output the "source" of that file
so the file "data" contains (8-2)
and your script uses
call source $file=data;$htmlsafe=1
2014-04-17 08:48 · (0)
* tiaxgame * Graham if used print_raw => i can't used var name other
Else "call source"
Can me used for blog and guestbook!? :(
2014-04-17 09:05 · (0)
* Graham * tiaxgame Without knowing the rest of the script I do not have a clue
var $blog=<xt:blog/>
print $blog
has no problem with ( )
2014-04-17 09:35 · (0)
* tiaxgame * Graham But! Guestbook!? :(
2014-04-17 10:55 (edited 2014-04-17 10:59 by tiaxgame ) · (0)

Online: Guests: 1