Page 2 of 4
Posted: Fri Jan 26, 2007 1:41 am
by Mark
Cheers, Stu ;-) I'm glad it has been solved now.
Mark
Posted: Fri Jan 26, 2007 1:51 am
by stuartls
Mark,
What can the message box be used for in general? I used it like you said and that is when I got back "false". Is it used for testing a script? or? Haven't read anyting yet that covers that although Marielle did suggest "Programming for Dummies". I've programmed in the past, but in programs that no longer matter. Used to have a Lotus 1-2-3 macro that i made that took 2 hours to run. I know..... but that was years ago. So not totally "ignorant" to programming thought. I would have already bought the book "Programming for Dummies" but didn't know or think it had much stuff in it about Rev.
Stu
Posted: Fri Jan 26, 2007 2:08 am
by Mark
Stu,
Section 3.6 of the user guide (in the pdf folder of the documentation folder of the Revolution application folder) says:
The Message Box is a command line tool that allows you to run scripts or perform automated editing operations. It allows you to try out short scripts, test parts of your program, provides a convenient output window for debugging, can be used for editing and setting properties.
I use it whenever I need to run a script while I don't need to save that script.
Best,
Mark
Posted: Fri Jan 26, 2007 9:52 am
by marielle
Mark wrote:put there is a group "Quest1multi" of cd 1
If my memory is correct, this is the test for files and folders. For controls, this is a very similar construct:
Code: Select all
if exists(group "Quest1multi") then
.. do something ...
end if
The other approach is with try. In a try construct, any line of code that triggers an execution error gets the program to move to the catch part of the construct. Any line of instruction that follows the one that triggered the error in the try part is simply being ignored. (That's a bit more advanced a concept, you may want to keep it for later... however keep it in mind as something to try and understand when you become more familiar with the language)
Code: Select all
try
... do something with group "Quest1multi ...
catch tErr
... tErr contains the error message, useful to track down what the problem may be and to eventually handle trick parts directly in the program ...
end try
Posted: Fri Jan 26, 2007 10:09 am
by Mark
Hi Marielle,
There is nothing wrong with "there is a group..." to check that the group exists. This syntax can also be used with any other control.
Although I use try-control structures quite often, in aboce discussed problem a try-control structure was unnecessary.
Best,
Mark
Posted: Fri Jan 26, 2007 10:47 am
by marielle
Mark wrote:There is nothing wrong with "there is a group..."
Indeed!
there is a {object | file filePath | folder folderPath | process procName}
Use the there is a operator to make sure an object or file exists before working with it, or to find out whether there are any objects of a specified type.
Whereas:
exists(object)
Use the exists function to make sure an object exists before you try to perform an action on it, or to determine whether to create an object.
Posted: Fri Jan 26, 2007 10:49 am
by Mark
Hi Marielle,
Yes, that is exactly what everybody can read in the docs that come with Revolution.
Thanks,
Mark
Posted: Fri Jan 26, 2007 10:58 am
by marielle
Mark wrote:Yes, that is exactly what everybody can read in the docs that come with Revolution.
As you well know, there is a *lot* to read in the docs

. It takes a long time to master them completely.
Affordance is an interesting concept to remain aware of.
Affordance @ wikipedia
Psychologist James J. Gibson originally introduced the term in 1966, then explored it more fully in his book The Ecological Approach to Visual Perception in 1979. He defined affordances as referring to all "action possibilities" latent in the environment, objectively measurable, and independent of the individual's ability to recognize those possibilities. Further, those action possibilities are dependent on the capabilities of the actor. For instance, a set of steps with risers four feet high does not afford the act of climbing, if the actor is a crawling infant. So affordances must be measured always in relation to the relevant actor(s).
As well written and helpful as the docs are, their "affordance" remains very very low for new learners. Pasting a bit of the doc at a time, in the context of a question being asked, is known to greatly help new learners

.
Marielle
Posted: Fri Jan 26, 2007 11:11 am
by Mark
Sure, there is a lot to read, but most of the docs are easy to search through, although I made my own plugin to search the docs even faster.
Mark
Posted: Fri Jan 26, 2007 11:24 am
by marielle
Mark wrote:Sure, there is a lot to read, but most of the docs are easy to search through, although I made my own plugin to search the docs even faster.
(content not relevant to this thread. Go
Helpful Resources :: helpful enough for getting started? to discuss this)
Posted: Fri Jan 26, 2007 11:34 am
by Mark
Hi Marielle,
Maybe you start a new thread "making revolution more affordable" and keep everything regarding the subject inside that thread? That would probably make it easier for newcomers to decide where to go in this forum. Now, your advice for starters is scattered all over the forum, it seems.
Best,
Mark
Posted: Fri Jan 26, 2007 11:40 am
by marielle
Mark wrote:Now, your advice for starters is scattered all over the forum, it seems.
[..] I will simply delete this lead in this thread tomorrow. (Done)
Marielle
Posted: Fri Jan 26, 2007 11:54 am
by Mark
Hi Marielle,
I think Stu wrote off-list because he understood that the subject was only indirectly related to this thread. So, maybe it would have been more appropriate to start a new thread. I'm only speculating of course, as I can't read Stu's mind and I don't know what he wrote to you. Obviously, I don't mind bringing your discussion with Stu back to the forum, as your contributions are generally valuable contributions.
Thanks again,
Mark
Posted: Fri Jan 26, 2007 12:19 pm
by marielle
Mark wrote:our contributions are generally valuable contributions.
Cool, a compliment

. Likewise, Mark. I always appreciate your contributions, this one included.
Posted: Fri Jan 26, 2007 12:55 pm
by Mark
Thanks. It's fun, isn't it :-)
Mark