2 . ± .. : lab4.1.html 4 lab4.2.html 5 lab4.3.html 6 lab4.4.html 7 lab4.5.html 8„ lab4.6.htmlptemp CS 10, Spring 1998 -- Lab 4.1

CS 10, Spring 1998

Lab 4.1 Introduction to Scripting with HyperTalk


The purpose of this lab is to introduce you to the HyperTalk programming language. Refer to pages 379-384 of the Appendix for a summary of the HyperTalk vocabulary.

Assignment for Next Lab


Lab 4.1 Instructions

  1. Copy module4 from the Classes file server to your disk. Remember to drag the file server icon to the trash once you've copied today's files.

  2. Begin with lab exercise 1 on page 121.

  3. When you have finished lab exercise 1, open a new copy of the stack "No Account." We want to add a new card to this stack which will have a different background from the current one. To do this, create a new background. This automatically creates a new card with this background.

  4. Create a field on this card that says "Welcome to stack "No Account" "

  5. Modify the stack script so that when the stack is opened, the first card which appears is the card you just created.

  6. Add a button to the new card which will save a copy of this stack.

  7. Add a button to the new card. Write a script for this button which will link it to the original card.

  8. Modify the stack script so that when the stack is opened, the menu bar disappears.

  9. Add a button to the "welcome" card which will display the menubar.

  10. Add a line to the stack script so that the "welcome" field is locked when the stack is opened.

    When you have finished, call one of us over to show us your changes.


Hypertalk Syntax

Syntax statements show the most general form of a command or function with all the elements in the correct order. The syntax statements shown below use the following typographic conventions. Words or phrases in this kind of type are Hypertalk keywords that you type exactly as shown. Square brackets [ ] enclose optional elements that may be included if you need them. (Don't type the brackets.) Emphasized words are placeholders describing general elements, not specific names. For example, property stands for any of the Hypertalk properties associated with the given object, such as lockText or visible.

Some Commands

go [to] stack "stack name"
go [to] card "card name" [of stack "stack name"]

set [the] property to expression
set [the] property of object to expression

show button
show field

hide button
hide field

doMenu "command from the menu bar"

Some Properties

Global: userLevel, cursor
Button: hilite, icon, name, visible
Field: lockText, scroll, showLines, visible