Newbie questions
Richard Gaskin
ambassador at fourthworld.com
Thu Oct 30 02:32:37 EST 2003
Scott Rossi wrote:
> On 10/29/03 8:48 PM, "Richard Gaskin" <ambassador at fourthworld.com> wrote:
>
>>> I am running into a very basic problem: None of my
>>> scripts execute. For example, I have this script in card 2
>>>
>>> on closecard
>>> global name, age, education, occupation, gender, handedness, marital
>>> put fld "name" into name
>>
>> Another benefit to the "Hungarian-lite" notation described in this week's
>> Handy Handlers column at
>> <http://www.revjournal.com/comments.php?id=P57_0_1_0> is that it greatly
>> reduces the potential for having variable names that are reserved words.
>
> At the risk of contradicting Richard's advice and useful style guide on his
> site, you might try prepending your object names with an underscore (ie
> field _name). I use this technique in my scripts and this prevents any
> confusion with reserved words. Some folks have complained that use of the
> underscore prevents you from selecting the entire name by doubleclicking in
> the script editor, but I find this to be a minor inconvenience (especially
> since you don't need to change the underscore itself when editing the name,
> for example).
A single character is a single character. It could be anything that helps
prevent name-space conflicts. The "g" has an additional value as a
mnemonic; "g" means "global", and it lets you use other chars for other
types (e.g., "p" for "parameter").
If you use an underscore for globals, what do you use for other types?
--
Richard Gaskin
Fourth World Media Corporation
___________________________________________________________
Ambassador at FourthWorld.com http://www.FourthWorld.com
Tel: 323-225-3717 AIM: FourthWorldInc
More information about the use-livecode
mailing list