What the...? ÿÿÿÿÿÿÿÿÿÿÿÿ As soon as you removed the packaging from your HiSoft BASIC box, you switched on your Atari, rushed the main disk into the drive, installed the language and ran the example files to see what the new language could do with the AES. Go on, admit it! It's the same for all of us: we want to see what we spent all that money on. Once you've seen your first alert box appear on the screen, even though it may be a simple message it displays, you feel you've got your moneys' worth. This tutorial is about a beginners guide of how to use HBASIC. Don't worry if you're new at programming in BASIC, I'll be showing you how to use the simple commands, with a combination of the 'more advanced' AES routines. By the end of the tutorial, you'll know about he basics' of the language, how to use menus, dialogs, window dialogs, text windows, picture windows, alert boxes, windows, the fileselector, how to make accessories, and I'll also be showing you 'the tricks of the trade' as well. These include 'shareware delays' and 'progress meters'. I might even include a tutorial to use SpeedoGDOS. If you've never even heard of some of these things before, don't worry. Every issue I will supply a picture or diagram of what I'm talking about in the tutorial, and I'll try to give you an example of where you would see something like it in another well known program. I assume in this tutorial that you know how to use the editor of HiSoft BASIC at least. Ok, lets go... A simple program ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ Once you've loaded up HBASIC, type in this very simple listing: <0001.GIF> Compile the program using [control]X. This will also run the program. You will see after the program has executed that 'Hello!' has been printed - or written - to the window. This is one of the simplest commands possible. What ever is in the speech marks is printed to screen. Try some other texts just to make sure you understand the command. Once you're finished, try this... <0002.GIF> A slightly more complex program. Run the program in the same way as above. This time, you will notice a series of 'Hello!'s, a space, and then a number. These numbers are the contents of A. It's a bit like algebra really. The FOR tells HBASIC that our variable A should start at 1 and go to 10. The semi-colon (";") tells HBASIC to print the A next to the 'Hello!'. Change 'PRINT "Hello!";a' to 'PRINT "Hello! a"', and try that. You notice this time the A isn't printed, instead 'a' is printed. Do you see the difference between the text and the variable? The 'NEXT a' tells BASIC that this is where our FOR loop ends. This command really tells it to continue with the 'FOR' command until it has finished. Ok, lets try something more interesting... <0003.GIF> Couldn't resist it! It does play a vital part of this tutorial though; it introduces us to the STEP command. Instead of going to one number through to the next, the STEP command tells BASIC to jump numbers. For example, our FOR a=2 to 8 STEP 2 will start at 2, and jump 2 to land on 4, then jump on to 6, and stop at 8. Do you notice that 'What do you think goes here?' only appears after the FOR loop? How long is a piece of string? ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ Using numbers is fine on it's own, but what about if you want text in your programs? Well, that's easy too. A string, which contains text has a name ending in "$". For instance, 'mytext$' can contain text, where 'mytext' without a American dollar sign can only contain numbers. Try this program: <0004.GIF> Another way of writing 'PRINT ac$;a' would be to write out 'PRINT "Atari Computing issue";a', however, in programs which use text heavly, the latter shouldn't be used. For instance: <0005.GIF> A number, a big gap and then a letter should appear on the screen. In fact, 26 letters displaying the whole alphabet to be exact. You may have noticed that there is a comma (",") instead of our normal semi-colon (";") in the PRINT statement. This, as you've seen, gives a bigger space in between the objects being printed. Another way of this command would be to use: <0006.GIF> Lets look up CHR$ in the manual. You'll find the command on page 16 of the 'Technical Reference'. Each of the commands you use in HBASIC will have the same instructions to its use as the page you see before you. Of course, the function will probablly be different. We can see that this function will produce a character numbered ASCII_code in its brackets. In the above example, this is our variable A. ASCII, as you may or may not know, stands for American Standered Code for Information Interchange. ASCII was invented by our friends the Americans to make sure that computer text would be displayed in the same way on every machine. For example, if I wrote "Hi People!" on my Falcon, and there was no such as ASCII, on a PC it might be displayed as "FjKtosdkks"! Using ASCII and CHR$, you can access all characters that the Atari can display. Here's another program: <0007.GIF> One final program: <0008.GIF> If you were to write a program to do this without string commands, it would turn out like: <0009.GIF> Just imagine if the text you wanted to print was a hundred letters long in the last example! That's it for this issue. Next time we will be looking at making simple alert programs, and how to make your program take decisions. We'll also be starting our project, a simple ultility to print out documents. Until then, try experimenting with the programs I've given you. Why not try to figure out how the 'triangle' program works? Remember you can look up any commands you are unsure of...