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
Location: Saratoga Springs

the ampersand

Post by drOrganized » Sun Mar 06, 2011 8:24 pm

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: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: the ampersand

Post by jmburnod » Sun Mar 06, 2011 8:42 pm

The chartonum of "&" = 38

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

No tested

Best

Jean-Marc
https://alternatic.ch

Klaus
Posts: 13878
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: the ampersand

Post by Klaus » Sun Mar 06, 2011 9:02 pm

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: 9785
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: the ampersand

Post by dunbarx » Mon Mar 07, 2011 3:24 am

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: 13878
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: the ampersand

Post by Klaus » Mon Mar 07, 2011 11:43 am

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

Return to “Getting Started with LiveCode - Complete Beginners”