** 1 page regular HBASIC tutorial / 745 words ** Basic BASIC! This month Paul Jones unveils his latest project - Virtual BASIC! Virtual Insanity In the last few issues we've been creating PDO, a GEM application in HiSoft BASIC. If you're still struggling, or haven't got the confidence to create your own fully working program, then Virtual BASIC might be the solution. Imagine if all you had to do was create your dialog boxes/menus in a Resource Editor and, instead of going through all the hoops we've covered recently, you could simply double click on the button you wish to assign code to and type - that's what Virtual BASIC will offer! Virtual BASIC (VirtB from now) is a partial 4th Generation Language (4GL), which means instead of telling the computer what to do and how to do it (a 3rd Generation Language), with the 4GL you simply tell it what to do. VirtB is still only a partial 4GL because you still have to tell it what to do, but there's now a set of commands to deal with complex issues such as OLGA compatibility, ST-Guide help and system messages. Virtual Reality Here's a programming example: ** EDIT.GIF here ** Our RSC file is loaded up with a copy of its HRD file - which contains each name of every dialog box/menu/object etc. These names are displayed in the edit dialog box, with the object type in brackets (in this case our menu is highlighted). We click on Show and the menu is displayed in the menu bar area. ** MENU.GIF here ** The menu can be treating like any other, click on the one we wish to assign code to, "About NetChat", and VirtB automatically assigns a name for the object and runs the editor program to input the code. ** CODE.GIF ** As you can see there's nothing complex about the code. This fragment just declares our subroutine (the SUB and END SUB parts are not changed). Code goes in between these two sections. The infodi.show command will simply show the dialog/menu called infodi. In this case infodi is the dialog box which displays information about NetChat. ** INFODI.GIF ** After saving the code and exiting, the program returns back to its original position. Finding the edit dialog box and clicking on "infodi (dialog)" then clicking Show displays the information dialog box. Assigning code to a button couldn't be simpler, simply double-click on it, and the editor runs ready to enter your code. Currently, VirtB only displays the object name in an alert box. It's also possible to assign code to the "form_load" i.e. when the form is displayed (this could contain code to remove all text from text boxes and so on). After you've saved the source, VirtB offers a compiler option. This takes a template of the HBASIC GEM structure code, adds your code and anything extra needed such as libraries. One big program is generated and this final chunk of code can really be compiled into machine code using your HiSoft BASIC editor. New templates can be offered up updated regularly. It's hoped that there will be a special version of ENCHANT for sell for your template. Templates can be written by 3rd party members in HBASIC so can even be upgraded by yourselves to customise the dialog appearances. If you have any ideas or suggestions for developing Virtual BASIC do get in touch - your ideas may well be incorporated into a future release. ** boxout ** Enchanting ENCHANT (ENhanCed Hisoft ApplicatioN Toolkit) is a set of replacement HiSoft Graphical Toolboxes (HGTs) written by Paul Jones and Matthew Bacon (Cadenza Software). The HiSoft Graphical Toolbox is a series of routines which can be included into your own programs to speed up development in programming. For example, the HGTs offer sub-programs to deal with the GEM evnt_multi command. ENCHANT is designed to do what the HGTs did, but faster with even more features. Hopefully the final release version will include routines to ease OLGA linking, ST-Guide online help, encoding routines, and many more besides. Templates will be updated regularly and the intention is for a special version of ENCHANT to be used as a template offering features such as MPEG decoding, AVR/WAV file playing and so on. Templates could also be written by third parties to add other features to your library. ** /boxout ** ** boxout ** All change Paul Jones has left the Zetnet ISP and consequently the HBASIC mailing list is closed. Paul can now be contacted at: ** BC ** paul.jones31@virgin.net ** /BC ** ** /boxout **