put the filename = error
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 73
- Joined: Sat Apr 08, 2006 6:51 pm
put the filename = error
This button script works great:
on mouseUp
put the filename of this stack into msg
end mouseUp
but this button script produces and error:
on mouseUp
put the filename of this stack into nameToSave
end mouseUp
here's the error:
button "Answer File": compilation error at line 2 (Chunk: can't create a variable with that name (explicitVariables?)) near "nameToSave", char 35
what gives?
on mouseUp
put the filename of this stack into msg
end mouseUp
but this button script produces and error:
on mouseUp
put the filename of this stack into nameToSave
end mouseUp
here's the error:
button "Answer File": compilation error at line 2 (Chunk: can't create a variable with that name (explicitVariables?)) near "nameToSave", char 35
what gives?
In nova fert animus mutatas dicere formas corpora.
RE: put the filename = error
With the global explicitVariables set to true local variables must be explicitly declared with the local command.
Try the following:
on mouseUp
local nameToSave
put the filename of this stack into nameToSave
end mouseUp
on mouseUp
set the explicitVariables to false
put the filename of this stack into nameToSave
end mouseUp
Gerard McCarthy
Try the following:
on mouseUp
local nameToSave
put the filename of this stack into nameToSave
end mouseUp
on mouseUp
set the explicitVariables to false
put the filename of this stack into nameToSave
end mouseUp
Gerard McCarthy
What Gerard is saying is that in the preferences under 'script editor' 'strict compilation mode' is turned on.With the global explicitVariables set to true local variables must be explicitly declared with the local command.
Rev then enforces that you declare variables as Gerard showed. If you turn this option off your script compiles without the error. It is a way to protect you from typos in your script since if you misspell a variable name in a script it will alert you to it since you did not declare it. Misspelled variable names are hard to debug as a typo may be hard to detect.
Also this option forces you to enclose literals in quotes.
I don't use the 'strict compilation mode' since I am too lazy to declare all the variables, but that has a downside as noted above. I do enclose literals in quotes because it can get really messy without.
regards
Bernd
-
- Posts: 73
- Joined: Sat Apr 08, 2006 6:51 pm
loccal variables
Thanks for the immediate rescue. I'm an old Hyper Carder who uses Revolutionn on and off. The amazing feature growth of the system leaves me dazzled.
In nova fert animus mutatas dicere formas corpora.
to which I replyIn nova fert animus mutatas dicere formas corpora.
quamvis sint sub aqua, sub aqua errordicere temptant
which you could translate with a grain of salt as
although they are all under water, they throw an error (the bugs)
my oh my, what would Ovid say to that? Was he using Hypercard? Probably the random syntax generator which shipped with version .01. It allowed to randomly switch the order of subject object and verb on the fly as well as providing sophisticated interposition of relative clauses into the main clause with no discernible pattern.
regards
Bernd

-
- Posts: 73
- Joined: Sat Apr 08, 2006 6:51 pm
A bit of humanist wit and much appreciated, along with the technical help. My quote of Ovid refers to the RunRev project I have been working on for too many years, conversion of the textbook Latin Via Ovid to an interactive stack of stacks.bn wrote:to which I replyIn nova fert animus mutatas dicere formas corpora.
quamvis sint sub aqua, sub aqua errordicere temptant
which you could translate with a grain of salt as
although they are all under water, they throw an error (the bugs)
my oh my, what would Ovid say to that? Was he using Hypercard? Probably the random syntax generator which shipped with version .01. It allowed to randomly switch the order of subject object and verb on the fly as well as providing sophisticated interposition of relative clauses into the main clause with no discernible pattern.
regards
Bernd
:)
In nova fert animus mutatas dicere formas corpora.