Quick and Dirty Routines for Newbies
Posted: Thu Sep 22, 2011 11:21 pm
If you are starting out using a QL, QL Emulator or other such hardware equivalent that uses SuperBASIC or even the coverall S*BASIC, then here are a few routines to assist you or at least get you thinking about making your own.
The absolute beauty of SuperBASIC for me is the ability to add your own commands just by simply writing procedures and functions and then you can immediately use them. TOOLKIT II is assumed to be invoked and these are routines that I use a great deal when writing programs to keep things ordered.
Saving your program as you go along with a simple S + Return
1000 DEFine PROCedure S
1010 DEV$="FLP1_"
1020 FILE$="Filename"
1030 SAVE_O DEV$&FILE$
1040 SAVE DEV$&FILE$&"_BAK"
1050 END DEFine
Getting a directory as you go along with a simple D + Return
2000 DEFine PROCedure D
2010 DEV$="FLP1_" :REMark or assume that it already exist in 'S'
2020 DIR DEV$
2030 END DEFine
Renumbering your program as you go along with a simple R + Return
3000 DEFine PROCedure R
3010 RENUM
3020 END DEFine
Quitting from your QPC2 program with a simple Q + Return, write and use with care
4000 DEFine PROCedure Q
4010 S:D
4020 QPC_EXIT
4030 END DEFine
The absolute beauty of SuperBASIC for me is the ability to add your own commands just by simply writing procedures and functions and then you can immediately use them. TOOLKIT II is assumed to be invoked and these are routines that I use a great deal when writing programs to keep things ordered.
Saving your program as you go along with a simple S + Return
1000 DEFine PROCedure S
1010 DEV$="FLP1_"
1020 FILE$="Filename"
1030 SAVE_O DEV$&FILE$
1040 SAVE DEV$&FILE$&"_BAK"
1050 END DEFine
Getting a directory as you go along with a simple D + Return
2000 DEFine PROCedure D
2010 DEV$="FLP1_" :REMark or assume that it already exist in 'S'
2020 DIR DEV$
2030 END DEFine
Renumbering your program as you go along with a simple R + Return
3000 DEFine PROCedure R
3010 RENUM
3020 END DEFine
Quitting from your QPC2 program with a simple Q + Return, write and use with care
4000 DEFine PROCedure Q
4010 S:D
4020 QPC_EXIT
4030 END DEFine