the ampersand

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
drOrganized
Posts: 24
Joined: Tue Dec 04, 2007 7:02 pm

the ampersand

Post 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?
jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2734
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: the ampersand

Post by jmburnod »

The chartonum of "&" = 38

You can try (No tested)
put numtochar(38)

No tested

Best

Jean-Marc
https://alternatic.ch
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: the ampersand

Post 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
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10504
Joined: Wed May 06, 2009 2:28 pm

Re: the ampersand

Post 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
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: the ampersand

Post by Klaus »

Hi all,

good point, Craig!

However: & <> "&"
:D

Anyway, we need to see the script, I am sure this is just a matter of correct syntax!


Best

Klaus
Post Reply