From: phbill@cyberden.uucp
Newsgroups: comp.sys.atari.8bit
Subject: Re: A few more Action! questions. (Sorry about the format, stupid te
Date: Wed, 14 Oct 92 23:02:23 PDT
Organization: Indescribable Creations

rlcollins@miavx1.acs.muohio.edu (Ryan 'Gozar' Collins) writes:

>      1. How do you access individual elements of a CHAR ARRAY?               
Just call it as "chararrayname(position)".  "Chararrayname" is your 
array, and "position" is where in it (from 1 to length (which btw is 
stored in location 0 of the array!)).
>                                                                              
>           2. What are the different variable types? (Difference between
> BYTE,        
> CARD, CHAR ARRAY, etc)                                                       
Byte is a whole number value between 0 and 255 and takes up 1 byte of 
memorry.
Card is a whole number value between 0 and 65535 and takes up 2 bytes of
memory.  Just imagine how "DPOKE" in TurboBASIC XL (and BASIC XL I think) 
and "PokeC" in Action! work and you understand.  It's GREAT for system 
pointers (like screen memory, display list, etc.)
>                                                                              
>           3. How would you do the following in Action!?                      
>                                                                              
>           If name$="Test" then .....                                         
>                                                                              
>           I can't figure out how to do comparisons with CHAR ARRAY.          
This would be "If SCompare(name,"Test")=0 Then ..."  If name and "Test" 
are identical, then the returned value of the function "SCompare" is 0.  
If name is "less than" "Test" than the number is <0 (aka -1), and if it 
is "greater than" "Test" (BTW: all in ATASCII terms..."BOB" would be 
greater than "ALICE" because of the "B" and "A") then it would be >0 (aka 
1).  Got it!?  Good!

>                                                                              
>           4. Is there any sort of INSTR command, like the one in
> TurboBasic?         
Not that I've seen, but hey, it's a simple For..Do..Od loop in Action!, 
and it would probably run just as fast as INSTR
>                                                                              
>           5. Can anyone give me a list of CHAR ARRAY procedures? (Like
> real          
> definitions to Scopy() Sassign(), and whatever else you can think.)          
Action!'s string handling commands are as follows:

INT FUNC SCompare - it's a function.  I explained it before.  The two 
parameters are what you want compared.  If the 1st parameter is "greater" 
than the 2nd, the value will be 1, if they are the same, it'll be 0, etc.

PROC SCopy - it copies a string. (aka "A$=B$")  The 2 parameters are 
"destination" and "source".. so "LET A$=B$" in BASIC would be 
"SCopy(A,B)" in Action!

PROC SCopyS - it copies part of a string into another 
("A$=B$(start,finish)")  The parameters are dest., source, start, stop.  
"A$=B$(2,10)" would be "SCopyS(A,B,2,10)" and would copy the contents of 
B starting at location 2 and ending at 10 into A. (so A would be 9 
characters long)

PROC SAssign - it's the compliment of SCopyS.. it works like 
"A$(s,f)=B$", copying a string into PART of another string.  It's 
parameters are dest.,source,start,fin.  Saying "SAssign(A,B,3,4)" would 
copy all of the elements of string B into elements 3 and 4 (erasing the 
old elements,mind you) of string A.  It says: "If the space allowed 
(stop-start+1) in <dest> is greater than the length of <source>, then 
'stop' will be changed to make the space available and the length equal."

>                                                                              
>           6. Is there anyway to make the left margin in column 0 in the      
> editor?                                                                      
This can be done one of two or three ways:

1) Go to the Monitor ([shift]+[ctrl]+[M] from the editor) and type "O" 
(or "Options" or "oh no!" or whatever..just as long as it starts with 
"O") and answer the prompts.  Pressing [RETURN] keeps them the same, 
pressing [ESC] exits from the Options prompt.  The 2nd to last question i 
(is) "Left Margin? 2" .. just type "0" or whatever you want...

2) type "SET 82=0", which is just "POKE 82,0"

3) type "X Poke(82,0)" .. ditto ..this is the direct mode command (the 
"X")

and finally ..4) have a program do it..  if you have no program in 
memory, type "Poke(82,0)" in the editor, get to the monitor, and type 
"Compile" and then "Run" ("C" and "R" if you want..)... voila..



As for the string stuff... practice practice practice... and where 
exactly is your Action! manual, anyways!? >:-( grrr..

have fun

--
Bill Kendrick           PhBill@Cyberden.UUCP    Viva las Ataris!

        (NOTE NEW ADDRESS!  (NICE AND SHORT, TOO!))
Newsgroups: comp.sys.atari.8bit