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
!!!
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 )
tiaxgame
Graham var $data = (8-2)
Var $cp = call chr $val=59
assign $data=call str_replace $subject=$data;$search=(;$replace=($cp;
assign $data=call str_replace $subject=$data;$search=);$replace=)$cp;
Print $data
I want print (8-2)
But i can't replace it
It = 6
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
tiaxgame
Graham So if nguohp Do not
write "(8-2)" on filelist,
blog, guestbook.
xtscript treated, it will
bar "6"!??
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
tiaxgame
Graham if used print_raw => i can't used var name other
Else "call source"
Can me used for blog and guestbook!?
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 ( )