To Brent (L3, a breather)
Brent (and others),
I've given you a lot to think about. I want to make sure everyone is not=
running too hard. So this "lesson" is merely a review.
Programming is the art of telling a computer what to do. You speak a
computer language, a language the computer can understand. Euphoria is
such a language. You program by typing lines of instructions in a text
editor, such as Windows Notepad or EDIT (an editor that comes with all
Microsoft OS after dos 5.0). You run, catch errors, edit, and run your
program until its "perfect". Editing and running an Euphoria program is
discussed in Section 1 of REFMAN.DOC.
Everything that is interactive, and some things that are not, are
considered data. When an user enters his name, phone number, age, or
whatever, its data. Data is stored in little boxes inside the computer. =
There are two types of storage boxes.
1. Variables -- these boxes that store data that will be changed
2. constants -- one assigns a value to these boxes once. After this
one-time assignment of data to a constant, the value of the constant cann=
ot
be changed.
In Euphoria, there are four types of variables:
1. atoms
examples: 7, 18, 18/7, 6000000, 1.43819283, 3.14839583716
2. Sequences. This type of variable is sort of unique to Euphoria.
{1,2,3}
{2.5,4,6}
3. Integers. Atoms that are integers. Calculations on these are
typically faster than atoms.
4. Objects. If you tell Euphoria a data is an object, then _anything__
can go in there, sequences and atoms.
Character Strings
ASCII values range from 0 to 255. Each character has an ascii value. To=
find out specific ones, run key.ex by simply typing "key" without the
quotes. If everything is set up right, the key.bat file will run key.ex.=
=
Follow the ultra-simple instructions.
The character A has ASCII value 65. B 66, and C 67. So ABC would be
{65,66,67}
But do you want to write that sequence so mean the string ABC ? Euphoria=
provides a shortcut so express ABC.
"ABC" =3D {65,66,67}
There are ASCII atoms, too.
'A' =3D 65
'B' =3D 66
So instead of having to type the ASCII atom 66, just type what you want, =
B
in single quotes.
Some characters cannot be expressed literally. Because Euphoria interpre=
ts
quotes and apostrophes as enclosing an atom or sequence, if you _really_
want to write such a character, you have to use a backslash in front
\' means \' in the real world, but just ' in Euphoria
\" means \" in the real world, but just " in Euphoria
\\ means \\ in the real world, but just \ in Euphoria
\r carriage return (ASCII 13)
\n new line (ASCII 10) (difference is subtle, but usually unimportant. I=
may have switched the above)
\t tab
Any questions. E-mail me.
Alan
=
|
Not Categorized, Please Help
|
|