home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Black Box 4
/
BlackBox.cdr
/
progbas
/
ascsu205.arj
/
TIPS.ASI
< prev
next >
Wrap
Text File
|
1992-01-21
|
45KB
|
1,472 lines
start:
b$=chr$(27)
c$=chr$(34)
a$=command$
if a$="/40" then tips40:
if a$=" /40" then tips40:
cls
print " ASIC TIPS"
print
print " (No, it's not a new filtered cigar, wise guy!)"
print
print
print " Matt Roberts"
print " 3 Cedar St., # 8"
print " Montpelier, Vt 05602-3006"
print
print
print
print
print
print
print
print
print
print "Press any key to continue. ";
gosub continue:
cls
print "Hi. In the process of stumbling around with ASIC 1.00, 2.01, and"
print "3.01, I've discovered a few little tips that might make your"
print "programming a bit easier. Now, I'm not all that hot a programmer,"
print "though I have written a few things I think are useful, and you may not"
print "be particularly impressed with my discoveries. On the other hand, I"
print "think there's some solid value in here. You'll probably get the most"
print "out of this if you're a beginner, especially one who's used to Micro-"
print "soft's BASICA/GW-BASIC. Intermediate programmers may find a few short"
print "cuts, and experts probably won't find much of use."
print
print "If you find these tips useful, you may be tempted to distribute them"
print "on the ASIC diskette. Unless you have the written consent of David"
print "Visti, the author of ASIC, I would recommend against it. In general,"
print "most shareware authors prefer (and some require) that no files be"
print "added to their distribution disks. Of course, it may be egotistical"
print "of me to think you might suffer from any temptation other than the use"
print "of the DEL command, but I'll let you be the judge of that."
print
print
print "Press any key to continue. ";
gosub continue:
cls
print "You'll notice that every disk I write (and many programs) have"
print "my address scattered all over the place. I would consider it a great"
print "favor if you'd let me know what you think of these tips, and any other"
print "programs/documents/diskettes for which I claim responsibility. I want"
print "to offer the highest quality work I possibly can, and I need your help"
print "for that. Thanks."
print
print "ASIC is copyrighted by David Visti. I am not in any way connected to"
print "that programming language, except as a registered user and ardent fan."
print "If you want to contact the author concerning ASIC, he can be reached"
print "at the following address:"
print
print "David Visti, P.O. Box 2952, Raleigh, NC 27602-2952."
print
print
print "Press any key to continue. ";
gosub continue:
cls
print "If you haven't tried ASIC, by all means give it a try. If you've"
print "tried ASIC and like it, please register. The registration fee is an"
print "insanely cheap $10.00, and both the compiler and the documentation are"
print "extremely user-friendly. I've saved the price of registration many"
print "times over with the utilities I've written. Many of those utilities"
print "were ones I saw advertised in commercial and shareware catalogues; I"
print "wrote my own version, saving both the diskette handling fee and"
print "registration. Other utilities I couldn't find anywhere; I wrote them"
print "myself and stopped looking."
print
print "Anyway, enough free advertising for Mr. Visti. Let's get to it."
print
print
print "Press any key to see the Main Options Menu. ";
gosub continue:
options:
cls
print "Here are the subjects covered:"
print
print
print "F1- Blank Lines Alt-F1 - In Conclusion"
print
print "F2- Command Line Arguments Esc- Quit"
print
print "F3- Using Extended Keys"
print
print "F4- Writing 40-column Text"
print
print "F5- A Bug in the 3.01 PRINT Command"
print
print "F6- Reserved Words"
print
print "F7- Error errors."
print
print "F8- How to Get a Copy of ASIC."
print
print "F9- Running ASIC From One Drive"
print
print
print "Please press the key corresponding to your choice. ";
wait1:
gosub continue:
if a$=b$ then finish:
if extended=1 then readext:
goto wait1:
readext:
if a$=";" then blanklin:
if a$="<" then commandl:
if a$="=" then extkeys:
if a$=">" then 40column:
if a$="?" then printbug:
if a$="@" then reserved:
if a$="A" then errorerr:
if a$="B" then getcopy:
if a$="C" then onedrive:
if a$="i" then conclude:
goto wait1:
blanklin:
cls
print "This subject is pretty simple. Just so you don't think I've had a"
print "frontal lobotomy, I'll tell you it didn't take me long to figure it"
print "out. On the other foot, it did give me a puzzling moment or two."
print "Simply put, typing the command PRINT in ASIC 1.00 or 2.x won't cut it."
print "ASIC requires ";
print c$;
print "something";
print c$;
print " to print out, even if that something is"
print "nothing. Accordingly, we tell ASIC to print nothing, thus:"
print
print "PRINT ";
print c$;
print c$
print
print "Now you can print all the blank lines you could possibly want (if you"
print "want more than 64K of blank lines, get professional help)."
print
print "Version 3.00 and above does not require the null string (double"
print "quotes) in the PRINT statement. Just the command PRINT will do fine."
print
print
print "Press any key to continue. ";
gosub continue:
cls
print "Still on the subject of blank lines, but with a twist, is a habit I've"
print "gotten into. Because I'm used to GW-BASIC, I've gotten into the habit"
print "of printing a REM statement to create a blank line. This makes your"
print "BASICA code more readable, but is entirely unnecessary in ASIC. All"
print "you have to do is press the Enter key, thus making a blank line. ASIC"
print "ignores blank lines, they don't add to size of the resulting .COM"
print "file, and they make your source more readable than a blank REM state-"
print "ment."
print
print
print "Press any key to return to the Main Options Menu. ";
gosub continue:
goto options:
commandl:
cls
print "Note: ASIC 1.00 doesn't have the option of command line arguments. To"
print "get that feature, you'll need version 2.00 or above."
print
print
print "I had the devil's own time trying to figure out what was wrong with my"
print "program. It was a simple utility, WIDTH.COM, which I use for changing"
print "from 80-column width to 40-columns and back (I don't use DOS's MODE"
print "command for anything but width commands, and I wanted something that"
print "sounded like it did what I wanted it to do). It's a handy little"
print "program, but the silly thing wouldn't work. Here's what part of the"
print "code looked like (more or less; I've left out the stuff that doesn't"
print "illustrate my point, but the source code is available on my ASIC Sup-"
print "port Disk):"
print
print
print "Press any key to continue. ";
gosub continue:
cls
print "A$=COMMAND$"
print "IF A$=";
print c$;
print "40";
print c$;
print "THEN WIDTH40:"
print "IF A$=";
print c$;
print "80";
print c$;
print "THEN WIDTH80:"
print "."
print "."
print "."
print "WIDTH40:"
print "WIDTH 40"
print "."
print "WIDTH80:"
print "WIDTH 80"
print
print
print "Press any key to continue. ";
gosub continue:
cls
print "Looked fine, I thought. Wouldn't run, though. So I wrote a little"
print "test routine which printed the value of A$. It turned out that ASIC"
print "always prints a leading space in front of the command line argument,"
print "so that A$ would be ";
print c$;
print " 40";
print c$;
print "instead of ";
print c$;
print "40";
print c$;
print ".";
print " Notice that little space"
print "in front of the first 40? Makes all the difference in the world. So"
print "I rewrote the file, like this:"
print
print "IF A$=";
print c$;
print " 40";
print c$;
print " THEN WIDTH40:"
print "IF A$=";
print c$;
print " 80";
print c$;
print " THEN WIDTH80:"
print
print "and everything worked fine."
print
print
print "Press any key to continue. ";
gosub continue:
cls
print "Now, nothing in life is as simple as you might expect, and the subject"
print "of program arguments is no exception. If you call another ASIC"
print "program using an argument the program called will, naturally enough,"
print "contain the COMMAND$ function. However, in this case you do NOT want"
print "the leading space. Say you want to call another program with the"
print "parameter ";
print c$;
print "/40";
print c$;
print ". In the called program, you'll want a line like this:"
print
print "A$=COMMAND$"
print "IF A$=";
print c$;
print "/40";
print c$;
print "THEN PUNT:"
print
print "Notice the lack of a leading space. If you have trouble calling an"
print "ASIC program from another ASIC program, or from the DOS prompt, check"
print "to see if you've either included a leading space you shouldn't, or"
print "forgotten to include one when you should."
print
print "Press any key to return to the Main Options Menu. ";
gosub continue:
goto options:
extkeys:
cls
print "In general, ASIC.DOC is easy to read, concise, and informative."
print "There's one spot, though, where things get unnecessarily mysterious."
print "In the INKEY$ section of the Keyword Reference, there's mention that"
print "if an extended key (such as one of the function keys) is pressed, the"
print "system variable EXTENDED is set to 1. As for using this variable,"
print "ASIC.DOC mumbles something about scan codes and moves on. I got to"
print "thinking about it, and came up with a routine that works every time,"
print "and is as simple as can be:"
print
print "WAIT:"
print "A$=INKEY$"
print "IF A$=";
print c$;
print c$;
print " THEN WAIT:"
print "IF EXTENDED=1 THEN READEXT:"
print "."
print "."
print "."
print "READEXT:"
print "IF A$=";
print c$;
print ";";
print c$;
print "THEN LABEL1:"
print "IF A$=";
print c$;
print "<";
print c$;
print " THEN LABEL2:"
print
print "and so on."
print
print
print "Press any key to continue. ";
gosub continue:
cls
print "Now, all you need is a routine which will tell you what kind of"
print "character ASIC sees when you press the extended key in question."
print "Here's the code for EXTENDED.COM (EXTENDED.ASI, EXTENDED.COM, and"
print "EXTENDED.DOC can be found on my ASIC Support Disk):"
print
print "WAIT:"
print "A$=INKEY$"
print "IF A$=";
print c$;
print c$;
print " THEN WAIT:"
print "B$=CHR$(27)"
print "IF A$=B$ THEN FINISH:"
print "PRINT A$"
print "GOTO WAIT:"
print "FINISH:"
print "END"
print
print "Running this program will show you what characters you need to watch"
print "out for in READEXT:."
print "For example, if EXTENDED is equal to 1 and A$ is equal to ";
print c$;
print ";";
print c$;
print " then the"
print "F1 function key has been pressed. If EXTENDED=0, then the colon/semi-"
print "colon key has been pressed. It's easy to use EXTENDED.COM to figure"
print "the other keys on your own."
print
print
print "Press any key to continue. ";
gosub continue:
cls
print "You should now have access to the extended keys, without mystery, and"
print "without ";
print c$;
print "scan codes";
print c$;
print " (whatever they are)."
print
print "Examples of routines which access these keys can be found in"
print "FILE-MAN.ASI, GETKEY.ASI, and TIPS.ASI, on the Support Disk I keep"
print "plugging at every opportunity."
print
print
print "Press any key to return to the Main Options Menu. ";
gosub continue:
goto options:
40column:
cls
print "I've been including a 40-column width in some of my programs to help"
print "the visually impaired, at least in theory. I haven't actually gotten"
print "any feedback from a visually impaired person, and would appreciate"
print "some. Anyway, the difficulty is in knowing when to cut a line short,"
print "since it's hard to run most editors in 40-column mode, and the ones I"
print "have that will work that way are difficult to use. Luckily, ASIC has"
print "an excellent alternative built into the integrated environment."
print
print "In the lower right corner of the screen, there's an area with the word"
print "Col: followed by a number. If you end your print statements when the"
print "number reaches 47, you'll have no worries about words breaking at odd"
print "places; your text won't be perfect, but it will be readable. Left"
print "margins, centering, and what-not I leave to your experimentation,"
print "since I don't have much desire for them at the moment and therefore"
print "haven't tried to use them."
print
print "It may be important to note that the 47-column line includes the com-"
print "mand PRINT and both quotation marks. That's why it's such an odd num-"
print "ber; that stuff has been taken into account already."
print
print
print "Press any key to return to the Main Options Menu. ";
gosub continue:
goto options:
printbug:
cls
print "If you're using ASIC 3.01, you may notice that the printing to the"
print "screen gets all discombobulated occasionally. That happens when"
print "you've used print commands to print one or more blank lines, just be-"
print "fore you try to print some text. It doesn't always happen but, if it"
print "does, just go back to the blank PRINT commands and add double quotes"
print "after them, thus:"
print
print "PRINT ";
print c$;
print c$
print
print "I don't know why this happens, but my guess is it's a bug in the com-"
print "piler. It seems to happen most often after block IF-THEN statements"
print "and/or when the code is especially unstructured."
print
print
print "Press any key to return to the Main Options Menu. ";
gosub continue:
goto options:
getcopy:
cls
print "If you want a copy of ASIC but can't find one, I'll send you a copy if"
print "you follow these instructions EXACTLY. There can be no exceptions; if"
print "you don't follow these steps, your material will be returned. Sorry"
print "if I'm being a jerk about this, but I can't afford to spend any more"
print "time than absolutely necessary. Also, if there's a big response to"
print "this offer, I might end up with out-of-pocket expenses that could set"
print "me back in a big way. Thanks for your understanding."
print
print
print "Press any key to continue. ";
gosub continue:
cls
print "First, you must send me the following:"
print
print " 1- A diskette mailer."
print
print " 2- A blank diskette (5.25 inch, 360K format only)."
print
print "You'll need to do the following before sending the above:"
print
print " 1- Put your address on the mailer."
print
print " 2- Put sufficient return postage on the mailer."
print
print " 3- Format the diskette."
print
print
print "So, what I'm asking for is a stamped self-addressed return mailer and"
print "a blank diskette."
print
print "If you do all that, I'll make a copy of my ASIC disk, and send it back"
print "to you."
print
print
print "Press any key to return to the Main Options Menu. ";
gosub continue:
goto options:
rem Here is the routine dealing with reserved words.
reserved:
cls
print "ASIC is pretty liberal in its use of reserved words. About the only"
print "thing you can't do, as far as I can tell, is use a keyword such as"
print "PRINT for a numeric variable. On the other hand, string variables"
print "such as PRINT$, CLS$, END$, and CALL$ are perfectly valid, and will"
print "cause no errors that I know of. Another thing you can do is use most"
print "keywords as labels (ASIC calls them symbols). Apparently, ASIC con-"
print "siders them distinct because of the colon at the end, in the same way"
print "it seems to ignore keywords with a dollar sign as the last character."
print "As a result, you can have labels such as PRINT:, CLS:, END:, and CALL:"
print "without any trouble. This can be handy, since you can use names for"
print "both your string variables and your labels which describe what they do"
print "without worrying about whether or not you'll get in trouble with the"
print "compiler."
print
print "As stated earlier, you can't use keywords as numeric variables, since"
print "the compiler will get confused. Also, a label such as INKEY$: will"
print "not be accepted. Obviously enough, a keyword such as INKEY$ can't be"
print "used as a string variable."
print
print
print "Press any key to return to the Main Options Menu. ";
gosub continue:
goto options:
rem This is the end of the routine for dealing with reserved words.
rem Here is the the routine for dealing with "undocumented" errors.
errorerr:
cls
print "In writing READ.COM, I looked in ASIC.DOC for the errors that could"
print "be handled directly from ASIC. I checked the section ";
print c$;
print "OPEN - "
print "INPUT MODE";
print c$;
print "and found only a FILE NOT FOUND error. However, there is a PATH NOT"
print "FOUND error, which I needed. It's documented in ";
print c$;
print "OPEN - MODE"
print "OUTPUT, APPEND, or RANDOM";
print c$;
print "."
print "However, it's equally valid for MODE INPUT and is, in fact, quite"
print "handy to have if you're opening files in this mode. So, if you're"
print "checking Chapter 10 for errors of this nature, remember that Error 3"
print "is listed in the OPEN - MODE OUTPUT, RANDOM, or APPEND section."
print
print "This applies to the documentation for ASIC 3.01; earlier versions may"
print "not have this entry, and later versions may have changed it around."
print "Also, other versions of ASIC.DOC may have the error codes under a"
print "different Chapter number."
print
print
print "Press any key to continue, or Esc to quit. ";
gosub continue:
if a$=b$ then options:
cls
print "In case you might find this of use, I discovered the ";
print c$;
print "undocumented";
print c$
print "errors by using some program lines I call tracers. First I use a"
print "PRINT ERROR line to find out if there's a valid ASIC error being"
print "tripped. Then, since I want the error number to stick around on the"
print "screen long enough to read it, I use a loop using INKEY$, thus:"
print
print "CONTINUE:"
print "A$=INKEY$"
print "IF A$=";
print c$;
print c$;
print " THEN CONTINUE:"
print
print "This allowed me to see the number 3 on the screen. I then checked"
print "ASIC.DOC, and finally went back to READ.COM, and worked Error 3 into"
print "the code."
print
print "If you're wondering why I didn't check ASIC.DOC in the first place,"
print "the answer is simple: I'm a bit dense sometimes, and I didn't think of"
print "it. Anyway, this little routine can be helpful in other situations,"
print "and even if you're not dense."
print
print
print "Press any key to continue. ";
gosub continue:
goto options:
rem This is the end of the routine dealing with "undocumented" errors.
rem Here is the routine for running ASIC from one drive.
onedrive:
cls
print "The hardware requirements for ASIC are listed as one disk drive. This"
print "is true if you want on-line help; if you feel you can get along with"
print "just the printed documentation, and you have only one floppy drive,"
print "you can still use ASIC by following this method."
print
print "Press any key to continue. ";
gosub continue:
cls
print "The most important thing to remember is NOT to use this procedure on"
print "the original disks. If you do, you'll lose ASIC.DOC, which will leave"
print "you without any help at all, on-line or otherwise. So, first thing,"
print "make a backup of your ASIC disks. Now put the originals far, far"
print "away so you don't mix them up."
print
print
print "The next thing you'll do is DELETE the following files:"
print
print
print "ASIC.DOC (do you know where your original is? It had better not be"
print "in the drive, or you'll lose your documentation)."
print
print "ASIC.IDX (you don't absolutely have to, but it's useless without"
print "the documentation, so you might as well)"
print
print "ASICM.IDX (same reason as above)"
print
print
print "You'll have to print ASIC.DOC, of course, to use the documentation."
print
print
print "Press any key to continue. ";
gosub continue:
cls
print "Once you've deleted these three files, you'll have enough room on one"
print "5.25 inch, 360K floppy to write good-sized programs. This isn't to"
print "say you can't possibly run out of room, but you'll have to work at it."
print
print "If you do run out of room for ASIC????.EXE, your source code, and your"
print "executable code, you may be able to write your source with a word"
print "processor that lets you save your files to a disk other than the one"
print "with the word processor (almost all of them do that), and let you save"
print "your files as ASCII or text (most of them do that). You can save your"
print "source to a blank disk. Then you can copy ASICC.EXE by typing (from"
print "the DOS prompt) COPY ASICC.EXE B:. ASICC.EXE should be in your drive"
print "when you type this command. When DOS prompts you to change disks, put"
print "the disk with your source code into the drive. There'll be plenty of"
print "room for both ASICC.EXE and your source. When both files are copied"
print "to the one disk, type ASICC YOURCODE.ASI (substituting the name of"
print "your source code for YOURCODE.ASI, of course). Your source should"
print "compile, and there should be plenty of room for ASICC.EXE, your source"
print "code, and your executable code (.COM file)."
print
print
print "Press any key to return to the Main Menu. ";
gosub continue:
goto options:
rem This is the end of the routine for running ASIC from one disk drive.
rem Here is the routine for wrapping things up.
conclude:
cls
print "It's late and I'm tired, so I'm dropping the subject for now. As time"
print "goes by, though, I'll include more tips. If you've had a problem that"
print "puzzled you until you figured out a fairly simple method, let me know"
print "and I'll add it to later versions of this program. We all have"
print "stumbling blocks and mental blocks, but if we blockheads get together"
print "and share info, we can save each other a lot of time and write higher-"
print "quality programs into the bargain."
print
print
print "Thanks."
print
print
print "Press any key to return to the Main Options Menu. ";
gosub continue:
goto options:
rem This is the end of the routine for wrapping things up.
rem Here is TIPS.COM in 40-column mode.
tips40:
width 40
print "ASIC TIPS"
print
print
print "Matt Roberts"
print "3 Cedar St., # 8"
print "Montpelier, Vt 05602-3006"
print
print
print
print
print
print
print
print
print
print "Press any key to continue. ";
gosub continue:
cls
print "Hi. In the process of stumbling"
print "around with ASIC 1.00, 2.01, and 3.01,"
print "I've discovered a few little tips that"
print "might make your programming a bit"
print "easier. I'm not all that hot a pro-"
print "grammer, though I'm not too bad, and"
print "you may not be especially impressed"
print "with my discoveries. However, I think"
print "there's some solid value in here."
print "You'll probably get the most out of"
print "this if you're a beginner, especially"
print "one who's used to Microsoft's BASICA/"
print "GW-BASIC. Intermediate programmers"
print "may find a few short cuts, and experts"
print "might not find much of use."
print
print
print "Press any key to continue. ";
gosub continue:
cls
print "ASIC is copyrighted by David Visti. I"
print "am not in any way connected to ASIC,"
print "except as a registered user and ardent"
print "fan. The author can be reached at:"
print
print "David Visti, P.O. Box 2952, Raleigh,"
print "NC 27602-2952."
print
print
print "Press any key to continue. ";
gosub continue:
option40:
cls
print "Here are the subjects covered:"
print
print
print "F1- Blank Lines Esc- QUIT"
print
print "F2- Command Line Arguments"
print
print "F3- Using Extended Keys"
print
print "F4- Writing 40-column Text"
print
print "F5- A Bug in the 3.01 PRINT Command"
print
print "F6- Reserved Words"
print
print "F7- Error Errors"
print
print "F8- How to Get a Copy of ASIC"
print
print "N- Next Menu."
print
print
print "Please press the key corresponding to"
print "your choice. ";
wait2:
gosub continue:
if a$=b$ then finish:
if a$="n" then menu240:
if a$="N" then menu240:
if extended=1 then readex40:
goto wait2:
readex40:
if a$=";" then blnkln40:
if a$="<" then comndl40:
if a$="=" then extkey40:
if a$=">" then 40col40:
if a$="?" then prbug40:
if a$="@" then reserv40:
if a$="A" then errerr40:
if a$="B" then gtcopy40:
goto wait2:
menu240:
cls
print "Here are the remaining topics:"
print
print
print "P- Previous Menu."
print
print "F9- Running ASIC From One Drive"
print
print "F10- In Conclusion"
print
print "Esc- Quit and Return to DOS"
print
print
print "Please press the key corresponding to"
print "your choice. ";
wait3:
gosub continue:
if a$=b$ then finish:
if a$="p" then option40:
if a$="P" then option40:
if extended=0 then wait3:
if a$="C" then onedrv40:
if a$="D" then concld40:
goto wait3:
blnkln40:
cls
print "This subject is pretty simple. Just"
print "so you don't think I've had a frontal"
print "lobotomy, I'll tell you it didn't take"
print "me long to figure it out. On the"
print "other foot, it did give me a puzzling"
print "moment or two. Simply put, typing the"
print "command PRINT in ASIC 1.00 or 2.x"
print "won't cut it. ASIC requires ";
print c$;
print "some-"
print "thing";
print c$;
print " to print, even if that some-"
print "thing is nothing. Accordingly, we"
print "tell ASIC to print nothing, thus:"
print
print "PRINT ";
print c$;
print c$
print
print "Now you can print all the blank lines"
print "you could possibly want."
print
print "Press any key to continue. ";
gosub continue:
cls
print "Version 3.00 and above does not re-"
print "quire the null string (double quotes)"
print "in the PRINT statement. Just the com-"
print "mand PRINT will do fine."
print
print
print "Press any key to continue. ";
gosub continue:
cls
print "Still on the subject of blank lines,"
print "but with a twist, is a habit I've got-"
print "ten into. Because I'm used to"
print "GW-BASIC, I've gotten into the habit"
print "of printing a REM statement to create"
print "a blank line. This makes your BASICA"
print "code more readable, but is entirely"
print "unnecessary in ASIC. All you have to"
print "do is press the Enter key, thus making"
print "a blank line. ASIC ignores blank"
print "lines, they don't add to the size of"
print "the resulting .COM file, and they make"
print "your source more readable than a blank"
print "REM statement."
print
print
print "Press any key to return to the Main"
print "Options Menu. ";
gosub continue:
goto option40:
rem Here is the routine for dealing with command-line parameters in 40 cols.
comndl40:
cls
print "Note: ASIC 1.00 doesn't have the op-"
print "tion of command line arguments. To"
print "get that feature, you'll need version"
print "2.00 or above."
print
print
print "Press any key to continue. ";
gosub continue:
cls
print "I had the devil's own time trying to"
print "figure out what was wrong with my"
print "program. It was a simple utility,"
print "WIDTH.COM, which I use for changing"
print "from 80-column width to 40-columns and"
print "back (I don't use DOS's MODE command"
print "for anything but width commands, and I"
print "wanted something that sounded like it"
print "did what I wanted it to do). It's a "
print "handy little program, but the silly"
print "thing wouldn't work. Here's what part"
print "of the code looked like (the full code"
print "is available on my ASIC Support Disk):"
print
print
print "Press any key to continue. ";
gosub continue:
cls
print "A$=COMMAND$"
print "IF A$=";
print c$;
print "40";
print c$;
print "THEN WIDTH40:"
print "IF A$=";
print c$;
print "80";
print c$;
print "THEN WIDTH80:"
print "."
print "."
print "."
print "WIDTH40:"
print "WIDTH 40"
print "."
print "WIDTH80:"
print "WIDTH 80"
print
print
print "Press any key to continue. ";
gosub continue:
cls
print "Looked fine, I thought. Wouldn't run,"
print "though. So I wrote a little test rou-"
print "tine which printed the value of A$."
print "It turned out that ASIC always prints"
print "a leading space in front of the com-"
print "mand line argument, so that A$ would"
print "be ";
print c$;
print " 40";
print c$;
print " instead of ";
print c$;
print "40";
print c$;
print "."
print
print
print "Press any key to continue. ";
gosub continue:
cls
print "Did you notice that little space in"
print "front of the 40? Makes all the dif-"
print "ference in the world. So I rewrote"
print "the file, like this:"
print
print "IF A$=";
print c$;
print " 40";
print c$;
print " THEN WIDTH40:"
print "IF A$=";
print c$;
print " 80";
print c$;
print " THEN WIDTH80:"
print
print "and everything worked fine."
print
print
print "Press any key to continue. ";
gosub continue:
cls
print "On the other hand, you may want to"
print "call another ASIC program using an"
print "argument. In that case the program"
print "called will, naturally enough, contain"
print "the COMMAND$ function. However, in"
print "this case you do NOT want the leading"
print "space. Say you want to call another"
print "program with the parameter ";
print c$;
print "/40";
print c$;
print "."
print
print
print "Press any key to continue. ";
gosub continue:
cls
print "In the called program, you'll want a"
print "line like this:"
print
print "A$=COMMAND$"
print "IF A$=";
print c$;
print "/40";
print c$;
print "THEN PUNT:"
print
print "Notice the lack of a leading space."
print "If you have trouble calling an ASIC"
print "program with an argument, check to see"
print "if you've either included a leading"
print "space you shouldn't have, or forgotten"
print "to include one when you should have."
print
print
print "Press any key to return to the Main"
print "Options Menu. ";
gosub continue:
goto option40:
rem Here is the routine for discussing the use of extended keys in 40 columns.
extkey40:
cls
print "In general, ASIC.DOC is easy to read,"
print "concise and informative. There's one"
print "spot, though, where things get un-"
print "necessarily mysterious. In the INKEY$"
print "section of the Keyword Reference,"
print "there's mention that if an extended"
print "(such as one of the function keys) is"
print "pressed, the system variable EXTENDED"
print "is set to 1. As for using this var-"
print "iable, ASIC.DOC mumbles something"
print "about scan codes and moves on. I got"
print "to thinking about it, and came up with"
print "a routine that works every time, and"
print "is as simple as can be:"
print
print
print "Press any key to continue. ";
gosub continue:
cls
print "WAIT:"
print "A$=INKEY$"
print "IF A$=";
print c$;
print c$;
print " THEN WAIT:"
print "IF EXTENDED=1 THEN READEXT:"
print "."
print "."
print "."
print "READEXT:"
print "IF A$=";
print c$;
print ";";
print c$;
print " THEN LABEL1:"
print "IF A$=";
print c$;
print "<";
print " THEN LABEL2:"
print
print "and so on."
print
print "Press any key to continue. ";
gosub continue:
cls
print "Now, all you need is a routine which"
print "will tell you what kind of character"
print "ASIC sees when you press the extended"
print "key in question. Here's the code for"
print "EXTENDED.COM (EXTENDED.ASI,"
print "EXTENDED.COM, and EXTENDED.DOC can be"
print "be found on my ASIC Support Disk):"
print
print "WAIT:"
print "A$=INKEY$"
print "IF A$=";
print c$;
print c$;
print " THEN WAIT:"
print "B$=CHR$(27)"
print "IF A$=B$ THEN FINISH:"
print "PRINT A$"
print "GOTO WAIT:"
print "FINISH:"
print "END"
print
print
print "Press any key to continue. ";
gosub continue:
cls
print "Running this program will show you"
print "what characters you need to watch out"
print "for in READEXT:. For example, if"
print "EXTENDED is equal to 1 and A$ is equal"
print "to ";
print c$;
print ";";
print c$;
print " then the F1 function key has"
print "been pressed. If EXTENDED=0, then the"
print "colon/semi-colon key has been pressed."
print "It's easy to use EXTENDED.COM to fig-"
print "ure out the other keys on your own."
print
print "You should now have access to the ex-"
print "tended keys, without mystery and with-"
print "out scan codes (whatever they are)."
print
print "Examples of routines which access"
print "these keys can be found in"
print "FILE-MAN.ASI, GETKEY.ASI, and TIPS.ASI"
print "on the Support Disk I keep plugging at"
print "every opportunity."
print
print "Press any key to return to the menu. ";
gosub continue:
goto option40:
rem Here is the routine for 40-column screen writes in 40-columns.
40col40:
cls
print "I've been including a 40-column width"
print "in some of my programs to help the"
print "visually impaired, at least in theory."
print "I haven't actually gotten any feedback"
print "from a visually impaired person, and"
print "would appreciate some. Anyway, the"
print "difficulty is in knowing when to cut a"
print "line short, sice it's hard to run most"
print "editors in 40-column mode, and the"
print "I have that will work that way are"
print "difficult to use. Luckily, ASIC has"
print "an excellent alternative built into"
print "the integrated environment."
print
print "In the lower right corner of the"
print "screen, there's an area with the word"
print "Col: followed by a number. If you end"
print "your print statements when the number"
print "reaches 47, you'll have no worries"
print "about words breaking at odd places;"
print "your text won't be perfect, but it"
print "will be readable."
print
print "Press any key to continue. ";
gosub continue:
cls
print "It may be important to note that the"
print "47-column line includes the command"
print "PRINT and both quotation marks."
print "That's why it's such an odd number;"
print "all that stuff has been taken into ac-"
print "count already."
print
print
print "Press any key to return to the Main"
print "Options Menu. ";
gosub continue:
goto option40:
rem Here is the routine dealing with the 3.01 PRINT bug in 40-column mode.
prbug40:
cls
print "If you're using ASIC 3.01, you may"
print "notice that the printing to the screen"
print "gets all discombobulated occasionally."
print "That happens when you've used PRINT"
print "commands to print one or more blank"
print "lines, just before you try to print"
print "some text. It doesn't always happen"
print "but, if it does, just go back to the"
print "blank PRINT commands and add double"
print "quotes after them, thus:"
print
print "PRINT ";
print c$;
print c$
print
print "I don't know why this happens, but my"
print "guess is it's a bug in the compiler."
print "It seems to happen most often after"
print "block IF-THEN statements and/or when"
print "the code is especially unstructured."
print
print
print "Press any key to return to the Main"
print "Options Menu. ";
gosub continue:
goto option40:
rem Here is the routine dealing with reserved words in 40-column mode.
reserv40:
cls
print "ASIC is pretty liberal in its use of"
print "reserved words. String variables,"
print "such as PRINT$, CLS$, END$, and CALL$"
print "are perfectly valid, and will cause no"
print "errors that I know of. Another thing"
print "you can do is use most keywords as la-"
print "bels (ASIC calls them symbols). Ap-"
print "parently, ASIC considers them distinct"
print "because of the colon on the end, in"
print "the same way it seems to ignore key-"
print "words with a dollar sign as the last"
print "character. As a result, you can have"
print "labels such as PRINT:, CLS:, END:, and"
print "CALL: without any trouble. This can"
print "be handy, since you can use names for"
print "both your string variables and your"
print "labels which describe what they do"
print "without worrying about whether or not"
print "you'll get in trouble with the com-"
print "piler."
print
print
print "Press any key to continue. ";
gosub continue:
cls
print "You can't use keywords as numeric var-"
print "iables, since the compiler will get"
print "confused. Also, a label such as"
print "INKEY$: will not be accepted. Obvi-"
print "ously enough, a keyword such as INKEY$"
print "can't be used as a string variable."
print
print
print "Press any key to return to the Main"
print "Options Menu. ";
gosub continue:
goto option40:
rem Here is the routine for dealing with "undocumented" errors in 40-columns.
errerr40:
cls
print "In writing READ.COM, I looked in"
print "ASIC.DOC for the errors that could be"
print "handled directly from ASIC. I checked"
print "the section, OPEN - Mode Input and"
print "found only a File Not Found error."
print "However, there is a Path Not Found er-"
print "ror, which I needed. It's documented"
print "in the section OPEN - Mode Output,"
print "Append, or Random. However, it's"
print "equally valid for Mode Input and is,"
print "in fact, quite handy to have if you're"
print "opening files in this mode. So, if"
print "you're checking Chapter 10 for errors"
print "of this nature, remember that Error 3"
print "is listed in the OPEN - Mode Output,"
print "Random, or Append section."
print
print
print "Press any key to continue. ";
gosub continue:
cls
print "This applies to the documentation for"
print "ASIC 3.01; earlier versions may not"
print "have this entry, and later versions"
print "may have changed it around. Also,"
print "other versions of ASIC.DOC may have"
print "the error codes under a different"
print "chapter number."
print
print
print "Press any key to continue, or Esc to"
print "quit ";
gosub continue:
if a$=b$ then option40:
cls
print "In case you might find this of use, I"
print "discovered the ";
print c$;
print "undocumented";
print c$
print "errors by using some program lines I"
print "call tracers. First I use a PRINT"
print "ERROR line to find out if there's a"
print "valid ASIC error being tripped. Then,"
print "since I want the error number to stay"
print "on the screen long enough to read it,"
print "I add a loop using INKEY$, thus:"
print
print
print "Press any key to continue. ";
gosub continue:
cls
print
print "CONTINUE:"
print "A$=INKEY$"
print "IF A$=";
print c$;
print c$;
print " THEN CONTINUE:"
print
print "This allowed me to see the number 3 on"
print "the screen. I then checked ASIC.DOC,"
print "and finally went back to READ.ASI and"
print "worked Error 3into the code."
print
print "If you're wondering why I didn't check"
print "ASIC.DOC in the first place, the an-"
print "swer is simple: I'm a bit dense some-"
print "times, and I didn't think of it."
print
print
print "Press any key to return to the Main"
print "Options Menu. ";
gosub continue:
goto option40:
rem This is the end of the routine dealing with "undocumented" errors (40 col)
gosub continue:
rem Here is the routine for getting a copy of ASIC in 40-column mode.
gtcopy40:
cls
print "If you want a copy of ASIC but can't"
print "find one, I'll send you a copy if you"
print "follow these instructions EXACTLY."
print "There can be no exceptions; if you"
print "don't follow these steps, your materi-"
print "al will be returned. Sorry if I'm be-"
print "ing a jerk about this, but I can't af-"
print "ford to spend any more time than abso-"
print "lutely necessary. Also, if there's a"
print "big response to this offer, I might"
print "end up with out-of-pocket expenses"
print "that could set me back in a big way."
print "Thanks for your understanding."
print
print
print "Press any key to continue. ";
gosub continue:
cls
print "First, you must send me:"
print
print
print "1- A diskette mailer."
print
print "2- A blank diskette (360K, 5.25 inch)."
print
print
print "Before you send the above:"
print
print "1- Put your address on the mailer."
print
print "2- Put sufficient return postage on."
print
print "3- Format the diskette."
print
print
print "If you do all that, I'll make copy"
print "of my ASIC disk, and send it back to"
print "you."
print
print
print "Press any key to return to the Main"
print "Options Menu. ";
gosub continue:
goto option40:
rem This is the end of the routine for getting a copy of ASIC.
rem This is the routine for running ASIC on one drive in 40-column mode.
onedrv40:
cls
print "The hardware requirements for ASIC are"
print "listed as one disk drive. This is"
print "true if you want on-line help; if you"
print "feel you can get along with just the"
print "printed documentation, and you have"
print "only one floppy drive, you can still"
print "use ASIC by following this method."
print
print
print "Press any key to continue. ";
gosub continue:
cls
print "The most important thing to remember"
print "is NOT to use this procedure on the"
print "original disks. If you do, you'll"
print "lose ASIC.DOC, which will leave you"
print "without any help at all, on-line or"
print "otherwise. So, first thing, make a"
print "backup of your ASIC disks. Now put"
print "the originals far, far away so you"
print "don't mix them up."
print
print
print "Press any key to continue. ";
gosub continue:
cls
print "The next thing you'll do is DELETE the"
print "following files:"
print
print
print "ASIC.DOC (do you know where your"
print "original is? It had better not be in"
print "the drive, or you'll lose the doc-"
print "umentation)"
print
print "ASIC.IDX (you don't absolutely have"
print "to, but it's useless without ASIC.DOC,"
print "so you might as well)"
print
print "ASICM.IDX (same reason as above)"
print
print
print "You'll have to print ASIC.DOC, of"
print "course, to use the documentation."
print
print
print "Press any key to continue. ";
gosub continue:
cls
print "Once you've deleted these three files,"
print "you'll have enough room on one 5.25"
print "inch, 360K floppy to write good-sized"
print "programs. It's still possible to run"
print "out of room, but it'll take a bit of "
print "doing."
print
print
print "Press any key to continue. ";
gosub continue:
cls
print "If you do run out of room for"
print "ASIC????.EXE, your source code, and"
print "your executable code, you may be able"
print "to write your source with a word"
print "processor that lets you save your"
print "files to a disk other than the one"
print "with the word processor (almost all of"
print "them do that) and let you save your"
print "files as ASCII or text (most of them"
print "do that). You can save your source to"
print "a blank disk. Then you can copy"
print "ASICC.EXE by typing (from the DOS"
print "prompt) COPY ASICC.EXE B:. ASICC.EXE"
print "should be in your drive when you type"
print "this command. When DOS prompts you to"
print "change disks, put the disk with your"
print "source code into the drive. There'll"
print "be plenty of room for both ASICC.EXE"
print "and your source. When both files are"
print "copied to the one disk, type ASICC"
print "YOURCODE.ASI (substituting the name of"
print
print
print "Press any key to continue. ";
gosub continue:
cls
print "your source code for YOURCODE.ASI, of"
print "course). Your source should compile,"
print "and there should be plenty of room for"
print "ASICC.EXE, your source code, and your"
print "executable code (.COM file)."
print
print
print "Press any key to return to the menu. ";
gosub continue:
goto menu240:
rem This is the end of the routine for running ASIC on one drive in 40-columns
rem Here is the routine for wrapping things up in 40-column mode.
concld40:
cls
print "If you've had a problem that puzzled"
print "you until you figured out a fairly"
print "simple method, let me know and I'll"
print "include it here. We all have"
print "stumbling blocks and mental blocks,"
print "but if we blockheads get together and"
print "share info, we can save each other a"
print "lot of time and write higher-quality"
print "programs into the bargain."
print
print
print "Thanks."
print
print
print "Press any key to return to the Main"
print "Options Menu. ";
gosub continue:
goto option40:
rem This is the end of the routine for wrapping things up in 40-column mode.
rem Here is the routine for continuing when the user presses a key.
continue:
wait:
a$=inkey$
if a$="" then wait:
return
rem This is the end of the routine for continuing when the user presses a key.
rem Here is the routine for returning to DOS.
finish:
cls
end