2 questions: Looking at Rev menu scripts - command A

Jeanne A. E. DeVoto jeanne at runrev.com
Fri Jan 24 15:33:01 EST 2003


At 11:55 AM -0800 1/24/03, Mark Swindell wrote:
>How can one take a peek at the scripts behind the rev menus?  I wanted to
>see how they script a select all (command A) for my own stack, as an
>example.

The menus are contained in a stack called "revmenus". You can either access
this stack in the App Overview, or use a statement like the following in
the message box:

  edit script of button "File" of stack "revmenubar"

(substitute whatever menu name you want to look at for "File")



>BTW Could someone explain the logic behind this expression for me? (I found
>it in a list search, and it seems to do the trick.)
>
>  case "Select All"
>    select line 1 to -1 of the target
>    break

I assume you're puzzled about the second line. In chunk expressions, a
minus sign means "from the end" of the string, so "line -1" of something is
the last line. (Other examples: "char -2" is the second-to-last character,
"item -4" is the fourth-to-last item, etc.)

"select line 1 to -1" means "select all the lines" of the target field.

--
Jeanne A. E. DeVoto ~ jeanne at runrev.com
Runtime Revolution Limited - The Solution for Software Development
http://www.runrev.com/





More information about the use-livecode mailing list