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, now it is time to cover the most›powerful of all the Action! Print›routines. It is called PrintF for›print formatted.››This baby does it all!››The first thing PrintF must have it›a string in "quotes." If PrintF is›used like this, it is just like›Print.››command output›------------------------------›PrintF("Hello") Hello›Print("Hello") Hello››But if some special characters appear›inside the "quotes", PrintF can do›anything you want.››The first of the special characters›is the %E. That is a percent sign›followed by an E. This can appear›anywhere in the "quotes" and Action!›will do a RETURN where the %E appears.››Here is a comparison of the old way›versus PrintF››old way›-------››PutE()›PrintE("What is your name?")›PrintE("Only 10 characters please.")›PutE()›››new way›-------››PrintF("%EWhat is your name?%EOnly 10 characters please.%E")››It may look a little harder to read›but it actually takes up less memory›and time. Why? Because with each›call to an output procedure, Action!›must open a channel to the screen,›print what you want and then close the›screen. So the old way there are 4›opens and closes. With PrintF there›is only 1.››The next special character is the %U.›What does the U stand for? It means›Unsigned. INTs are signed with a +/-›so it must be used by BYTEs and CARDs.›But how does it know what value to›print where the %U is?››Assume a and b are BYTES. a=5 b=10››old way›-------››PutE()›Print("The sum of ")›PrintB(a)›Print(" and ")›PrintB(10)›Print(" is ")›PrintBE(a+b)››new way›-------››PrintF("%EThe sum of %U and %U is %U%E",a,b,a+b)››Both print the line:››The sum of 5 and 10 is 15››After the second quote, there is a›comma and then the BYTEs that get›substituted. The first BYTE in that›list goes with the first %U. And so›on with the rest.››Then what does a %C stand for? %C›prints the value associated with it›as a character. The ATASCII value›for the letter 'A' is 65. So,››PrintF("The letter %C.%E",65)››will print:››The letter A.››This may not seem very useful but ›when you want to print special›graphics characters it is real nice.››Here is a list of special characters›and how they output the data in the›list.››%I - INT›%U - CARD (the U stands for Unsigned)› and BYTE ›%C - print as a character›%H - a Hexdecimal number›%E - the RETURN character›%% - output the percent sign›%S - output as a string (we'll cover› this in a later lesson)››So what is wrong with PrintF? Well,›it can only print to the screen.›Not to a external device like a›disk or your printer. Don't worry›about that now, we'll cover that in›a later lesson also.››Try APROG.601 for an example of using›PrintF for handling some complex›output formats.››Well that's is for this installment.›Short, sweet and to the point. Next,›we will go into the heart of Action!,›the ability to call PROCs.›