BASIC section

QL BASIC logo

Last Updated: 07/11/22


atan.txt - an enhanced ATAN function written in BASIC (Steve Poole) (1K) [07/03/17]

backup.zip - Backup_bas is a very simple disk backup program, at just 10 lines long they don't come much simpler than this! (1K) [09/10/06]

convert.zip - lengthy document about converting older Microsoft-style BASIC programs to QL BASIC. Includes some hints in a separate document, and a set of procedures to provide commands mith M$ BASIC style naming to simplify the conversion as much as possible (e.g. string slicing functions called LEFT$, MID$ and RIGHT$). Presented as a Quill _doc file, the main document convert_doc is actually too large to load into standard Quill, you have to read it in Xchnage Quill. For this reason, I've made an online html (554K) and PDF file (253K) version of the main document for those without Xchange. (75K) (David Denham) [20/05/16]

detokenize.zip - although there's a wealth of old Microsoft-style BASIC programs out there which could be converted to QL BASIC with just a little effort and guidance from the convert package above, many of these programs are in tokenised format, which corresponds to the sort of difference between QL BASIC _bas and _sav files. Detokenize is a package which contains documentation on the tokenised file formats and some short SuperBASIC programs which can read and export the tokenised Microsoft-style BASIC into plain text files, making it easier to import them to a plain text editor to manually convert such programs into QL BASIC. (89K) (David Denham) [20/05/16]

direxists.zip - DIR_EXISTS is a short function written in BASIC to test for the existence of a named directory, e.g. PRINT DIR_EXISTS("win1_mydir_"). It needs the FTEST and FTYP extensions of Toolkit 2. Based on an idea by Derek Stewart. (D. Jones) (2K) [06/10/18]

fitword.zip - a short SuperBASIC routine to word wrap text in a given window channel. Shows how to use the "!" print delimiter. (A. Pritchard) (1K) [11/09/18]

formatter.zip - A cartridge format cloner, written in SuperBASIC, letting you reformat a cartridge in MDV2_ to have the same random number or 'fingerprint' as the cartridge in MDV1_. Some older commercial QL software used this 'fingerprint' value as a copy protection system. This program should help you make safety backup copies of these valuable old QL programs from the 1980s (note: for personal software backups only!). Note that this program only formats the backup cartridge, you must copy the individual files using a backup program such as backup.zip above, or the WCOPY command from Toolkit 2. (2K) [10/05/14]

jupiter.zip - Calculation of the position of the Galilean satellites of Jupiter for given date and time. Nice graphical display including animation. (A. A. Cortes) (4K) [25/01/13]

ls.zip - A Unix-style 'ls' command written in SBASIC. It lists one file per line, with type, size and date info, and without the subdirectory names in front of each filename (unlike DIR and WSTAT). Also, an 'lsr' command which lists files recursively down directories. Also allows wildcards, e.g. lsr _doc. Recognises TKII default data directory and hard subdirectories on V2 devices. Instructions in REM statements in the program. (Jan Bredenbeek) (15K) [29/01/17]

luckydip.zip - A miscellany of short BASIC listings for you to play with, includes a mode 4/8 colour palette display (look up colour numbers), a simple logic tutor, roman numerals conversion, sound experimenter, base conversion program for all base numbers from 2 to 36, character set displayer (look up character codes), indent basic programs, sorting procedures (bubble sorts, shellsorts, quicksorts etc), recursion examples, a label typewriter program and a simple but addictive little Surround game where you have to avoid being trapped by the computer (33K) [05/07/05]

patternmatch.zip - a pattern match routine to allow use of '?' and '*' for wildcard pattern matching routines. Written as a SuperBASIC function called MATCH, you can use a line such as PRINT MATCH("*s",test$) to match strings ending with "s" or PRINT MATCH("???t","test") to look for four letter strings ending with "t". (2K) (M. Lloyd) [22/05/18]

