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.››--------------------------------------››In the last lesson we went over ›variables. The name of a variable›doesn't have to a name like the "i" I›used in the examples. In fact, they›shouldn't be like that. Variable›names should be descriptive to you›know what their purpose is. In›Action!, the only restriction is that›variable names start with a letter.›They may contain letters and the ›underline "_" character later in the›name. Which is easier to understand?››t=(p*x)+p›› or››total_price = (price * tax) + price››This brings us to our next subject,›expressions.››Action! supports the following ›operators.›› - as in negative numbers. Remember› only INT can be negative.›› * multiply› › / divide. This is integer division› because Action! doesn't have› real numbers. So when you› take 5/2 it is equal to 2 NOT› 2.5›› MOD This is the remainer when you› divide. 5 MOD 2 equals 1 because› 5/2=2 with a remainder of 1›› + addition›› - subtraction ››Action! also has a number of bit-wise›operators but we will cover those ›later.››I guess a sample program would be›good about now. This sample program›is a little too long for you to have›to type in to your editor. So I›guess this is a good time to say that›when this occures, the sample program›will be called APROG.301››This means it is a program with the›ATUTOR series. It goes with lesson›3 and it is the 01 (first) program.››To load the program into your Action!›editor, you press ›at the same time. The bottom line›of the editor will print "Read?"››Here you type in the filename and it›will load. Then you can compile ›and run the program like normal.››You will notice that the varibles›are of type INT. I did this so you›can see how Action! handles negative›numbers. Try -32767 and 4 for›sample numbers once.››You will see that Action! does some›weird things when you try to go›past the boundries of the variable›type. In this case, INT can only›be -32768 to 32767.››Try some nicer numbers to show the›program works fine. Like 10 and 6.›Or any other number you may want to›try. You will have to recompile and›rerun the program for each different›set of values.››You may have noticed a PutE() command›in the program. This places a›carriage return on the screen. In›other words, it just puts a blank›line on the screen. I just put it›in there to make it easier to read.››The next things we will cover are›relationals. Relationals yield a›value of TRUE or FALSE. An example›might be: 4=7. This is false.›Here is a list of the Action!›relationals:›› a=b tells if a and b are equal››a<>b tests to see if a and b are› not equal›› a#b the same as a<>b›› a>b is a greater than b››a>=b is a greater than or equal to b›› a THEN›› statement› statement› statement› ›FI››If the relational expression between›the brackets is true, Action! will›execute all the statements between›the IF line and the FI line.››If the relational is false, Action!›will skip all the statments between›the IF and FI and start with the›statement after the FI.››The statements between the IF and the›FI should be indented a few spaces›to show that they are dependent on›the IF statement. And it also makes›it alot easier to read!››try this program:›› PROC main()›› IF 4>9 THEN› PrintE("4 is greater than 9")› PrintE("Do you believe it?!?")› FI› PrintE("done")›› RETURN›››The above program should just print›the word "done". If 4 should happen›to be equal to 9 today (maybe its›Friday the 13th?) then it would print›the other 2 lines followed by the word›"done".››This is the end of lesson 3, I will›leave you with another program that›is too big to print here. It is›called: APROG.302››