Mapper and ZBasic

I decided to use ZBasic for writing my IFComp entry and so I will use it for my mapping program.

I’ve been doing some reading in the manual.  I’ve mentioned before about some of the features of ZBasic.  It is what I would call an interpreter/compiler.

You can use it like AppleSoft, except that when you run the program, it compiles first and then runs.  This is good for development and debugging.

As you get further along you may want to create a stand alone program and ZBasic lets you do that with the inclusion of a few runtime files.

What I didn’t recall was something I consider huge.  That is the ability to write programs with out line numbers.  I mentioned this in an earlier post, as it was something I had just read about, but I don’t remember knowing about it back then.

You can write programs without line numbers and just use labels for sections of code you may need to refer to.

It also has long functions so you can define a function that contains several lines of code much like a subroutine.

The IF-THEN statement is important in all BASIC’s, but ZBasic also has the LONG-IF statement.  With the LONG-IF instead of writing IF CONDITION THEN DO-ONE-THING ELSE DO-ONE-THING you would write LONG IF CONDITION DO-STUFF XELSE DO-OTHER-STUFF END IF.  Stuff can be any number of statements, except if you have a loop it should all be contained in DO-STUFF or DO-OTHER-STUFF.

Along with ZBasic’s automatic indenting of loops, long functions and long if’s, the use of labels and removal of line numbers, makes the code you write cleaner and easier to read.

52/54

 

Posted in Apple //c, Posts, Programming, Projects Tagged with: , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

*