Home THE HYPERCARD CENTER

HyperTalk Reference
Home » HyperTalk Reference » Functions

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

foundChunk

the foundChunk
Value returned: a character chunk expression that indicates where the most recent find command located its target string. If nothing was found, it returns empty. The chunk expression returned has the following form:

char posInteger to posInteger ¬ of container


Examples

find "Maria"
put the foundChunk

--Using foundChunk to find and highlight a string:
find string userName in field "names"
select the foundChunk

Demo Script

on foundChunkDemo
   find "foundChunkDemo" in field "Demo Script"
   get the foundChunk -- before select removes it
   wait 1 second
   select it
   answer "The foundChunk is:" & return & it
 end foundChunkDemo

Placeholders

posInteger
An expression that evaluates to a positive integer.

For example:
3
67 mod 13
the number of bg fields
the number of backgrounds
the number of cards div 2
See also: background, bkgnd, button, card, chunk, field, menu, and menuItem

container
HyperTalk DefinitionA place where you can store and retrieve a value.

There are six types of containers in HyperCard: a variable, a button, a field, the selection, the Message box, and menus.

myVariable
[the] selection
the Message box
btn 3
bg btn "Names"
card field 1
bkgnd field "Total"
menu 2
menu "Edit"
Additionally, you can refer to a button or field by its part number:

card part 1
last background part
AppleScript DefinitionAn object that contains one or more other objects, known as elements of the container. In a reference, the container specifies where to find an object. You specify containers with the reserved words of or in.

You can also use the possesive form ('s) to specify containers. For example, in

first window's name
the container is first window. The object it contains is a name property.

Related Topics

« exp, exp1, exp2 | HyperTalk Reference | foundField »


Version 0.7b1 (March 24, 2022)

Made with Macintosh

Switch to Modern View

Home
The HyperCard Center
HyperTalk Reference
Home » HyperTalk Reference » Functions

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

foundChunk

the foundChunk
Value returned: a character chunk expression that indicates where the most recent find command located its target string. If nothing was found, it returns empty. The chunk expression returned has the following form:

char posInteger to posInteger ¬ of container


Examples

find "Maria"
put the foundChunk

--Using foundChunk to find and highlight a string:
find string userName in field "names"
select the foundChunk

Demo Script

on foundChunkDemo
   find "foundChunkDemo" in field "Demo Script"
   get the foundChunk -- before select removes it
   wait 1 second
   select it
   answer "The foundChunk is:" & return & it
 end foundChunkDemo

Placeholders

posInteger
An expression that evaluates to a positive integer.

For example:
3
67 mod 13
the number of bg fields
the number of backgrounds
the number of cards div 2
See also: background, bkgnd, button, card, chunk, field, menu, and menuItem

container
HyperTalk DefinitionA place where you can store and retrieve a value.

There are six types of containers in HyperCard: a variable, a button, a field, the selection, the Message box, and menus.

myVariable
[the] selection
the Message box
btn 3
bg btn "Names"
card field 1
bkgnd field "Total"
menu 2
menu "Edit"
Additionally, you can refer to a button or field by its part number:

card part 1
last background part
AppleScript DefinitionAn object that contains one or more other objects, known as elements of the container. In a reference, the container specifies where to find an object. You specify containers with the reserved words of or in.

You can also use the possesive form ('s) to specify containers. For example, in

first window's name
the container is first window. The object it contains is a name property.

Related Topics

« exp, exp1, exp2 | HyperTalk Reference | foundField »

Version 0.7b1 (March 24, 2022)

Made with Macintosh

Switch to Retro View