The Short/Long Name Of...?

stephen barncard stephenREVOLUTION2 at barncard.com
Mon Nov 9 13:31:31 EST 2009


1. Read Richard Gaskin's classic explanation of the message path:

http://www.fourthworld.com/embassy/articles/revolution_message_path.html

2.  Look up    NAME and ID in the docs:  (reprinted here)

ID:

The short ID of an object is its ID number. If you don't specify a modifier
for the ID property, you get the short ID form.


The abbreviated ID of an object is the object's type, followed by "id",
followed by the object's short ID. For example, if a button's short ID is
"27", its abbreviated ID is "button id 27".


The long id of an object includes information about its *owner* (and about
the owner of that object, and so forth). For example, suppose a stack named
"My Stack" contains a card whose ID is 11. This card has a group whose ID is
28, which in turn contains a button whose ID is 34. The card also has a card
field whose ID is 46. If "My Stack" is a main stack and it's in a file whose
path is "/Drive/Folder/Stack.rev", the long IDs of these objects look like
this:

* The stack: stack "/Drive/Folder/Stack.rev"

* The group: group id 2238 of card ID 1001 of stack
"/Drive/Folder/Stack.rev"

* The card: card id 1001 of stack "/Drive/Folder/Stack.rev"

* The grouped button: button id 34 of group id 2238 of card id 1001 of stack
"/Drive/Folder/Stack.rev"

* The card field: field id 46 of card id 1001 of stack
"/Drive/Folder/Stack.rev"

If the stack is a substack, its *ID* is included in the long name of each of
its objects, before the path of the main stack.


The long ID of a group includes the *ID* of the current card. If the group
does not appear on the current card, requesting its *ID* causes an execution
error. If you need to get the *ID* of a group, use the "background"
terminology instead.


The long ID of a background includes the *ID* of the current card, if the
background appears on the current card. If not, the long *ID* of the
background includes the ID of the first card the background appears on.


If an object's *name* is empty, getting its name yields its *ID* property
instead.



 NAME:

*  Important!*  On OS X systems, standalone applications are stored as
application bundles. A bundle behaves like a file but is actually a folder,
and the main stack of a standalone application is inside this folder. The
long name of a stack in an application is the location of the application
inside the bundle, not the bundle's location. For example, if the
bundle'sfile path is "/Volumes/Disk/MyApp.app/", the long name of the
application's main stack might be
"/Volumes/Disk/MyApp.app/Contents/MacOS/MyApp".


If the stack is a substack, its name is included in the long names of its
objects, before the path of the main stack:

  stack "My Substack" of stack "/Drive/Folder/Stack.rev"


The long *name* of a group includes the name of the current card. If the
group does not appear on the current card, requesting its *name* results in
an execution error. If you need to get the name of a group that is not on
the current card, use the "background" terminology instead.


The long *name* of a background includes the name of the current card, if
the background appears on the current card. If not, the long name of the
background includes the name of the first card the background appears on.


You can use an object's *name* to refer to the object in a statement.
However, the *name* need not be seen on screen, even if the object is one
that normally has a visible name (such as a button). If a stack or control's
label property is not empty, the label property is used when a visible label
is displayed. If a stack's label property is empty, its *name* is used as
the window title. Likewise, if a control's label property is empty, its *
name* is used as the label. This means that you can use any string you want
for the *name* without worrying about the user-interface impact on your
application: if the *name* is not user-friendly, set the label to something
that is.



-------------------------
Stephen Barncard
San Francisco
http://houseofcubes.com/disco.irev


2009/11/9 David Coker <davidocoker at gmail.com>

> Hello folks,
> Been busy reading various forms of Rev documentation and have several times
> come across a reference of using the short/long names of...(whatever).
>
> Unfortunately, I haven't (yet) found anything that defines either term, nor
> the "how's or why's" of their usage. To a lesser degree, how about
> clarifying the use of front/back scripts?
>
> I'm just about eyebrow deep into some new areas of Rev usage (for me at
> least) and would greatly appreciate a heads up and/or link to any resource
> that might help me get my mind wrapped around these subjects.
>
> Regards,
> DavidC.
> _______________________________________________
> 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
>



More information about the use-livecode mailing list