pixelcolours.zip - a short set of functions written in BASIC to return the colour value of a pixel anywhere on the screen. Works on high resolution and high colour systems, modes 4, 8, 16, 32 and 33. Enables you to read colour values without having to rely on toolkit extensions. Optionally handles the "byte-reversal" of mode 32 colour values. (3K) (Dilwyn Jones) [07/11/22]

prop.zip - A small package consisting of a couple of sample fonts and procedures to implement a very simple screen proportional printing fonts system. (7K) [04/09/07]

rounding.zip - a function written in SuperBASIC to allow rounding of small decimal numbers to up to 6 decimal places without exponential 'E' notation. (R A Robins) (2K)

SuperBASIC syntax colour file for BBEdit/TextWrangler - Jean-Yves Rouffiac has created a SuperBASIC  /SBASIC / Toolkit syntax colour file for those who would like to use those editors on the Mac to edit QL BASIC programs. Jean-Yves says: "Please read the .readme file for instructions on how to install it. Once installed, you need to give your BASIC file a .bas or .sbas extension (I have not figured out how to get it to recognise _bas yet). Once installed, you get nicely colour-coded SuperBASIC, and as a bonus, I have managed to figure out the regex for it to recognise procedures and functions so these get added to the functions pop up menu, allowing you to navigate quickly through your code. (I'd suggest setting the function list to sort alphabetically - I find this much more logical than the default sort (functions appearing in the order they are defined). You can do this in Preferences/Appearance).The file contains numerous toolkits and older emulator keywords too. I have commented these out as the odds of anyone having all the toolkits loaded and being in an old emulator are rather slim. To enable them, edit the file in a text editor (eg TextWrangler or BBEdit themselves) and remove the <!-- and --> tags form around the sections you want to enable." (8K) (Jean-Yves Rouffiac) (06/03/14)

SuperBASIC syntax file for Vim editor - The VIM editor (Vi IMproved) is a highly configurable text editor built to enable efficient text editing. It is an improved version of the vi editor distributed with most UNIX systems. Vim is available for Unix, Mac and Windows - see http://www.vim.org/index.php . It can display text with various forms of highlighting, so Marcos Cruz wrote this Vim syntax file in order to write SuperBASIC code more comfortably with Vim. He adapted the basic.vim syntax file maintained by Allan Kelly, included with the program. Future developments may include addition of more SuperBASIC toolkits. (7K) (Marcos Cruz) (06/03/14)

SuperBASIC syntax file for Textpad - a syntax rules file for editing SuperBASIC programs in the Textpad editor for Windows, which has user configurable syntax highlighting. Useful for anyone who likes to edit QL BASIC programs ina  Windows editor. Put the SuperBasic.syn file in your "Program Files" for TextPad, inside the "Samples" folder. (2K) (Laurence Reeves) [17/03/14]

SuperBASIC syntax file for Notepad++, a free text editor for Windows. Allows you to edit SuperBASIC programs in this editor with the various keywords and structures highlighted in different colours. After downloading and unzipping, use the Language menu in Notepad++ to select 'Define your language...' then click on the 'Import' button to load the definition file. Load a SuperBASIC program and select the 'SuperBASIC' language from the bottom of the Language menu. (3K) (Daniele Terdina) [22/09/15]

SuperBASIC editing with MicroEMACS on QL - see Editors and Viewers page for a version of MicroEMACS editor with SuperBASIC syntax highlighting, running on QL under pointer environment.

tsbasprog.zip - a large collection of 34 SuperBASIC programs by Prof. (emer.) Timo Salmi. Originally hosted on the now defunct Garbo archive at the University of Finland. Includes utilities, demos and a game. (51K)

tsbasrout.zip - a collection of 14 SuperBASIC procedures and functions Prof. (emer.) Timo Salmi. Originally hosted on the now defunct Garbo archive at the University of Finland. (8K)


Return to the home page. | Return to Downloads Index