07.05.2015 Views

Bronze Edition Guide - True BASIC

Bronze Edition Guide - True BASIC

Bronze Edition Guide - True BASIC

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

211<br />

Making Your Own DO Programs<br />

APPENDIX<br />

E<br />

You may have noticed the directory “TBDo”, which contains several so-called “DO programs.”<br />

Actually, they are not regular programs, but are subroutines. They are<br />

designed to operate on the text file in the current editing window, but can be made to do<br />

just about anything.<br />

You can make your own DO programs. Follow these simple steps:<br />

1. Create a library file, carefully choosing its name.<br />

2. On the first lines of the library file, enter<br />

EXTERNAL<br />

SUB xxxxx (current$(), options$)<br />

3 Now write what you want to do, which may involve modifying the lines or the<br />

current file.<br />

4. At the end of the file, enter<br />

END SUB<br />

Note: the actual name of the subroutine is irrelevant! A DO program is always identified<br />

by the name of the file containing it!<br />

Now save this file in the directory TBDo. When <strong>True</strong> <strong>BASIC</strong> starts up, the name or your<br />

new do program file will appear in the Run menu along with the names of all the other<br />

do programs.<br />

You can invoke a do program in two ways. You can select the menu item “Do ...” in the<br />

“Run” menu, or you can type the command “do filename” on the command line. (Of<br />

course, you’ll actually type the file name you have selected.)<br />

If you use the menu selection method, you may have to navigate the file system to find<br />

the directory TBDo. Then you’ll also be asked for the the command line parameters.<br />

Whatever you enter will then be assigned to the second argument in the calling

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!