Home
The HyperCard Center
HyperTalk Reference
Home » HyperTalk Reference » Properties

Note: This is a work in progress and will be formatting errors. Read more about the project on the home page.

partNumber

set [the] partNumber of part   ¬
              to integer 
where integer is in the range 1 through the sum of buttons and fields in the current card or background

The partNumber property retrieves or sets the ordinal position of a button or field (that is, of a part) among the total number of all buttons and fields within the same domain (card or background).

Changing a part's partNumber moves it closer to or farther away from the front.

For example, the order of buttons and fields on a card is as follows:

button 1 button 2 field 1 field 2 button 3

The partNumber of field 1 is 3.


Examples

set the partNumber of field 5 to 1 -- farthest back
set the partNumber of cd field Names to number of parts -- closest
get the partNumber of background button "Home"

Placeholders

part
An expression that identifies a button or field by its ordinal position among all buttons and fields on the same card or bkgnd.

A button's or field’s part number is available in its Info dialog box; in a script, it is available in the object’s partNumber property.

You can use any of these forms:

[card] part posInteger [bg] part posInteger ordinal [card] [bg] partFor example:

card part 5
first card part
last background part


integer
An expression that evaluates to a positive or negative integer or to zero. For example:

3
18 - 100
-(3 * sum(1,3,4,5)) + 39
In AppleScript, integer is a value class.

Related Topics

« owner | HyperTalk Reference | pattern »

Version 0.7b1 (March 24, 2022)

Made with Macintosh

Switch to Retro View