From: Rick_Michael_Cortese@cup.portal.com
Newsgroups: comp.sys.atari.8bit
Subject: Re: A few more Action! questions. (Sorry about the format, stup
Date: Tue, 13 Oct 92 12:38:21 PDT
Organization: The Portal System (TM)

Don't have your manual yet? Don't be
suprised if when you get it, you still
can't figure things out <g>. It has to
be the worst manual ever written.
1.  How do you access individual
elements of a CHAR ARRAY?  Just a few
oddball notes.  I don't believe Action
treats CHAR any dif then BYTE, this is
inconsistant with the 'C language where
a char is positive if it's 0-127,
negative if it's 128-255, so allow for
that when you program. Anyway, you
normally just declare
Char ARRAY buffer(200)
then access it just like you would an
array in BASIC, i.e.
buffer(0)=>first element
buffer(10)=>tenth element etc.
You can also declare arrays and specify
an address:
BYTE ARRAY colreg=708
then access them with statements like:
colreg(0)=33
colreg(1)=222
This is really common in Action, no more
having to remember the horizontal
postion reg of players, just tell Action
the starting address of whatever you
need, then use the right number. I've
heard this and pointers are the fastest
way to do things in Action since it
doesn't require a JSR to a PROC.
2.  What are the different variable
types?
BYTE=>0 to 255
CHAR=>same as a BYTE
INT=>-32768 to 32767
CARD=>0 to 65535
and arrays of all the types, but what
you probably want to know is a CHAR
ARRAY equivalent to a String? NO! Arrays
are general purpose while any string in
Action is 0-255 bytes long with the 1st
byte the string length. You can easily
make a CHAR array look like a String
though. Just copy the entire string
including it's length into the array,
then you can PRINTE(<array?>). You can
also declare RECORDs & use the '.
operator to access the individual
elements, but this is mainly used for
database type app's. The example in the
manual is good.
How would you do the following in
Action!
If name$="Test"  then .....
BYTE ARRAY str1="Hello", str2="Hello"
int result
PROC Main()
IF SCompare(str1,str2)=0
 THEN PrintE("They're eqqual")
ELSEIF SCompare(str1,str2)<0
 THEN PrintE("str1<str2")
ELSEIF SCompare(str1,str2)>0
 THEN PrintE("str1>str2")
FI
or you can just
result=SCompare(str1,str2)
IMHO: Action is better then BASIC for
this since it returns a +- or 0 value,
you can sort things easily.
I can't figure out how to do comparisons
with CHAR ARRAY.
I don't know if you really mean this.
Action has no built in function to
compare ARRAYs unless you make the ARRAY
equivalent to a string & <255 bytes.
4.  Is there any sort of INSTR command,
like the one in TurboBasic?
Don't know what INSTR does, but if you
mean search a string for a substring,
there's one on page 138 of the manual.
It's about a 15 line procedure.
5.  Can anyone give me a list of CHAR
ARRAY procedures?  (Like real
definitions to Scopy() Sassign(), and
whatever else you can think.)
From the manual, equiv statements:

BASIC      Action!
B$=S$       Scopy(str1,str2)
you can also use stuff like
            Scopy(str1,"Hello")
            Scopy(buffer,str2)
B$(3,5)=S$  SAssign(str1,str2,3,5)
B$=S$(3,5)  ScopyS(str1,str2,3,5)

6. Is there anyway to make the left
margin in column 0 in the editor?  Easy,
from the monitor hit O<RETURN> to get to
the options menu, make sure you also
disable that !@#$ bell too. You can use
the set directive in the editor if you
like, just have the first line of your
program: SET 82=0 and it'll set it every
time you compile. You can also e(X)ecute
an Action! command from the monitor: X
POKE(82,0)<RETURN>