Scripts

Not Just Typing

Not_Just_Typing

Scripting in Revolution is a lot more than just typing instructions to the Revolution engine.

Most users wonder about some or all of the following:

• What is the name of that handler I want to call? 
• What are its parameters? 
• What does the code look like? 
• Where is that handler? Is it in the message path? Where exactly? 
• Why can't I "go back" to where i was a minute ago? 
• Is there a way to "group" handlers by their functionality without naming them strangely? 
• Why do I have to type so much when it's the same thing over and over? 
• Why can't a script editor "remember" my work in progress, especially my uncompiled scripts? 
• What happens when my GLX2 scripts has been edited by someone with an older version of Galaxy or Rev? 
• What do I do if I am editing an object and its tab is not visible?

There are features in GLX2 that answer each and every one of these questions.

NOTE: There is complete documentation on the Script menu in the Menubar docs.


Name That Handler

Name_That_Handler

• What is the name of that handler I want to call? 
• Why do I have to type so much when it's the same thing over and over?

If you have clairvoyance turned on, you just start typing and the names of suggested handlers just start appearing, along with suggested variable names and Revolution terms like commands, properties and functions. You do however, have to know the first few characters of a handler name to get some matches to appear.


Params Just Appear

Params_Just_Appear

• What are its parameters?

After using clairvoyance to find the name of that handler, choosing an item from the clairvoyance bubble will aut-complete the call to your handler, complete with it's params. It'll even select the first parameter, if there is one.


Curious about Params?

Curious_about_Params_

• What are its parameters?

What if you choose not to use some params, but later, in looking at your call to the handler, you wonder what all of the params might look like? Just put the pointer over the link to the handler and you'll see a toooltip with the params in it.


Locate That Handler

Locate_That_Handler

• Where is that handler? Is it in the message path? Where exactly?

If you see an underlined link in a GLX2 script, it is a call to a handler. If the link is also italicized, then the handler is not in the current script, but in the message path of the current object whose script you are editing.

These links allow you to peruse you code and see instantly where calls inside and outside the current script are being invoked in your code.

Proper Syntax for Creating Good Links

If you want hyperlinks to handlers to work in your scripts do not put spaces between: a function call and the first parenthesis; between "on", "function", etc. and the name of the handler.

Examples of supported syntax for creating valid links to handlers:

  put myFunction (theParam) into theVar -- NOT SUPPORTED SYNTAX
  put myFunction(theParam) into theVar -- SUPPORTED SYNTAX

  on  myCommand -- NOT SUPPORTED SYNTAX SYNTAX
  on myCommand -- SUPPORTED SYNTAX


View That Handler

• What does the code look like? (Answer one.)

Shift+Clicking a link will display the handler in the split pane so you can see it code and copy stuff from it by selecting and copying.

panes

NOTE
: You can also place the pointer above a word and then typing control+space to have that word appear in the selected text or insertion point within in the editor. Holding down shift and control while you type space will include not just a word, but also any quoted string in its entirety.


Edit That Handler

• What does the code look like? (Answer two.)

Clicking a link will take you right to the handler so you can edit it and see exactly where it is, PLUS a bread crumb leading back to where you came from is placed on the crumb bar so you can go back to where you were.

link1

These links allow you to peruse your code and see instantly where calls inside and outside the current script are being invoked in your code.

link2


Finding Your Way

crumbs2

• Why can't I "go back" to where I was a minute ago?

In the scenario depicted directly above, you can find your way back to the last few handlers you worked on. A handler name gets put on the crumb bar any time you hyperlink to or from it and anytime you option+click within the script of a handler.

Clicking a handler name on the crumb bar will take you right back to that handler with no questions asked. Isn't it fun to say "crumb bar" and "crumbs"?

For more on Crumbs, see the Crumb Bar component.


Folders Are Cool

• Is there a way to "group" handlers by their functionality without naming them strangely?

Scripters throughout history have devised ingenious and compicated ways of grouping their handlers together with comments, handler naming conventions--you'd be surprised. With folders, you may want to look at all that again.

crumbs2

You can create a folder anywhere in your scripts by simply putting a comment outside a handler that looks like this:

--> mouse handlers

This will allow you to group your handlers so you can find them easily, show and hide them in the handler list, and understand them logically as a group of handlers. Like handler links, folders give you an instant mental picture that lets you work faster.

NOTE: If a folder name matches the start of a handler name above it, GLX2 gets confused, so for the time being, this is to be avoided.

Example of naming to be avoided:

image


Work-in-progress

• Why can't a script editor "remember" my work in progress, especially my uncompiled scripts?

GLX2 respects your right to leave work half done and uncompiled as much as you like by marking any uncompiled scripts (note red colored tab and Compile button) and saving them as compressed developer resources as you work.

dirty

The next time you open an uncompiled script you have been working on, it will appear as uncompiled (or "dirty"). You can then pick up right where you left off.

This is what makes the GLX2 script editor a stateless editor. It also makes it trendously easy to use and helpful at the same time. You never have to answer any dialogs asking whether or not you want to compile an uncompiled script.

As stateless editor means never having to say you're sorry.


Other Editors

Other_Editors

• What happens when my GLX2 scripts has been edited by someone with an older version of Galaxy or Rev?

GLX2 "signs" it's object with a small checksum property that identifies the fact that you've used GLX2 on it. It will use that property to see if the script has been changed by another editor and alerts you to this fact.


Tabs Can Scroll!

Tabs_Can_Scroll_

• What do I do if I am editing an object and its tab is not visible?

Just like Crumbs, Tabs can scroll to the left and the right. All you need to do is click on any tab and drag left or right. If there are any tabs off-window, they will scroll into view.

As you move your pointer left or right, you'll notice that the appropriate tab hilites, also, letting you know what tab would be selected if you released the mouse.

NOTE: You can move the pointer above or below the tabs once you start moving it left or right...the scrolling still takes place.

NOTE.2: If you edit an object and it has a tab that is off-window, then the tab will scroll into view.

GLX2 Developed by Daniels & Mara  •  GLX2 Prices & Ordering