SmartBASIC TidBits and Hints
by varous


This section of the site has compiled varous articles on SmartBASIC and placed them here. Duplicate coverage by differant authors tends to be sorted together, so enjoy these short articles.

Limited INIT Fix by Mike Graham mentions that you can only safely initialize a datapack about 4 times because the initialization process moves block 0, and after the process is repeated often enough, ADAM can't "find" the block. The easiest fix is to copy a new, blank formatted tape over the old one.

Checking For Bad Blocks by ? enter a range of blocks to check, by entering a starting block and an ending block. (Don't forget that the first block on the medium is Block # 0, NOT Block #1.) If you wish to check the entire medium, your ending block would be 255 for datapack or 159 for disk.

NON-Printing Characters by ? This tip is of interest to SmartBASIC hackers. In SmartBASIC, the normal way to include a non-printing character in a character string is to use the CHR$() function. e.g. PRINT CHR$(7) would cause a 'beep' sound to be heard, since ASCII code 7 is the 'bell' character, also known as Control-C (press and hold the Control key while pressing the G key ).

Fixing Margins by ? If you are using an older television for a monitor, and the characters at the left margin do not display when running a SmartBasic program, here's a way to overcome this problem.

Copy BASIC by ? On most media, BASIC occupies the first 29 blocks. (The blocks are 0-248; remember that to the computer, the first number is ZERO, not one.) So, all you need to do is copy those blocks from a BASIC tape to your own tape, using any copy utility that will copy block-by-block.

FLASH Command Not Present by ? Basic is Basic except when it's Smartbasic on the ADAM computer. Coleco seems to have released several versions of the Smartbasic Operating System for the ADAM which are for the most part the same. You seem to have an earlier version...

Playing Tricks With The: "FLASH" Routine by Mike McCauley I have again tackled the screen manipulation problem and have come across several tricks, traps, and techniques that have cleared the way, not only for using sprites on TEXT screens, but also having the sprites' movements driven by the FLASH routine, using graphics (again, in the TEXT mode), and animating the graphics.

Applesoft - Built In Assembly Lang Monitor by ? What this means is that the majority of APPLESOFT basic commands will work on the ADAM while some won't work at all. Also the two computers are different in their internal structure. APPLE uses the 6502 CPU as ADAM uses the Z/80 CPU.

Applesoft - CALL and Peek by ? ADAM and APPLE have their respective memory mapped out differently, in other words APPLE'S location to read the keyboard is PEEK(-16384) where as ADAM's is PEEK(-651) get the point ? Any program (APPLESOFT) that refers to specific memory locations is not going to run right on the ADAM.

Apple To ADAM by ? Conversions

Closing Data Files by ? If you have worked with Sequential or Random Access files, you may have noticed an intermittent problem when ADAM was attempting to read data and close the file. The result was either an END OF DATA Error, or garbage appearing in your files. The problem is caused by a safety feature built into SmartBasic.

ERRNUM and Error Codes by Alan L. MacAdams Coleco and others have documented SmartBasic, but certain. commands have been left out of programming manuals. One such command is "ERRNUM", which I have found useful and simple to use. "ERRNUM" is used in an error-trapping subroutine (i.e., after issuing and executing an "onerr ... goto" command.)

Shape Tables by ? here is where the ADAM can really mimic the APPLE. If you can obtain the Shape table in DECIMAL equivalent #Is I can help you. First of all you need some memory to play with that can be taken care of with the command HIMEM: 51455 this will tell ADAM not to write anything beyond 51456 and up.

Garbage Collecting (Pausing) by ? if in your program you're constantly looping back to a variable and altering it ADAM does not forget the original values. They lie off in a corner of memory taking up space, after a while ADAM " cleans house" by gathering the defunct variables and discarding them. This is that so called pause...

AutoCenter Demo by W.R. Mitchell by ? Type this in BASIC and RUN it to see how the subroutines will work in your own programs to center text on your screen and space lines.

How To Use Function Keys by ? There are twenty three various function keys on the ADAM keyboard (8 command keys, 6 SmartKeys, 5 cursor keys and 4 other misc. keys). Since Coleco has not documented these keys they are yours to program. The following routine is an example of using the function keys to make selections.

NO MORE ROOM by ? If you have run into the NO MORE ROOM message on your data packs or disks. Here is a program that will get rid of those big programs that are not completely erased.

Some Key Commands by ? Here are a few SmartBasic commands that you might want to jot down if you don't already know them.

Turnkey and PACKCOPY by ? Many people have had trouble running Turnkey programs after copying SmartBasic to disk with PACKCOPY. Don't know what a 'Turnkey' is?? A 'Turnkey' is a program that is run by SmartBasic immediately after Basic is loaded. SmartBasic looks for a program named "HELLO" on the Data Pack or Disk before turning control over to you. If one is found.- it is auto-run by Basic. If no program is named "HELLO", control is turned over to the user immediately. The problem some people have is that even though SmartBasic is on Disk,...


Back to Top