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.

scroll

set [the] scroll of field to integer set the scroll of [the] card window ¬ to point

For scrolling fields, the scroll property returns or sets which lines of text currently appear (as indicated by the scroll bar). The integer represents the number of pixels that have scrolled above the top of the field’s rectangle. For example, the number of lines scrolled in card field 1 equals the scroll of card field 1 div the textHeight of card field 1.

For fields, HyperCard pins the scroll to a number between 0 and the maximum value for the field.

For the card window, the scroll property returns or sets a point that specifies the current horizontal and vertical offsets of the portion of the card currently visible in the card window. It affects the card image only when the size of the window is smaller than the size of the card.


Demo Script

on madScroller
   put the rect of card window into theRect
   set the rect of card window to left of cd window,top of cd window,¬
   left of cd window + 172, top of cd window + 64
   repeat 10 times
     set the scroll of card window to ¬
     random(width of this card),random(height of this card)
     wait 30
   end repeat
   set the rect of card window to theRect
 end madScroller

Placeholders

field
An expression that identifies a field by name, number, or id using one of the following forms (in AppleScript, use “background” in place of “bkgnd”):

card field id posInteger [of card ]card field text [of card ] -- namecard field posInteger [of card ]ordinal card field [of card ]

[bkgnd] field id posInteger [of card ][bkgnd] field text [of card ] -- name[bkgnd] field posInteger [of card ]ordinal [bkgnd] field [of card ]

For example:

card field id 3894
card field "My Notes"
card field 1
first card field
background field 3 of card 1
When used inside a field script in HyperTalk:
me
When a field receives a message:[the] target

A field can also be referred to as a part when you’re talking about its position among all buttons and fields within the same card or background.

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.

point
HyperTalk DefinitionAn expression that evaluates to a specific screen location, in the form of two integers separated by a comma.

Item 1 of a point is the horizontal offset (in pixels). Item 2 of a point is the vertical offset (in pixels). For example:

91,303
"91,303"
"30" & "," & "100"
the clickLoc
AppleScript DefinitionAn expression that evaluates to a specific screen location, in the form of a list with two integer elements. For example:

{ 91, 303 }clickLoc

Related Topics

« scriptTextSize | HyperTalk Reference | sharedHilite »


Version 0.7b1 (March 24, 2022)

Made with Macintosh

Switch to Modern View