Action! › and› BBS Express! PRO› Tutorial›› by› Thomas M. Johnson ››› Available from ›› Villa Video's Bargain Cellar › (414) 265-5149 › ExpressNet Node X11 ››Action! is copyright of ACS, OSS, ICD.›BBS Express! PRO is copyright Orion›Micro Systems.› ›This tutorial is copyright Thomas M.›Johnson.››This tutorial can be distributed under›the following conditions:› 1) It is free.› 2) All of the above› information is intact.››--------------------------------------››Well, here we are at the last lesson›of Part 1. And I have to apologize›for this one. There are a lot of›little things I want to mention. Most›of them have nothing to do with any ›of the others.››The first has to do with assigning›variables and routines to specific›memory locations. You saw how you›can use POINTERs to change memory›locations (like the background›color of the screen). But there›is a better way. When you declare›a variable, you can assign it to a›location.›› BYTE bkgnd=710››Now any change you make to bkgnd will›go into location 710.›› bkgnd=0››This will change the background color›to black. You can also assign›PROCs to specific memory locations›too. That way, if there is a routine›loaded into memory, you can call›it easily. ›› PROC machine_routine=$3500 (BYTE ARRAY s)››In Part 2 of this tutorial we will use›this quite a bit.››There is another thing you can do with›variables where you declare them. You›can assign them to a value using›[square brackets].›› INT i=[-32]› BYTE b=[0]››So, if you do a: ›› PrintIE(i)› PrintBE(b)››you will get›› -32› 0››Square brackets are also used for›inserting machine language subroutines›in Action! programs. You can use›hex values or decimal. You can even›access Action! variable. Here's an›example:›› [$A9 my_val $2A $8D $CD $04]››Action! is very fast but sometimes›you can use that little extra burst›from machine language.››If you want your Action! code to ›compile to a specific memory location›you just insert this at the start of›your program.›› SET 14 = $4000› SET $491 = $4000››Now you program will compile to ›location $4000.››SET IS NOT LIKE A POKE! SET CHANGES›MEMORY LOCATIONS AT COMPILE TIME, NOT›WHILE IT IS RUNNING!!!››If you create a bunch of global›routines that you in all your programs,›you don't have to type them in each›time. They can be loaded in while›the program is compiling. That way›they are compiled in with your code.›You can INCLUDE a file anywhere as›long as if is above whatever PROCs›are going to call them. You usually ›INCLUDE files after the global›variable and before your first PROC.››I have included a Public Domain›runtime package. If you INCLUDE›this when you compile your programs,›they will work without the Action!›cartridge. It would look like:›› INT global1,› global2›› INCLUDE "D:RUNTIME.ACT"›› PROC My_first_proc()› .› .› .›› RETURN››I mentioned that Action! predeclares›some variables for you. There is an›important one that HAS to be mentioned.››Normally, if you Action! program›finds an error, it aborts. Your›can trap errors by making PROCs that›will execute when an error occures.›› PROC my_error(BYTE errno)›› Print("I found an Error number ")› PrintBE(errno)› RETURN››A BYTE parameter is always needed.›To make Action! go to this PROC ›instead of aborting, you just put in:›› Error = my_error››Lastly, Action! has the same graphics›command built in as BASIC. I am›not going to go into great detail›on graphics. There have been thousands›of magazine articles written on the›subject. I will just list the BASIC›graphics command and their Action!›equivalents.››BASIC Action!›-------------------------›GRAPHICS 0 Graphics(0)›SETCOLOR 1,0,0 SetColor(1,0,0)›COLOR 2 color=2›POSITION 3,4 Position(3,4)›PLOT 10,10 Plot(10,10)›DRAWTO 20,20 DrawTo(20,20)››I have not listed all the routines›in the Action! library. There are ›sound and game controller routines as›well as a ton more.››Take a look at your Action! manual›again. Hopefully you will understand›it better than the first time you›opened it and said "What does that›mean?!?"››Well, I hope you all have enjoyed›this tutorial. Action! is a great ›programming language and Action!›programmers are very friendly.››Stay tuned for Part 2, writing›programs for BBS Express! Pro.›› Tom››