Another newb question - How to you clear a field?

J. Landman Gay jacque at hyperactivesw.com
Fri May 8 14:32:36 EDT 2009


Stephen Cox wrote:
> Heh.
> 
> You know I tried that. But didn't use quotes. So I assume when referring to
> objects on cards you have to use quotes?

Literals are always quoted, so this:

   field "myField"

means a field whose name is the literal string "myField". If the quotes 
are omitted, the engine will try to find a variable named myField. 
Sometimes the engine is smart enough to realize that if there is no 
variable with that name, there may be a field with that name which the 
script has neglected to quote. In that case, the string may resolve 
correctly to the field name -- but you can't count on it. And if literal 
names are not quoted, the engine takes twice as long to execute the 
statement because of the additional lookup.

Whether or not the engine can resolve an unquoted literal depends 
somewhat on the position of the string in the command line. It gets 
complicated, so the best rule of thumb is: don't quote variables, always 
quote literal strings.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list