Language Guide
ix
Recursive Subroutines 225
Saving and Loading Libraries of Subroutines 226
Subroutine Definitions and Calls 228
Subroutines With Labeled Parameters 229
Subroutine Definition, Labeled Parameters 229
Subroutine Call, Labeled Parameters 230
Examples of Subroutines With Labeled Parameters 232
Subroutines With Positional Parameters 235
Subroutine Definition, Positional Parameters 235
Subroutine Call, Positional Parameters 236
Examples of Subroutines With Positional Parameters 238
The Return Statement 239
Return 240
Command Handlers 241
Command Handler Definition 241
Command Handlers for Script Applications 243
Run Handlers 243
Open Handlers 246
Handlers for Stay-Open Script Applications 247
Idle Handlers 248
Quit Handlers 249
Interrupting a Script Application’s Handlers 250
Calling a Script Application 251
Scope of Script Variables and Properties 252
Scope of Properties and Variables Declared at the Top Level
of a Script 254
Scope of Properties and Variables Declared in a Script Object 258
Scope of Variables Declared in a Handler 263
Chapter 9 Script Objects
265
About Script Objects 265
Defining Script Objects 267
Sending Commands to Script Objects 268
Initializing Script Objects 269
Inheritance and Delegation 271