Page 1 of 1
the ampersand
Posted: Sun Mar 06, 2011 8:24 pm
by drOrganized
I am writing a script that creates HTTP://... addresses and I need to write an ampersand ("&") but when I do this the script evaluates & as an operator. How can I insert an ampersand as a regular character into an argument?
Re: the ampersand
Posted: Sun Mar 06, 2011 8:42 pm
by jmburnod
The chartonum of "&" = 38
You can try (No tested)
put numtochar(38)
No tested
Best
Jean-Marc
Re: the ampersand
Posted: Sun Mar 06, 2011 9:02 pm
by Klaus
Hi drOrganized,
sorry, don't get this?!
If the & is in quotes then it will be treated as a "regular" string like any other character.
What did you script so far?
Best
Klaus
Re: the ampersand
Posted: Mon Mar 07, 2011 3:24 am
by dunbarx
Interesting. This was the very reason that such chars as quotes were also given the status of a constant, so they could be embedded into a string without acting like, literally, quotes.
Ampersands have no such constant counterpart. This might be a good thing to send to Scotland.
Craig Newman
Re: the ampersand
Posted: Mon Mar 07, 2011 11:43 am
by Klaus
Hi all,
good point, Craig!
However: & <> "&"
Anyway, we need to see the script, I am sure this is just a matter of correct syntax!
Best
Klaus