GO SUB

Short snippets of S*BASIC code, scripts, and programming aids

Most PE routines require EasyPtr's ptrmen_cde!

Cut these routines from the web page and paste them into your favourite QL editor..

Name Vers Description Remarks
Sprites and other PE Objects
txt2spr 0.02 Convert menu item text to sprite. Useful for drag'n drop? This version GD2 only!
enRLE 0.02 Sprite compression. Routine to do standard SMSQ/E sprite compressions. Here with a harness to compress some solid GD2 sprites.
Bounce 0.01 Jumping ball demo. Simple, ready-to-run routine demos moving a semi-transparent sprite. Basis for a games routine? GD2 only!
BlbCol 0.01 Colour blobs Simply give a blob any RGB colour. Find out more about blobs, etc.. GD2 only!
Pic2Spr 0.06 Convert PICs to SPRites Convert PICs of any QL or GD2 mode to SPRites of the same mode. RLE-compressed if wanted.
Pic2Pac 0.02 Convert PICs to PACs Compress PICs of any QL-native mode to - typically, for screen shots etc - 10%-30% of the original size.
Pac2Pic 0.01 Convert PACs to PICs Decompress PACs back to standard PICs.
Programming Aids
CDBdefs 0.00 Channel Definition Block functions Requires Channel toolkit. Cut out the ones you need and paste them into your program.
ScrollED 08WB Scrollable line editor for inclusion in S*Basic programs GD2-compatible version. (The idea was to write this in assembler, but I never got round to it.) Download code here.
DeHex 0.01 Remove hex and binary literals from SBASIC programs. SBASIC only.
PokeDatW 0.01 An aid to add binary data to your SBASIC programs without DATA statements. Output for SBASIC and MBASIC (Minerva) only (even when compiled!) as Qdos doesnt do multiple pokes in one go.
Files, Directories, and Directory Devices
DevGet 0.06 Given a device's USE name, return its real name (and vice versa) SMSQ/E & Qlib. Probably not relevant for Qdos.
DelDir 0.01 Demo and tutorial: Traversing a directory tree (bottom up) Commented S*Basic code to scan and DELETE a directory tree. (Nowadays Id do it differently ;o)
HDRen 0.05 Give your QXL.WIN-type hard disk a sensible name! For QPC, QXL and other systems that use the QLWA container HD
DirSize 0.01 Get the file count and size of a directory tree. Qmenu + SMSQ/E, or Qdos with DDL2 + tk2 + PE.
QLone 0.02 Clone a complete device or directory tree. SMSQ/E / Qdos with DDL2 + tk2.
NextFile 0.10 Get filenames from a directory one at a time as needed. SMSQ/E / Qdos with DDL2 + tk2.
FilesOpen 0.02 Find out how many open files there are on a device, - eg before dismounting it. SMSQ/E and SBASIC only, as it stands.
DirUp/DirDn 0.05 Functions to move up or down a directory level. SMSQ/E or Qdos with TK2 with DDL2.
ParseFnm 0.05 Routine to split a filename into its components. S*BASIC for all systems with DDL2.
Sorting and Searching
Unique 0.01 Search and create a list of unique items. S*BASIC for all systems. The example here uses my CMP% function, but it can be modified to do without.
UniqueInd 0.01 Search and create a list of unique items stored in a heap. S*BASIC for all systems. The example here uses various toolkit commands, but it can be modified to do without.
Mem-QS-BS 0.01 Sort and search strings in memory. S*BASIC for all systems. The example here uses my POKESTR$, PEEKSTR$, and CMP% functions, but it could be modified to do without.
Experimental
SB Slave 0.02 Demo of how SBASIC can be used as a slave by another program Could be used in a QL browser?
Miscellaneous
Calendar 0.00 Template script to produce basic calendars View sample output or download code here
Kbdbtn 0.00 Button to change keyboard languages PE + Qmenu.
Magnify 0.01 Simple screen magnifyer PE + GD2 only! Requires ptrmen_cde and my Rpix toolkit. Get the compiled version here.
BlockFount 0.03 Write characters in large sizes All platforms. Demo requires my Chans toolkit.
Wrap 0.06 Wrap text, ie break lines at space Wrap and split lines, eg for popup help texts, etc.
We should avoid duplication of effort, because that is being done by others
- Athur Mitchell (British industrialist)