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.

a list. You may select any of the listed errors and the cursor will immediately go<br />

to the line and character position where the error occurred. Prior to running your<br />

program, the editor adds a few extra lines of code to a copy of your source<br />

program (this preserves the original) and it is this copy that is run. These extra<br />

lines include adding any loaded libraries and aliases. In the case of MODULES<br />

and EXTERNAL program units, no extra code is added and no loaded libraries<br />

are added. Remember that the default directory is where the bound program is<br />

launched from. CAUTION: if you are using line numbers, make sure to leave<br />

plenty of space between your line numbers to allow the editor room for the extra<br />

code between your lines. Intervals of 10 are normally sufficient.<br />

• BREAKPOINT – will mark your program at the line where the cursor is<br />

positioned. BREAKPOINT is normally disabled (grayed out) and only becomes<br />

active when you select DEBUG MODE from the SETTINGS menu. The<br />

breakpoint will appear as the word surrounded angle<br />

brackets. This is a toggle action feature, i.e. if the line already has a breakpoint<br />

then it will be switched off, but if there is no breakpoint then one will be added.<br />

If you RUN your program with breakpoints marked, the program will stop at<br />

the first breakpoint. A dialog box will give you the opportunity to continue<br />

running your program. All breakpoints are cleared when you toggle DEBUG<br />

MODE again. If you insert a series of variable names immediately after the<br />

breakpoint, e.g. a,n,string$,xyz,b<br />

then when your program halts at the breakpoint a list of all these variables and their<br />

current values will be displayed. In this way you can track the changing values of<br />

any variable while the program is running. This is a valuable aid to debugging.<br />

CAUTION: if you are using line numbers, make sure to leave plenty of space<br />

between your line numbers (10 lines is usually sufficient) to allow the editor to<br />

insert extra code between your lines to achieve this breakpoint feature.<br />

• COMPILE – will cause your program to be converted into a coded format that<br />

the computer understands. Unlike earlier editors, your program will be<br />

preserved. The compiled version will be automatically saved with the same file<br />

name and in the same folder as your source program, but the extension will be<br />

changed to TRC instead of TRU. Prior to the compiling process, the editor adds a<br />

few extra lines of code to a copy of your source program (preserving the original)<br />

and it is this copy which is compiled. These extra lines include adding any loaded<br />

libraries and aliases. In other words, a compiled program will run exactly like a<br />

source program. The exceptions to this rule are MODULES and EXTERNAL<br />

program units. In these two cases, no extra code or loaded libraries are added.<br />

Remember that the default directory is where the TRC program is launched from.<br />

CAUTION: if you are using line numbers, make sure to leave plenty (10 is usually<br />

sufficient) of space between your line numbers to allow the editor room for the<br />

extra code between your lines.<br />

• BIND – is a special linking process that combines your program with any<br />

library modules and other resources to produce a stand-alone executable<br />

application. The default name of this application is the same as your original<br />

source code except the extension is changed to EXE instead of TRU. A dialog<br />

box allows you to change this name and to specify the folder where the<br />

executable file will be saved. NOTE: this feature is NOT available in the<br />

<strong>Bronze</strong> edition so the menu item is grayed out and disabled. Prior to the<br />

binding process, the editor adds a few extra lines of code to a copy of your<br />

source program (preserving the original) and it is this copy which is bound.<br />

These extra lines include adding any loaded libraries and aliases, but DO NOT<br />

include the code that retains the output window. In other words, when your<br />

program reaches the END statement, the proram will stop and the screen will<br />

clear. If you need to retain the output window, you must add the code yourself.<br />

For example, immediately before the END statement add the following line:<br />

CALL TBexitroutine<br />

This will preserve your last screen until the user presses any key or clicks the<br />

mouse.<br />

xvii

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

Saved successfully!

Ooh no, something went wrong!