Problem with declaring local variables

Peter T. Evensen pevensen at siboneylg.com
Wed Jun 7 10:26:37 EDT 2006


Also make sure you're not using "put" with a custom property.

I had:

put "someting" into the cpCustomProperty of card "Some Card"

and I would get the "cannot create variable" error.  FINALLY I realized I 
needed to use set with a custom property:

set  the cpCustomProperty of card "Some Card" to "something"

Doh!  It seems the compiler/syntax checker could produce a more helpful 
error message in this case...

At 08:16 AM 6/7/2006, you wrote:
>Until now I've had the impression that global variables need to be declared,
>whereas local variables do not.   However, I've just noticed that (using Rev
>2.7, Mac OS X)   if I don't declare the local variable before the 
>scripting, I
>get an error message "Can't create a variable with that name
>(explicitvariables)".   This occurs whether or not explicitvariables is 
>true or false.
>However, the Rev directions indicate that it should not be necessary to 
>declare
>local variables if exlpicitvariables is false.  Is this a bug?   I've also 
>noticed
>that whereas a previously developed stack may run OK with local variables not
>declared, that as soon as I make any slight change to the script the error
>message appears.   I recognize that it's a good idea to declare local 
>variables
>to avoid inadvertent typos in the local variables, but it would seem this 
>need
>to be addressed correctly in the directions.
>Steve Goldberg
>_______________________________________________
>use-revolution mailing list
>use-revolution at lists.runrev.com
>Please visit this url to subscribe, unsubscribe and manage your 
>subscription preferences:
>http://lists.runrev.com/mailman/listinfo/use-revolution

Peter T. Evensen
http://www.PetersRoadToHealth.com
314-629-5248 or 888-682-4588 


More information about the use-livecode mailing list