Documentation Archive Developer
Search
Top

The WebScript Language


To speed the development cycle, you may want to write your application in a scripting language. The WebObjects scripting language is called WebScript. You can write all or part of your WebObjects application in WebScript.

This chapter tells you everything you need to know to use the WebScript language: its syntax and language constructs. WebScript is very similar to Objective-C. If you already know Objective-C, you may want to just scan this chapter and pay special attention to the section "WebScript for Objective-C Developers", which describes the differences between WebScript and Objective-C.

WebScript is an object-oriented programming language. This chapter attempts to give you a brief introduction to the object-oriented concepts you'll need to know to follow the discussion, but it by no means teaches you object-oriented programming. To learn object-oriented programming, there are several books you can read, such as Object-Oriented Programming and the Objective-C Language.

Objects in WebScript

WebScript Language Elements
Variables
Variables and Scope
Assigning Values to Variables
Methods
Invoking Methods
Accessor Methods
Sending a Message to a Class
Creating Instances of Classes
Data Types
Statements and Operators
Control-Flow Statements
Arithmetic Operators
Logical Operators
Relational Operators
Increment and Decrement Operators
Reserved Words
"Modern" WebScript Syntax

Advanced WebScript
Scripted Classes
Categories

WebScript for Objective-C Developers
Accessing WebScript Methods From Objective-C Code

First Section