March 2008 News Posts
Home
|
|
PDA247 Labs
 |
| Topic: |
iziBasic 4.1 - review by Mike Featherstone |
Date:
|
18/1/2005
|
|
 |
| |
iziBasic 4.1
| | |
|---|
| Price: |
$15
| | Reviewed by: |
Mike Featherstone
| Supplied: |
Laurent Duveau (Aldweb)
| | Review date: |
18/1/2005
| Pros: |
Impressive functionalityFreeware version supports good range of functions Active Support Forum Ongoing development Good implementation of GUI functions Integration with PIAF provides a good integrated development environment
| Cons: |
Some error codes are a little unclear
| | | |
|
Introduction
For quite a long time I've been looking for a means of writing small but useful programs directly on my T3. Nothing major, I leave that to the experts, (or at least to those working on larger development platforms) but the sort of little things that wouldn’t be worth developing commercially but would be extremely useful to me either personally or in my engineering job.
 |
Ten years ago, I had this facility with my old Psion 3 series handheld but since I moved to PalmOS I've been struggling to find a suitable replacement capable of running on first my Vx and now my T3 – and in future, I guess, on my T5. A number of alternatives have suggested themselves over the years but none have ever really enabled me to do the sort of thing that the Psion OPL language let me get away with all that time ago. Now, with iziBasic, from Aldweb, I think I've finally found something that I can use to good effect to produce the sort of small utility program I am interested in.
Before I get into the review itself, one problem that needs to be addressed relates to the nature of the review topic and thus the content of the review. Not really a piece of software so much as a language implementation, iziBasic is not an easy beast to write about. Were I to limit myself to the functionality of the software then the content would be about 3 paragraphs describing each of the buttons on the main screen of the utility. If I were to go to the full lengths of describing every command and capability of the language, however, this would turn into a programming reference manual rather than a discussion of a specific product (and with the latest generation of iziBasic, version 4, enough language information is provided in the manual that I really don't have to repeat it here). Instead of either of these things, then, I’m going to attempt to tread a middle ground and give a feel for both the product and the language while trying to relate some of the capability offered by this particular combination.
Overview
The first thing that must be said about iziBasic is that it is just that – easy. (By which I mean a version of Basic that is easy to use). As I’ve already said, I’ve tried a few Palm based language compilers and interpreters in the past and all of them have been flawed in one way or another. In some cases it was simply that they would function only in a dedicated ‘Terminal’ mode where the screen is treated as a simple textual terminal and input and output must be processed via the ‘keyboard’ – useful in some situations, but not in all. In other cases it was that although the more complicated forms of GUI programming were supported, it was done in such a way as to require knowledge of the internals of the PalmOS (or at least the API) so as to determine which particular system call to make in order to do what was required. Neither of these is actually an implementation flaw as each of these programming methods is perfectly useable for the ‘right’ function given the ‘right’ knowledge and enough time. It’s just that neither of these methods gives me all of the options I want in terms of how I might prepare my programs, or where they do, don’t make it easy enough for me to want to bother trying.
IziBasic is different. It supports both terminal emulation and a fairly full GUI programming mode in such a way as to encapsulate the commands for the latter so as to make them simple for even the novice user, effectively extending the basic language to encompass some of the low level functions of the PalmOS and producing – iziBasic. For example, if you want to put an ‘OS like’ button at a particular point on the screen, you can do so simply by specifying the size, co-ordinates and legend to display without going away and determining which function call you need to make in each of the possible flavours of PalmOS that you may need to support. All of that complicated stuff that I found so problematic (or at least time consuming) in the other compilers is taken care of and hidden away from the user.
(As an indication of its ease of use, I'm working on my third small iziBasic application as I update this review, having been using the language seriously for only a matter of weeks. To be fair, I should add that I wasn't a software novice prior to starting out with iziBasic, I am employed as a software engineer and have been for the last ten years - though that may not be true for much longer.)
Given its relative simplicity, it should be said that while iziBasic would be a useful tool with which to practice your programming skills, it is not intended primarily as a training aid. With its encapsulation of some of the more complex system commands, this compiler is a powerful resource that makes it very simple to develop complete stand-alone applications in a very short period of time. It just happens that it is also a language implementation that should be possible to get to grips with relatively quickly.
The manual is not written to handhold the user through a course in the Basic language; rather it is a statement of the standard language features that the compiler supports with a bit more detail on those areas that have been especially constructed for this implementation. Personally, I agree with this approach, though I am grateful that with the introduction of version 4, Aldweb has extended the text to provide at least a brief summary of each command. (I've been working in Pascal and ADA for so long that my Basic skills are not what they were!)
Having said that the manual is not a training course, to help you familiarise yourself with iziBasic Aldweb has not been mean by any measure. Included in the package with the compiler and the manual are a number of example programs for both Terminal operation and the PalmOS GUI. Where the documentation provides details of what is supported, if you want to know how to use it then you could do a lot worse than look at the examples provided which seem to be updated each time the language advances to encompass the new functionality.
The Application
To say a few words about the application itself, iziBasic is ‘just’ a compiler. It makes no pretence to offer editing facilities or other fancy front end options. There are enough PalmOS text editors of various forms available, that to write another one would be simply taking development effort away from the compiler itself rather than adding anything concrete to the product.
Having said that, Aldweb has recently put some development time into PIAF, the file editor normally associated with the PP Pascal compiler. The result of this effort is, in effect, a rather nice integrated development environment in which both iziBasic and PIAF are able to link into each other and so avoid the manual application switching that was previously required.
For what may be described as ‘the worse case scenario’, iziBasic even supports the Memo application built into all PalmOS handhelds since the year dot (as far as I know). Given that, there is no excuse for not being able to move straight from acquiring the compiler to 'cutting your first code' and giving it a try.
In use, the compiler offers one screen with a list, two buttons and a checkbox. The checkbox enables verbose logging (useful to pinpoint a compilation error in a large code file) while the buttons are used to initiate compilation of the selected code file or return to the editor (the type of which is selected by the only configuration option available). The list, at the very top of the screen, provides details of all the code files on your device from which the one you want to compile may be selected. On successful compilation a third button will also be made available, permitting you to run your newly built application straight from the compiler.
The rest of the screen is given over to a terminal window where the progress of the compilation will be displayed as it happens along with the details of any error encountered (compilation will stop on the first error). I have to say that having been spoiled by a number of compilers I’ve used in my ‘professional’ existence, I find some of the iziBasic error reports lacking in detail. The compiler has always been correct in both identification and location of my mistakes, however, so I am probably being a little unfair in asking it to detail the exact syntactical nature of the error as well. (Using the newly integrated PIAF, you are better off as detection of an error will automatically drop you into the editor at the line in which the error occurred.)
The Language
The iziBasic command set encompasses all of the normal Basic language constructs useful in any small console based application and, for the more enthusiastic, a set of graphical instructions allowing use of most of the GUI interface provided by the OS. I have absolutely no intention of detailing the content of the language here but suffice it to say that the full set of functions are covered from basic mathematical operations and input/output routines through to file and preference manipulation and graphical features for handling pictures and drawing functions. Some of the more interesting ones are restricted to the ‘full’ (paid for) version of the compiler but the vast majority are available even in the freely downloadable version making iziBasic a very useful application even for the tight-fisted!
Compiler directives are used to declare important OS components such as your Creator ID (mandatory for PalmOS developments) and the minimum version of PalmOS that your application will support. In the ‘full’ version, you can also include resource files by this method giving you access to external libraries of images that you can define yourself and so take your program beyond the bounds normally set for handheld compilation. With the advent of version 4, you can even include a menu or a piece of music in your application via this route.
From version 3, iziBasic has had a maths Parser that enables ‘proper’ maths processing. Previously, one had to be very careful in performing numerical operations in order to get the operation order correct. As one who uses programming languages in my day job, I’m used to the operation of a full parser and find thinking around the lack of one a bit difficult. With iziBasic, not only do I get full parsing operation but I also have a choice of whether to use it or not. The Parser has been introduced as a ‘switchable’ compiler option because its use increases the size and slows the speed of the target application. Personally, I use it only where I need it as the speed impact is noticeable.
Having said I’m not going to run through and list all of the commands available, it might just be worth highlighting some of the GUI features that the compiler supports to give a flavour of what is possible with this tool.
iziBasic supports:
A user defined ‘AboutBox’
Buttons
Checkboxes
Image Buttons
Labels
Text/Numeric entry fields
a Menu
hard Key detection
and a few more. On top of that the standard calls for features such as the date or time selector dialogs are supported allowing you to do pretty much anything you like.
Conclusions
If I go into the full detail of the compiler, I’d be writing for ages. Suffice it to say that I have been looking for an application along these lines ever since I have had a PalmOS device. That is going on for four years now and the fact that I haven’t found one until now tends to indicate two things:
• The Psion series of handheld units with their OPL implementation were well ahead of their time
• Encapsulating things to the same level of simplicity (as OPL) for the part time programmers within PalmOS takes a lot of effort that not many developers have managed to expend.
Or
• I’ve been looking in the wrong places!
Either way, after just a few weeks of use, I know I have found a language implementation capable of supporting my requirements for handheld compilation.
As if that wasn’t enough, however, as well as all that is currently offered, the manual sets out a clear roadmap for future developments that are planned for the product. These include methods of reducing the compiled program size and adding features such as menu bars (if at all possible). While I’m some way away from needing to use these functions yet, knowing that the product is being actively supported always makes me more confident about deciding to take it on. So far with iziBasic I haven’t been disappointed.
Worked Example
The following is a small example of the sort of thing of which iziBasic is capable. I've put it together as a means ofshowing a few of the features that the language supports and demonstrating some of the features discussed in the review above. It doesn't 'do' anything other than display a date and time, but it does serve to illustrate a number of the points made earlier on. I've added comments describing what's going on (for those that need them) an attached a picture of the result at the end.
| ' Mike.ibas | Name of the file as a comment |
| {CREATORID "LDIM"} | Compiler directive defining unique creator ID |
| {VERSION "1.2"} | Version directive |
| {PARSER ON} | Maths Parser is engaged from here on |
| |
| BEGIN | Start the program |
| LABEL #1,"Hello World",10,20 | Put a text label at position v,y |
| BUTTON #4,"Hello",50,70,50,10 | Put a Button labelled 'Hello' at x,y sized a,b |
| Checkbox #5,"B",1,50,110,10,10 | Put up a checkbox |
| D$=Date$ | Put the current date in D$ |
| i=10 | Set i to 10 |
| REPEAT | Start a code loop |
| T$=Time$ | Get the current time |
| IF T$<>S$ Then | If the current time is different from the stored one |
| Label #2, T$,10,40 | Put the current time on the screen |
| h$=Right$ (T$,2) | Get the current number of seconds |
| H=Val(H$) | Convert it to a number |
| h=h-i | Subtract 10 from that number |
| j=h/10 | and divide the result by 10 (these commands work without the parser) |
| h=(h mod 10)+48 | This command will only work with the Parser however |
| j=j+48 | |
| h$=chr$(j) | Convert j back to a character |
| h$=h$+chr$(h) | and add it into a text string |
| Label #7,H$,10,90 | Now display the result |
| Label #3, D$, 10,30 | and display the date |
| End If | |
| S$=T$ | Store the current time (used earlier) |
| A=DOEVENTS | Find out what the latest control event was |
| IF A=4 Then | If the button (#4) was tapped on |
| D$=DateSelect$(D$) | Open the Date Selector and put the result in D$ |
| End If | |
| B=Checkbox (#5) | Get the state of the checkbox |
| IF B=0 Then | If it is un-checked then |
| Beep | Make a noise |
| End IF | |
| UNTIL A=-1 | If an exit command is received end the loop |
| END | End the program |
 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
|
|
 |
| Category: |
Software Reviews
|
|
 |
|
|