 |
THE HYPERCARD CENTER |
|
|
Note: This is a work in progress and many formatting issues have been fixed. Read more about the project on the home page.
deletedelete chunk of container delete [menuItem of] menu delete [menuItem from] menu delete { button | field | part }
The delete command removes text from a container, menu items from a menu, menus from the menu bar, and buttons or fields from the current card or background. When you use the form delete part , deleteButton or deleteField is sent to the object that's being deleted. You can't use this command to delete a part anywhere except on the current card. Note: Using delete to delete a line is not the same as putting empty into the line: delete removes the final return character as well as the text, while putting empty into the line just removes the text. Examplesdelete item 3 of line 1 of field "Expenses" delete line 5 of button "Text Holder" put " this has a space" into theText delete character 1 of theText delete menu "File" delete menu 2 delete second menu delete menuItem "New" from menu "File" delete menuItem 2 from menu 2 delete second menuItem from second menu delete button 1 delete last card field delete background button id 1234 delete last background part
Demo Scripton surpriseDelete -- appropriate surprise with style set the cantModify of this stack to true -- to easily restore the text find string "ropriate surprise with sty" wait 1 sec delete the foundChunk wait 1 sec set cantModify of this stack to false end surpriseDelete
Related Topics Placeholders
chunkOne of the following forms (or combinations thereof): ordinal character character posInteger [to posInteger] ordinal word word posInteger [to posInteger] ordinal item item posInteger [to posInteger] ordinal line line posInteger [to posInteger]
For example: first character second item middle line character 1 char 1 to 10 word 3 item 5 to (the number of items of me) line 1 to 10 char 1 to 10 of word 2 to 4 of ¬ line 3 to 6
A chunk combined with of and a container is called a chunk expression. For example: line 1 of card field "index" Important: You can’t combine a stack name with a chunk expression—you can only refer to a chunk in the current stack. containerHyperTalk Definition A 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 Definition An 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. menuItemAn expression that evaluates to one of the following: menuItem text menuItem posInteger ordinal menuItem
For example: menuItem "New" menuItem 2 second menuItem
menuAn expression that evaluates to one of the following: menu text menu posInteger ordinal menu
For example: menu "File" menu 2 second menu
buttonHyperTalk Definition An expression that identifies a button by name, number, or id, using one of the following forms: [card] button id posInteger [of card] [card] button text [of card] -- name [card] button posInteger [of card] ordinal [card] button [of card] bkgnd button id posInteger [of card] bkgnd button text [of card] -- name bkgnd button posInteger [of card] ordinal bkgnd button [of card]
For example: card button id 3894 card button "Return" card button 1 first card button bkgnd button 2 of card 2 last bkgnd button
When used inside a button script: me When a button receives a message: [the] target A button 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. AppleScript Definition An expression that identifies a button by name, number, or id, using the same forms as HyperTalk except that “background” must be used in place of “bkgnd”. fieldAn 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] -- name card 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. partAn 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] part For example:
card part 5 first card part last background part
HyperTalk Reference
|