Amiga World Official AmigaDOS 2 Companion - eBook-ENG

Page 333

Introduction to ARexx

315

The exponentiation operator returned 10 raised to the 3rd power, or 1000. The modulus operator returned the remainder of 10 divided by 3, while the integer division operator returned the integer portion of the same operation. In addition to the operations that act on numeric data, ARexx has three opera tors for string data, all of which concatenate one string with another. The first operator is simply a blank space. If you use it between two variables containing character information or between a variable and a literal, you get a combina tion of the two with a blank in between. For example: /* Combining Strings */ First_Name = 'George' Name = First_Name 'Bush' say Name

prints out George

Bush

The second operator (II) concatenates without an intervening space. The third concatenation operator is implied; if you don't leave a space between strings,

whether literal strings or variables, ARexx concatenates them. For example: /* Read My Strings*/ first_name = 'George' last_name = 'Bush' name = first_name II last_name namel = first_name'Bush' say name namel

gives you GeorgeBush GeorgeBush

Note that the Commodore manual sometimes shows the concatenation char acter to be two Greek letters not available on an Amiga keyboard. Just remem ber that the operator is two vertical bars produced by the shifted-Backslash key.

Basic Input and Output You've already seen how the Say command outputs information to the screen. You can input data to an ARexx program with the pull command. By not hav ing to specify the value of every variable when you create a program, the pull


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.