What is the difference between a ' and a " ?

Brian Yennie briany at qldlearning.com
Fri Jun 25 23:03:24 EDT 2004


Alex,

A few things that might help a little:

 > If you set explicitVars to TRUE, you'll get compile errors anytime 
you try to quote something with a single quote, because it will look 
like an undeclared variable. Caveats: you'll have to declare all of you 
variables, and problems have been reported with the IDE running with 
explicitVars turned on. This might have to wait until the IDE is 
offficially explicitVars- safe, but last I checked RunRev was working 
hard on it.

 > numToChar() and charToNum() have been known to carry people on 
chases, because of the non-obvious behavior: if you pass more than one 
character charToNum() it will just report on the first character of the 
string (in this case, your single quote). Looks like maybe you already 
figured this, but it's one of those weird things that I've seen people 
trip on.

 > If you make a habit of repeating string literals as little as 
possible (i.e. declaring constants or storing the values into variables 
early on) you'll probably find that you don't type them that often in a 
context that doesn't cause an error. If you are building literal 
strings with quotes, there's also the "quote" constant.

Dunno how much that helps, but hopefully a little!

- Brian

>
> I've just spent a long time puzzling over a stupid bug of mine.
>
> I had written something like
>
>   put (numToChar( charToNum('a') + something)
>
> not knowing that 'a' is different from "a"
>
> But even now that I know it, I can't find anything in the documents to 
> explain what 'a' does mean.
>
> Any clues for me, please ?
>
> I suspect this will be a common mis-type for me in the first couple of 
> months - so any way to make single quotes cause an error/warning would 
> be helpful.
>
> Thanks
> -- Alex Tweedly.
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.707 / Virus Database: 463 - Release Date: 15/06/2004
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution



More information about the use-livecode mailing list