am· tc> Control a 

·rW,>!i •• r Geologists; 

JKDIGIT, A Program to Control a 

Digitizing Board for Geologists, 

Written in BASIC for an 

IBM Personal Computer 

By john 0. Kork 

A computer program enabling geologists to 

transfer information from maps to computer 

files using only a microcomputer 

U.S. GEOLOGICAL SURVEY BULLETIN 1616 
DEPARTMENT OF THE INTERIOR 

DONALD PAUL HODEL, Secretary 

U.S. GEOLOGICAl SURVEY 

Dallas l. Peck, Director 

UNITED STATES GOVERNMENT PRINTING OFFICE, WASHINGTON: 1986 

For sale by the Branch of Distribution 

Books and Open-File Reports Section 

U.S. Geological Survey 

Federal Center 

Box 25425 

Denver, CO 80225 

Library of Congress Cataloging in Publication Data 

Kork, John 0. 

JKDIGIT, a program to control a digitizing board for geologists, written in BASIC for an mM Personal Computer. 

(U.S. Geological Survey bulletin; 1616) 

"A computer program enabling geologists to transfer information from maps to computer files using only a microcomputer." 

Bibliography: p. 

Supt. of Docs. No.: I 19.3:1616 

1. JKDIGIT (Computer program) 2. Basic (Computer program language) 3. IBM Personal Computer-Programming. 

I. Title. II. Series. 

QE75.B9 no. 1616 557.3s [526'.028'5425] 85-al0104 [QE48.8] 
CONTENTS 

Abstract 1 

Introduction 1 

Merging the program modules for execution 2 

Program description and user guide 2 

Program structure 7 

Subroutines 7 

Appendixes: 

1. Commented listing of all modules in JKDIGIT .BAS 10 

2. System macro to concatenate programs and subroutines, with comments for 

listing 47 

3. Cross-reference list of subroutine calls, by calling program 48 

4. Cross-reference list of subroutine calls, by called program 50 

5. Complete variable list with reference lines 53 

6. Transfer statement cross-reference list 61 

FIGURES 

1. Diagram of template layout showing order for digitizing registration points 5 

2. Diagram of digitizer action table 6 

Contents Ill 

JKDIGIT, a Program to Control a 

Digitizing Board for Geologists, 

Written in BASIC for an 

IBM Personal Computer 

By John 0. Kork 

Abstract 

JKDIGIT is a computer program that enables geologists 

to transfer information from maps to computer files using only 

a microcomputer to control the digitizing board. Data can be 

digitized directly into Cartesian or geodetic coordinates, and 

a variety of types of identification can be associated with the 

digitized location. The program is written in BASIC for an IBM 

Personal Computer, but the code is well documented and 

modular so that it can be modified by a programmer for different microcomputers. Complete documentation also makes 

the program easy for nonprogrammers to use. Digitized locations are written to a disk file in standard ASCII format and can 

be transferred to another computer or used for input to another 

program. 

INTRODUCTION 

The program described in this report was written 

so that geologists would be able to transfer information 

from maps to computer files using only a microcomputer 

to control the digitizing board. Geologists often need to 

record digitized data in geodetic coordinates (latitude and 

longitude) so that maps can be drawn automatically using 

different map projections and scales. The programs supplied with the Houston Series 7000 digitizing board1 

allowed scaling only for Cartesian coordinates. Furthermore, those programs were written in FORTRAN for a 

PDP 11 computer, whereas this program was written in 

BASIC, a simpler language that can be used with most 

microcomputers. In this program, point identification 

labels of any length can be stored with the location coordinates, and lines as well as points can be digitized quickly 

and easily. The digitized coordinates along with an 

optional label are stored onto a computer disk file in 

1 Any use of trade names in this report is for descriptive purposes 

only and does not imply endorsement by the U.S. Geological Survey. 

standard ASCII format and can be transferred to another 

computer or used for input to other programs. 

The program was written in advanced BASIC for an 

IBM Personal Computer (PC) and can be executed with 

the interpreter or compiled. The hardware used includes 

the IBM PC with 128K RAM and an asynchronous communications port, with capability of executing programs in 

advanced BASIC. The operating system used to develop 

this program was PC-DOS, Version 1.1. The digitizer 

board must be equipped with a cursor capable of transmitting a different character for each of the 10 decimal digits 

and also for two additional characters(# and*). No proprietary code is included, even in the compiled version, 

and hence a prospective user need not buy the BASIC compiler. At a slight cost in efficiency the program was written 

in highly modular form so that it could be modified for use 

on other microcomputer systems. Copious documentation 

is included with each subroutine to aid programmers trying to adapt the program to other systems; but because 

the program, including comments, is 102K bytes long, the 

comments must be removed before the program is loaded 

for_ interpreter execution. A loading routine which automatically removes the comments is part of the program. 

This report includes the program documentation, 

which is presented in the text, and the complete source code 

and cross reference lists, which are presented in the appendixes. The documentation includes a brief description of 

how to merge the program modules for execution, a program description and user guide, and descriptions of program structure and subroutines. Users with access to an 

IBM PC and the required communications package will 

need to read only the first two sections. Users who want 

to modify the program to run on other microcomputers 

will find the descriptions of program structure and 

subroutines in the latter two sections useful. 

The source code is given in Appendix 1, but is more 

readily available on diskette from the author. Appendixes 

2-6 give various cross-reference lists that are of value to 

programmers. 

Introduction 1 
MERGING THE PROGRAM MODULES 

FOR EXECUTION 

The program modules consist of a loading/merging driver program (JKMERGE), the main driver program (JKDIGDRV), and 18 subroutines; initially each 

of the modules is stored in a separate file on disk. Because 

the program modules contain extensive documentation, 

the result of merging them is a program that is too large 

to fit into the 64K bytes available to the BASIC interpreter. Hence as the modules are merged for execution, 

the comments must be removed. This merging and 

removal of comments need only be done once if the 

uncommented program is then saved in a disk file. 

To load and merge the program, the user first loads 

the advanced BASIC interpreter, reserving 2048 bytes for 

an input buffer, by entering BASICA/C:2048 via the 

keyboard. Entering LOAD "JKMERGE" loads the 

merging program, and entering RUN begins execution. 

Merging the program modules and deleting comments 

takes about 10 minutes, and then the digitizer program 

starts. If the user saves the merged, uncommented program by entering SAVE ''filename'' after terminating the 

digitizing session, the program can be executed again just 

by entering BASICA/C:2048 filename. 

The BASIC compiler will not compile a source program saved in binary form, and hence the user should 

save the merged program in ASCII form by entering 

SAVE "filename" ,A via the keyboard. Compiler 

switches used are /X, /D, IS, /0, and /C:4096; after linking the object module and IBMCOM.OBJ with the 

BASIC library, the program can be executed by entering 

the name of the execution module via the keyboard. 

PROGRAM DESCRIPTION AND USER GUIDE 

The program is menu driven in the sense that all 

choices available to the user are listed in menus which 

are printed on the CRT screen at the appropriate time 

and the user is forced to choose digitizing parameters in 

the proper order. Each user response is checked at the 

time of entry to ensure that the selected parameter value 

is compatible with previously chosen parameter values. 

Each subordinate menu includes the option of returning 

to the main menu without making any parameter choice 

so that the user can always exit from the program without 

problems. 

The first action taken by the program is to send to 

the digitizing board a signal for a two-second beep. This 

beep indicates that the board is turned on and connected 

properly. If the beep fails to sound, the user can correct 

the problem and send another beep request to ensure that 

the problem has been removed. 

2 JKDIGIT, A Program to Control a Digitizing Board 

The main menu for selection of digitizing parameters and coritrol information next appears on the CRT 

screen. Present status of the main menu options is 

indicated on the right in square brackets: 

MAIN MENU 

1 Select Coordinate Type [NOT SELECTED] 

2 Get Scaling Matrix [NOT SELECTED] 

3 Select ID Type [NOT SELECTED] 

4 Select Output File Name [NOT SELECTED] 

5 Get Template Location Parameters [NOT 

LOCATED] 

6 Select Roundoff Values [DEFAULT-

.0000001' .0000001] 

7 Validate Scaling [NOT VALIDATED] 

8 Save Coordinate Scaling Parameters [NOT 

SAVED] 

9 Save Template Scaling Parameters [NOT 

SAVED] 

10 Select Beep Option [BEEP] 

11 Select Printer Option [NO LPRINT] 

12 Select Switch Stream Increment [DEFAULT 

.10] 

13 Start Point Mode Digitizing [NOT 

DIGITIZING] 

14 Start Switch Stream Mode Digitizing [NOT 

DIGITIZING] 

15 Quit 

Some of these choices must be made in a specific 

order, and others may be meaningless in the context of 

previous parameter choices. For example, scaling (option 

2) cannot be accomplished until the coordinate type 

(option 1) has been chosen, and the scaling parameters 

cannot be saved in a file (option 8) until the scaling computations have been performed (option 2). Acceptable 

option choices are indicated by highlighting the options 

on the CRT screen. The main menu options are discussed 

in detail in the following sections, which are numbered 

to correspond to the numbers in the MAIN MENU. 

1. Select Coordinate Type 

The six menu selections for coordinate type choices 

are: 

1) real x-y scaled Cartesian coordinates 

2) integer x-y scaled Cartesian coordinates 

3) latitude and longitude in decimal degrees 

4) latitude and longitude in degrees, minutes, and 

seconds 

5) integer board coordinates (0.001-inch units) 

6) return to main menu 

Cartesian coordinates can include the decimal fraction or be rounded to integer values and are calculated 

and recorded in double precision. Geographic coordinates 
can be saved in decimal degrees or in degrees, minutes, 

and seconds. Coordinate information is sent from the 

digitizing board to the microcomputer as integer values 

representing x-y displacement from the lower left corner 

of the board in units of 0.001 inches, and option 5 causes 

these values to be written to the output file with no scaling performed. 

2. Get Scaling Matrix 

The seven choices for scaling parameter options 

are: 

1) enter parameters from the keyboard 

2) read parameters from a previously saved file 

3) digitize control points and calculate new 

parameters 

4) register 7 .5-minute quadrangle map 

5) register 15-minute quadrangle map 

6) register 2-degree sheet 

7) return to main menu 

If the user knows the numerical values of all the 

scaling parameters, option 1 allows them to be entered 

via the keyboard. This situation might occur if the user 

had saved the parameters on a disk file, recorded the 

values, and then deleted the file. The second choice, 

option 2, would be of value if the digitizing process had 

to be interrupted before completing all work on a map, 

and the map had not been moved before continuation 

of digitizing. A possible cause of this situation might be 

a power failure. The user is instructed to enter the name 

of the file in which the parameters are to be saved. This 

name is checked to ensure that it is of a form acceptable 

to the computer operating system, and then the extension" .DIG" is appended to the name. If a file with this 

name does not exist or if the file is not a coordinatescaling parameter file, the user is so informed and can 

then try another name or return to the main menu by 

inserting a null file name (a carriage return alone). The 

parameters are read from the file, and the program 

returns to the main menu if no errors are detected. 

Options 3, 4, 5, and 6 are for use whenever a new 

map is being digitized or when a previously scaled map 

has been moved on the digitizing board. Options 4, 5, 

and 6 can only be selected if the previously made coordinate type choice (main menu option 1) specified 

geographic coordinates. When using these options the 

user must digitize registration points with known user 

coordinates, and this information is used to calculate the 

scaling parameters. Using option 3 the operator can 

choose to have the scaling accomplished by least squares 

regression fitting of bilinear, biquadratic, or bicubic 

polynomials to the registration point data. A separate 

polynomial is fitted for the horizontal and the vertical 

coordinates. The form of the bicubic equations is: 

X' =A+ BX + CY + D)(l + EXY + Ff'l 

+G)(3+H)(lY+IXf'l+JYJ (1) 

Y' =K +LX+ MY+ N)(l + OXY + Pf'l 

+ Q)(3 + RX?Y + SXf'l + TYJ 

where X' and Y' are in user coordinates and X and Y 

are raw board coordinates. The constants A-T are 

calculated using standard regression methods. The 

bilinear fit uses only the first three terms and the 

biquadratic fit uses only the first six terms of the equations (1). Bicubic polynomial fitting is automatically 

specified whenever options 4, 5, or 6 are chosen. 

After selecting (if necessary) the degree of the 

polynomials to be fitted to the registration points, the user 

is instructed to digitize the registration points. The 

mnimum number of points allowed for registration is 3 

for bilinear, 6 for biquadratic, and 10 for bicubic fit. 

However, because the fitted polynomials, although they 

are reasonably regular functions, can have large variations, the use of as many registration points as possible 

is strongly suggested. This is particularly true when the 

bicubic polynomial fit is used. When using options 4, 5, 

or 6 (special map registration) the user is forced to use 

all the tick marks on the maps as registration points-16 

points for 7.5- and 15-minute quadrangles and 25 points 

for 2-degree sheets. The advantage of choosing one of 

these three options is that the user coordinates of only 

the lower left hand corner of the map need be entered, 

and the user coordinates of the rest of the points can be 

calculated by the program. Of course, the user must then 

digitize the registration points from the map in a specified 

order-from lower left to upper right by rows as shown. 

The order of digitizing the points for 7. 5- and 15-minute 

quadrangle maps is indicated by the numbers shown in 

the following diagram: 

13--14--15--l6 

9--10--11--12 

5-- 6-- 7-- 8 

1-- 2-- 3-- 4 

The order of digitizing registration points for a 2-degree 

sheet is similar, but 25 rather than 16 points must be used. 

Some general guidelines for choosing the registration points when option 3 has been chosen are: 

a. At least one-half of the registration points should be 

on or very near the boundary of the map or region 

to be digitized, spread as evenly as possible along this 

boundary. 

b. The remaining points (about 114 to 112 of the points) 

should be distributed as evenly as possible in the 

interior of the map. 

c. The nearest neighbor distances between control points 

(that is, the distance from a given point to the nearest 

other point) should be as uniform as possible. 

Program Description and User Guide 3 
d. The first time a configuration of control points is 

used, there should be extensive use of the scaling 

validation option (main menu option 7). 

The user indicates that all control points have been 

digitized by placing the cursor anywhere on the digitizing board and pressing the"*" cursor button. User coordinates for the control points must then be entered via 

the keyboard in the same order that the control points 

were digitized. The program then displays the user coordinates and allows for correction of errors. After the 

necessary corrections have been made, the program 

calculates the scaling parameters and returns to the main 

menu. If the program is being executed through the interpreter, the regression calculations may take up to one 

minute for each coordinate. 

When the program is executed for the first time 

after the digitizing board power is turned on, the input 

buffer from the board sometimes contains extraneous 

signals which will cause the program to indicate an error 

when the first point is digitized (usually this will occur 

when the first registration point is digitized). The program will stop and print the error message "Trouble in 

JKDIGBRD." The only remedy is to start the program 

over by entering RUN via the keyboard. This problem 

has never occurred after the program has been restarted. 

3. Select ID Type 

The selections for ID type are: 

1) keyboard input 

2) cursor button input 

3) constant ID-one push per point 

4) cursor alphanumeric input 

5) return to main menu 

The ID associated with a location can consist of 

numbers (and possibly alphanumerics for options 1 and 

4), preceded optionally by a fixed alphanumeric sequence 

that is the same for each location. The capability of 

including a fixed sequence of numbers and (or) letters was 

included because a geologist might want to be able to 

identify all points digitized from a given map after the 

coordinates from many maps have been merged into one 

file. 

If the variable part of the ID is always to be 

numeric, option 2 can be used. The operator must place 

the cursor over the location to be digitized and press the 

cursor button for the leftmost digit of the variable part 

of the ID. The remaining digits are entered by placing 

the cursor anywhere on the map and pressing the proper 

cursor buttons in sequence. The location of the point is 

specified by the location of the cursor when the first digit 

is sent to the computer program. Pressing the"#" signals 

the program that the whole ID has been entered, at which 

time the user coordinates are calculated and displayed. 

The user can instruct the program to reject the point and 

not save the coordinates by pressing any cursor button 

4 JKDIGIT, A Program to Control a Digitizing Board 

other than "0". If the ,"0" button is pressed, the point 

is stored in the output file, and the program waits for 

the location and first ID digit of the next point to be digitized. The user can return to the main menu (for example 

to change the constant portion of the ID, to change the 

output fiJ.e, or to terminate the digitizing session) by pressing the "*" cursor button. 

Option 1, keyboard intput, operates in about the 

same manner as option 2. The location of the point being 

digitized is specified by pressing any cursor button other 

than"*", but only the location of the point is recorded. 

The variable part of the ID is entered via the keyboard 

and hence can include letters as well as numbers. Signals 

to end ID input and to accept or reject a point are also 

entered via the keyboard, and entering "*" on the 

keyboard causes a return to the main menu. This method 

allows for character ID values but usually requires two 

operators-one at the digitizing board and one at the 

keyboard. 

Option 3 specifies that only the constant part of the 

ID is to be recorded for each point, and the location is 

recorded without user verification of the calculated coordinates. This option is useful for digitizing lines by moving the cursor along the line in discrete steps and pressing any cursor button other than '' *'' to have the point 

digitized. Pressing the"*" button causes a return to the 

main menu. 

Option 4, cursor alphanumeric input, allows the 

same freedom of choice for ID characters as option 1, 

but the letters and numbers in the variable part of the ID 

are entered by placing the cursor on the appropriate symbol on a template placed anywhere on the digitizing board 

and pressing any cursor button other than "*" or "#". 

The required configuration for the cursor template is 

shown in figure 1. The size and shape of the template 

shown in figure 1 can be changed as long as the relative 

positions of the characters remain the same and the outside boundary of the template is a rectangle. A copy of 

this template can be placed in any position on the board 

not covered by the map being digitized; the location is 

registered using main menu option 5. If ID type option 

4 is selected, then option 5 (registration of the template) 

must be performed before digitizing can commence. 

Even in the stream digitizing mode (main menu 

option 14) an ID type selection must be made. This choice 

is necessary so that the user can specify the constant portion of the ID. 

4. Select Output File Name 

This option is used to specify the file to which the 

digitized locations are to be stored and to open that file 

for output. If an output file has previously been selected 

(and thus opened), it is closed. The user is instructed to 

enter the file name for the digitized data. This file name 

is checked to ensure that it contains no more than eight 
3 

0 1 2 3 4 5 6 7 8 9 

A B c D E F G H I J 

K L M N 0 p Q R s T 

u v w X y z - + # * 

2 

Figure 1. Template layout showing order for digitizing registration points. 

characters and has no file extension; the extension 

".DIG" is appended to the name automatically. If the 

file name is acceptable but a file with that name already 

exists, the user is given the choice of appending data to 

the existing file, overwriting the file, or trying another 

file name. After all checks have been satisfied, the file 

is opened for output, and the program returns to the main 

menu. If a null file name (a carriage return alone) is 

inserted, the program returns to the main menu with the 

file status the same as it was when this option was 

selected. 

5. Get Template Location Parameters 

If the selection of ID type (main menu option 3) 

is to insert the variable part of the ID via the cursor 

alphanumeric template, it is necessary to perform this 

option before proceeding to main menu options 6-14. The 

character template (fig. 1) must be fastened to the digitizing board, and the scaling menu discussed in section 2 

is presented on the CRT screen with the map scaling 

options (options 4, 5, and 6) disabled. The user can insert 

the menu scaling parameters via the keyboard (selection 

1), read the parameters from a previously saved file (selection 2), or digitize registration points and calculate the 

new parameter values (selection 3). If option value 2 is 

selected, the user is asked to insert the file name, and the 

program proceeds as described in section 2, except that 

the file must be a template-scaling parameter file instead 

of a coordinate-scaling parameter file. If the program 

finds that the specified file is not of the correct type, it 

closes the file and returns to the step of asking the user 

to insert a file name. 

If the cursor template has been moved since the 

previous use or has never been mounted on the digitizing board, the user must select option value 3. The user 

is instructed to digitize in order the lower left, lower right, 

and upper left corners of the cursor template as shown 

by the digits outside the rectangle in figure 1. Any cursor button other than"*" or"#" can be used to digitize 

these points. After the third registration point is digitized, 

the program calculates the parameter values and returns 

to the main menu. A faulty template registration would 

be indicated by erroneous letters or numbers appearing 

in the variable portion of the ID after the point digitizing started (main menu option 13), at which time the user 

could exit from digitizing mode and register the menu 

again. 

6. Select Roundoff Values 

Roundoff values are automatically set to 0.0000001 

for both horizontal and vertical user coordinates when 

the program is first executed, but if the coordinate type 

selection (main menu option 1) is for integer x-y Cartesian coordinates or raw board coordinates, these values 

have no effect. For the other coordinate type choices, the 

real user coordinates are rounded to the precision 

specified. If the user selects this main menu option, the 

program requests that a horizontal and a vertical roundoff value be inserted via the keyboard. The program then 

returns to the main menu, and the real user coordinates 

of all subsequently digitized points will use these roundoff values. If the user coordinate scaling parameters are 

saved in a file for later use, the roundoff values are stored 

in that same file, so that when the scaling parameters are 

read back from the file, the roundoff values are reset to 

what they had been when the parameters were saved. 

7. Validate Scaling 

The selections for scaling validation are: 

1) try another validation point 

2) scaling validation OK-return to main menu 

3) scaling validation failed-return to main menu. 

The user should select option value 1 as many times as 

necessary to ensure that the coordinate scaling parameters 

presently in effect cause the user coordinates to be 

calculate_d correctly for any point within the digitizing 

area. When option 1 is selected, the program requests that 

the user digitize a point with known user coordinates. The 

program then calculates the user coordinates and displays 

them on the CRT screen along with the three validation 

choices shown at the beginning of this section. The user 

can then select option 1 again or return to the main menu 

by selecting option 2 or 3. If the validation failed, the user 

can then return to main menu option 2 and get another 

set of scaling parameeters. 

8. Save Coordinate Scaling Parameters 

The user can save the coordinate scaling parameters 

in a file using this option. The file is an ASCII file and 

can thus be printed on a line printer for safekeeping. The 

user is instructed to insert a file name of eight characters 

or less with no file extension. The extension ".DIG" is 

appended to the name, and the program checks to see if 

a file with this name already exists. If no such file exists, 

the parameters are written to the file, and the program 

Program Description and User Guide 5 
returns to the main menu. If a file with this name already 

exists, the user can choose to append the parameters to 

the existing file, overwrite the file, or select another file 

name. A null file name (a carriage return alone) causes 

a return to the main menu. 

9. Save Template Scaling Parameters 

The operation of this option is the same as that for 

main menu option 8 except that the template scaling 

parameters are written to the specified file. 

10. Select Beep Option 

The IBM Personal Computer has the capability of 

sounding a short beep, and the digitizing program causes 

a beep to sound ~ach time a cursor button is pressed. This 

option allows the user to choose not to have the beep 

sound; or, if the beep has been turned off, to turn it on 

again. 

11. Select Printer Option 

If the computer configuration includes a printer, 

the user might want to obtain a hard copy of the digitized 

locations as the digitizing progresses. The default choice 

is not to have simultaneous printing, but the user can 

change from printing to non-printing or the reverse at 

any time using this option. If the user attempts to exercise the printer option for a configuration without a 

printer, or if the printer is not turned on, the program 

informs the user of printer troubles. 

12. Select Switch Stream Increment 

This option has no effect until the switch stream 

incremental mode (main menu option 14) of digitizing 

has been selected. When operating in switch stream 

incremental mode, the digitizing board causes a new point 

to be digitized when any cursor button is moved from 

the open position to the depressed position, or when the 

button is held down and the cursor is moved a set distance 

on the board. The distance, in inches of board movement, 

that the cursor must be moved to cause transmission of 

the next point is called the switch stream increment. The 

default value for this increment is 0.10 inches, but the 

user can set it to 0.005, 0.01, 0.10, 0.20, 0.30, or 0.315 

inches using option 12. 

13. Start Point Mode Digitizing 

Selection of this option starts the actual digitizing 

operation. A digitizer action table (fig. 2) showing the 

current state of the digitizing process and the operation 

control signals available to the operator is placed on the 

CRT screen. This table shows the user coordinates and 

ID presently being processed and displays the action the 

user can take to control the process. The signal to exit 

from this mode is always the transmission of a "*" to 

the computer via the keyboard, cursor button, or cursor 

alphanumeric template; however, not all three of these 

6 JKDIGIT, A Program to Control a Digitizing Board 

DIG MODE: ID MODE: 

ID CONST: NO PNTS: 

X: 

y: 

ID: 

GET NEW LOCATION HALT DIGITIZING 

crsr button kybd * 

crsr move crsr * 

tmp1 * 

NEXT ID CHARACTER END ID INPUT 

kybd (not CR) kybd CR 

crsr (not #,*) crsr # 

tm p 1 ( not # , * ) tmp1 # 

ACCEPT POINT REJECT POINT 

kybd y kybd N 

crsr 0 crsr (not 0,*) 

tmp1 0 tmp 1 (not 0, *) 

Figure 2. Layout of digitizer action table as it appears on CRT 

screen. Abbreviations: crsr, cursor entry; kybd, keyboard entry; 

tmpl, template entry. 

devices can be exercised at all times. The available 

methods for transmission of the "*" depend on the 

selected parameters, and the user is shown which methods 

are available by the appropriate selections being 

highlighted in the table. Exiting from this mode causes 

a return to the main menu. 

When the program is being executed using the interpreter, it is possible that points could be transmitted to 

the computer faster than they can be processed. An input 

buffer of 2K bytes is assigned when the program is loaded 

properly, but the buffer still might get full. The user is 

informed of a pending buffer overflow by the computer 

playing "The Volga Boatman" through its speaker. 

When this tune is played, the user should stop digitizing 

and wait until the computer plays "When the Saints Go 

Marching In,'' indicating that the buffer has been cleared. 

The problem of buffer overflow has never occurred with 

the compiled version of the program. 

14. Start Switch Stream Mode Digitizing 

In switch stream mode, new location information 

is digitized as discussed in section 12. Exit from this mode 

causes a return to the main menu. 

15. Quit 

The choice of the option causes the program to 

close all files and end the digitizing session. 
PROGRAM STRUCTURE 

The digitizing program consists of a main driver, 

JKDIGDRV, a loading program, JKMERGE, and 18 

subroutine modules. The loading program loads the 

driver and subroutines in order, deleting the comments 

of a subroutine as the next subroutine is being merged. 

In this way the program, although 102K bytes long with 

comments, can be executed within the 64K byte limitation of the BASIC interpreter. The loading program also 

deletes from itself the commands that load the 

subroutines so that if the merged program (without comments) is saved on a disk file, it can be loaded and 

executed without the delay of the merging procedure. 

Program listing and documentation is given in Appendix 1. Appendix 2lists a short n-;.acro program which uses 

the system COPY command to concatenate the 

subroutines, including comments, into a single file for 

listing the program. Documentation in the driver program 

includes the starting line number of each of the 

subroutines. 

Control of the subroutine calling sequence is 

accomplished in lines 285 through 320 of the driver program. These lines form a ''DO-WHILE'' loop that cycles 

through the main menu selections, allowing the user to 

exercise control only with the proper sequence of operations. The present status, which determines which of the 

main menu selections are available, is stored in an integer 

variable, STO!o. The actual specification of which main 

menu options can be selected is stored in a character 

array, ST$, indexed by STO!o. 

As is usual in BASIC programs, all variables are 

defined globally-a situation which causes complications 

when setting values for control parameters for 

subroutines called from many different places in the program. For this reason a software stack was implemented 

so that as control is passed to a subroutine, the control 

parameters are stored in an integer stack array variable, 

VSTKO!o. Input values of these parameters are placed into 

an array, PRMO!o, immediately before the subroutine is 

called. The number of parameters is stored in PRMO!o(O), 

and the values are stored in PRMO!o(1), PRMO!o(2), ... , 

PRMO!o (PRMO!o(O)). The first statement in the called 

subroutine places these values into VSTKO!o and updates 

the stack pointer, ISTKO!o. These values are available 

within the subroutine using a user-defined function, 

FNSTK O!o, defined by 

FNSTKO!o(I)=PRMO!o(l), for I= 1, 2, ... , PRMO!o(O). 

The parameter passing array, PRMO!o, can then be used 

to set parameter values for calling another subroutine 

before returning to the higher level program. 

SUBROUTINES 

Documentation within each subroutine specifies the 

purpose of the routine, the meaning of input variables 

and returned variables, and internal variable names used. 

This documentation is included in the program listing in 

Appendix 1. Appendix 2 contains a system macro program to concatenate the program modules into the form 

shown in Appendix 1 , and Appendices 3-6 contain cross 

reference information for programmers who want to 

modify the program. The .18 subroutines are discussed 

in the order in which they appear in the program listing. 

1. JKNUMINP, beginning line number 1000, sets 

the parameters used by subroutine JKNUMENU, which 

actually prints the menu and checks the numerical 

response. 

2. JKMNMENU, beginning line number 3000, 

sets parameters for the main menu. This subroutine is 

separate from JKNUMINP because the main menu is 

somewhat more complicated than the rest of the menus. 

3. JKNUMENU, beginning line number 5000, 

displays a menu with acceptable responses highlighted and 

checks to ensure that the response is within the allowable range of values. 

4. JKDIGUTL, beginning line number 7000, sets 

parameters for the menus and responses for the beep and 

printer options. 

5. JKYESNO, beginning line number 9000, 

displays a question and requires a Y(es) or N(o) response. 

6. JKVALSCL, beginning line number 11000, 

controls scaling validation. It 4isplays the validation 

menu and calls subroutines to accept a digitized location 

from the board, calculate the user coordinates, and 

receive the user's response. 

7. JKGETRND, beginning line number 13000, 

controls input of the roundoff factors. 

8. JKFILPRM, beginning line number 15000, 

controls the input and output of both coordinate- and 

template-scaling parameters. 

9. JKDIGFIL, beginning line number 17000, is 

used whenever a file name must be entered. It checks that 

the name is acceptable to the operating system, appends 

the extension ".DIG", and checks whether a file with that 

name already exists. If the file is to be used for output 

and a file with that name exists, the user can choose to 

append data to the file, overwrite the file, or try another 

file name. If the file is to be used as input but no file 

with that name exists, the user must try another file name. 

If no such file exists, the user is informed that a new file 

name must be chosen for input. Unless the file name 

entered is a null file name (a carriage return alone), the 

file is opened in this subroutine. 

Subroutines 7 
10. JKDIGDBL, beginning line number 19000, 

causes board coordinates to be accepted from the digitizing board and calculates the user coordinates using the 

appropriate scaling matrix. If coordinate scaling is 

specified, the returned values are in the form selected from 

the main menu option 1. For template scaling, the returned values are x-y coordinates between 0 and 1 

representing the relative location of the cursor within the 

template rectangle. Internal subroutines perform roundoff and ensure that the coordinates will not be printed 

in exponential format by the BASIC interpreter. 

11. JKDIGBRD, beginning line number 21000, is 

the interface to the digitizing board. It returns raw board 

coordinates and a single character value representing the 

cursor button pressed. The only other program lines concerned with the digitizer board interface directly are line 

24460 and lines 23200 through 23210 of JKGETPNT and 

lines 25750 through 25760 of JKINTVAR. The subroutine 

expects two numbers and a single character, separated by 

commas, to be sent from the board in ASCII form. 

12. JKGETPNT, beginning line number 23000, is 

the main control routine for the actual digitizing process 

for both point and switch stream incremental modes. 

When main menu options 13 or 14 are selected, control 

is transferred to this subroutine, returning to the driver 

program only upon receipt of a "*" cursor control signal 

from the digitizer board. An internal subroutine draws 

the digitizer action table and is probably the most 

machine-specific part of the digitizing program. 

13. JKINTVAR, beginning line number 25000, 

initializes values of the variables, including the main menu 

option displays, but arrays are dimensioned and user 

8 JKDIGIT, A Program to Control a Digitizing Board 

functions are defined in the driver program to satisfy 

BASIC compiler requirements. In this subroutine the 

signal requesting a two-second beep from the digitizing 

board is sent. Program lines 25750 and 25760 use the 

specific digitizer control codes. 

14. JKSCLCTL, beginning line number 27000, 

controls the scaling for both coordinate and template 

scaling. 

15. JKREGRES, beginning line number 28000, 

performs least squares regression to calculate the scaling 

matrices for both coordinate and template scaling. 

16. JKSCLCRD, beginning line number 29000, 

acquires both the board and user coordinate values used 

to calculate the scaling matrix. 

17. JKSCLKEY, beginning line number 31000, 

receives the scaling parameters when the keyboard input 

option is selected. 

18. JKSTACK, beginning line number 35000, controls the software stack. 

CONCLUSION 

This program was designed to provide geologists 

with an easily transportable program to control a digitizing board using a microcomputer. The BASIC programming language was selected because most microcomputers 

can execute programs in BASIC. Care was taken to include 

complete documentation and make the program easy for 

a nonprogrammer to use, and modular design techniques 

were used to make the program relatively easy for a programmer to understand. 
APPENDIXES 1-6 
Appendix 1. Commented listing of all modules in JKDIGIT.BAS 

1 REM ************************************************* 

3 REM &&& PROGRAM JKMERGE *** 

5 REM *** LOADS DIGITIZING PROGRAM DRIVER AND SUBROUTINES, DELETING *** 

7 REM*** COMMENTS IN PREVIOUSLY MERGED SUBROUTINES AS LATER ROUTINES *** 

9 REM *** ARE BEING MERGED *** 

11 REM *********************************************************************** 

13 REM*** DATED: AUGUST 16, 1983 *** 

15 REM *********************************************************************** 

17 KEY OFF:WIDTH 40:FOR I%=1 TO S:PRINT:NEXT I% 

19 PRINT 11 DIGITIZING PROGRAM11 

21 PRINT 11 FOR CARTESIAN OR GEODETIC COORDINATES" 

23 PRINT:PRINT II BY 11 

25 PRINT:PRINT II JOHN 0. KORK 11 

27 PRINT 11 U.S. GEOLOGICAL SURVEY 11 

29 PRINT II P.O. BOX 25046, DFC, MS 937 11 

31 PRINT 11 DENVER, COLORADO 80225" 

33 PRINT "--------------------------------------- 11 

35 PRINT "DELETING COMMENTS BEFORE INITIALIZ.ATION11 

37 PRINT 11 PLEASE WAIT FOR A COUNT OF 21. 11: I%=1 

39 GOSUB 87: CHAIN MERGE "JKDIGDRV 11 ,41 ,ALL 

41 GOSUB 87:CHAIN MERGE "JKNUMINP 11 ,43,ALL,DELETE 110-375 

43 GOSUB 87:CHAIN MERGE "JKMNMENU 11 ,45,ALL,DELETE 1010-1210 

45 GOSUB 87:CHAIN MERGE 11 JKNUMENU 11 ,47 ,ALL,DELETE 3020-3380 

47 GOSUB 87:CHAIN MERGE 11 JKDIGUTL 11 ,49,ALL,DELETE 5020-5260 

49 GOSUB 87: CHAIN MERGE 11 JK YESN0 11 ,51 ,ALL ,DELETE 7020-7220 

51 GOSUB 87:CHAIN MERGE 11 JKVALSCL 11 ,53,ALL,OELETE 9020-9130 

53 GO SUB 87: CHAIN MERGE 11 JKGETRND" ,55 ,ALL ,DELETE 11020-11270 

55 GOSUB 87:CHAIN MERGE "JKFILPRM",57,ALL,DELETE 13020-13040 

57 GOSUB 87:CHAIN MERGE 11JKDIGFIL 11 ,59,ALL,DELETE 15020-15440 

59 GOSUB 87:CHAIN MERGE 11 JKDIGDBL 11 ,61,ALL,OELETE 17020-17370 

61 GOSUB 87: CHAIN MERGE 11 JKOIGBRD" ,63 ,ALL ,DELETE 19020-19630 

63 GOSUB 87:CHAIN MERGE "JKGETPNT11 ,65,ALL,OELETE 21020-21080 

65 GOSUB 87:CHAIN MERGE "JKINTVAR" ,67 ,ALL,DELETE 23010-23285 

67 GOSUB 87:CHAIN MERGE "JKSCLCTL 11 ,69,ALL,DELETE 25020-25440 

69 GOSUB 87 :CHAIN MERGE "JKREGRES" ,71 ,ALL ,DELETE 27010-27255 

71 GOSUB 87:CHAIN MERGE "JKSCLCRD",73,ALL,OELETE 28020-28260 

73 GOSUB 87:CHAIN MERGE "JKSCLKEY" ,75,ALL,DELETE 29020-29450 

75 GOSUB 87:CHAIN MERGE "JKSTACK",77,ALL,OELETE 31020-31260 

77 GOSUB 87:CHAIN MERGE "NUL",79,ALL,DELETE 35020-35150 

79 GOSUB 87:CHAIN MERGE 11 NUL 11 ,81 ,ALL,DELETE 24005-24080 

81 \HDTH 80 

82 PRINT "MERGE COMPLETE - SUGGEST SAVING MERGED PROGRAM FOR FURTHER USE" 

83 CHAIN MERGE 11 NUL" ,85,ALL,DELETE 1-15 

85 CHAIN MERGE "NUL" ,89 ,ALL,DELETE 35-87 

10 JKDIGIT, A Program to Control a Digitizing Board 
Appendix 1. Commented listing of all modules in JKDIGIT.BAS-Continued 

87 LOCATE 19 '1: PRINT 11 ***** II; I%; II *****II; :I%= I%+ 1: RETURN 

89 PRINT:PRINT 11 PRESS ANY KEY TO START PROGRAM11 

91 A$=INKEY$:IF A$= 1111 GOTO 91 

100 REM ******************************************************************* 

105 REM &&& PROGRAM JKDIGDRV *** 

110 REM *** DRIVER FOR DIGITIZER PROGRAM *** 

115 REM ******************************************************************* 

120 REM *** DATED: AUGUST 10, 1983 *** 

85 CHAIN ~~ERGE 11 NUL II ,89 ,ALL ,DELETE 35-87 

85 CHAIN MERGE 11 NUL 11 ,89,ALL,DELETE 35-87 

110 REM *** DRIVER FOR DIGITIZER PROGRAM *** 

115 REM ******************************************************************* 

120 REM*** DATED: AUGUST 10, 1983 *** 

125 REM ******************************************************************* 

130 REM *** PROGRAMMED BY: *** 

135 REM *** JOHN 0. KORK *** 

140 REM*** BRANCH OF RESOURCE ANALYSIS *** 

145 REM *** U. S. GEOLOG !CAL SURVEY *** 

150 REM *** MAIL STOP 937, DENVER FEDERAL CENTER *** 

155 REM *** DENVER, CO 80225 *** 

160 REM ******************************************************************* 

165 REM*** VARIABLE LIST *** 

170 REM*** I%,J% LOOP INDICES *** 

175 REM *** FLMOD% FILE OPENING MODE *** 

180 REM*** IRET%,IRET1% : RETURNED VALUES FROM SUBROUTINES *** 

185 REM *** MSG$(*) ARRAY FOR MESSAGES *** 

190 REM*** PRM1$,PRM2$ : VARIABLES FOR PASSING CHARACTER *** 

195 REM *** PARAMETERS TO SUBROUTINES *** 

200 REM *** IDCHR$ CONSTANT PORTION OF PRESENT ID *** 

205 REM *** SEE SUBROUTINE JKINTVAR FOR *** 

210 REM*** BPON,CLD%(),CLO%{),CLR%{) ,OAT${) ,DATX%{) ,DATY%(),FALSE,*** 

215 REM*** INCR$(),INCR%(),INCS${),LPON,M1${),MDF%{),MKR${), *** 

220 REM*** MSEL%() ,RNUM%() ,ST$() ,ST%,TRUE *** 

225 REM *** SEE SUBROUTINE JKSCLCTL FOR *** 

230 REM*** A#() ,AX#(),CDEG%() ,CX#{) ,CY#(),MFIL$,SFIL$,TX#{) ,TY#(),*** 

235 REM*** XBOFF,XROUND#,XUOFF#,YBOFF,YROUND#,YUOFF# *** 

240 REM *** SEE SUBROUTINE JKSTACK FOR *** 

245 REM*** FNRET%(),FNSTK%(),ISTK%,NTSK%,PRMt(),VSTK% *** 

250 REM *** SEE SUBROUTINE JKGETPNT FOR *** 

255 REM*** LA(),LO(),NPTS%,0FIL$ *** 

260 REM *** SEE SUBROUTINE JKNUMENU FOR *** 

265 REM*** M${),MSGB$(),MSGT$() *** 

270 REM *** SEE SUBROUTINE JKREGRES FOR P%() *** 

275 GOTO 380 

280 REM *** SUBROUTINES CALLED *** 

285 GOTO 780 • subroutine j knumi np *** 

290 GOTO 3000 •subroutine jkmnmenu *** 

Appendixes 11 
Appendix 1. Commented listing of all modules in JKDIGIT.BAS-Continued 

295 GOTO 5000 'subroutine jknumenu *** 

300 GOTO 7000 • subroutine j kdi gutl *** 

305 GOTO 9000 'subroutine jkyesno *** 

310 GOTO 11000 'subroutine jkvalscl *** 

315 GOTO 13000 'subroutine jkgetrnd *** 

320 GOTO 15000 'subroutine jkfilprm *** 

325 GOTO 17000 'subroutine jkdigfil *** 

330 GOTO 19000 'subroutine jkdigdbl *** 

335 GOTO 21000 'subroutine jkdigbrd *** 

340 GOTO 23000 'subroutine jkgetpnt *** 

345 GOTO 25000 'subroutine jkintvar *** 

350 GOTO 27000 'subroutine jksclctl *** 

355 GOTO 28000 'subroutine jkregres *** 

360 GOTO 29000 'subroutine jksclcrd *** 

365 GOTO 31000 'subroutine jksclkey *** 

370 GOTO 35000 'subroutine jkstack *** 

375 REM ******************************************************************* 

380 CLS:WIDTH 80:PRINT "INITIALIZING- - WAIT" 

385 DIM M1$(15),M$(15),MSEL%(14),MDF%(14),MKR$(14,6),A#(11,11),AX#(25,11) 

390 DIM CX#(9,1),CY#(9,1),TX#(25) ,TY#(25),MSG$(10),MSGT$(10),MSGB$(10) 

395 DIM RNUM%(3),LA(25,3),L0(25,3),XBOFF(1) ,YBOFF{1),XUOFF#{1),YUOFF#{1) 

400 DIM VSTK%{20),INCS$(8) ,INCR$(8),CDEG%(2),P%(11),PRM%(10) 

405 DIM DAT$(3,2,3),CLR%(3,2,3),DATX%(3,2,3),DATY%(3,2,3) 

410 DIM CLD%{3,2,3),CL0%{3,2,3),ST$(6) 

415 DEF FNSTK%(I%)=VSTK%(ISTK%-VSTK%(ISTK%)+I%-1) 

420 DEF FNRET%(I%)=ISTK%-VSTK%{ISTK%)+I%-1 

425 GOSUB 25000 

430 IF IRET%=3 THEN PRINT "ABNORMAL TERMINATION":GOTO 875 

435 WHILE TRUE 

440 ST%=1 

445 IF MSEL%(1) < MDF%(1) THEN ST%=2 

450 IF ST% = 2 AND MSEL%{2)<MDF%{2) THEN ST%=3 

• gosub jkintvar 

455 IF ST%=3 AND MSEL%(3)<MDF%(3) AND MSEL%{4)<MDF%(4) THEN ST%=4 

460 IF ST%=4 AND {MSEL%{3) <> 4 OR CDEG%(0)<>0) THEN ST%=5 

465 GOSUB 3000 'gosub jkmnmenu 

470 ON IRET% GOSUB 480,525,565,590,615,645,660,675,690,705,725,745,760,780,815 

475 WEND 

480 'get coordinate type selection 

485 PR~h{0)=1:PRM%{1)=MSEL%(1):GOSUB 35000 

490 PRM%{0)=1:PRM%{1)=1:GOSUB 1000 

495 IF IRET%=6 GOTO 520 

500 MSEL%(1)=IRET%:I%=FNSTK%(1):J%=IRET% 

505 IF I%<=2 AND J%<=2 GOTO 520 

510 IF {I%=3 OR I%=4) AND (J%=3 OR J%=4) GOTO 520 

515 MSEL%(2)=MDF%(2):MSEL%(7)=MDF%(7):SFIL$="":MSEL%(8)=MDF%(8) 

520 NSTK%=NSTK%-1:ISTK%=FNSTK%(0):RETURN 

525 'get coordinate scaling parameters 

12 JKDIGIT, A Program to Control a Digitizing Board 

'gosub jkstack 

• gosub j knumi np 
Appendix 1. Commented listing of all modules in JKDIGIT.BAS-Continued 

530 PRM%(0)=1:PRM%(1)=MSEL%(1):GOSUB 27000 'gosub jksclctl 

535 IF IRET%=5 THEN RETURN 

540 MSEL%(7)=MDF%(7):IF IRET% <= 2 GOTO 555 

545 MSEL%( 2) =MDF%( 2): IF IRET%=3 THEN RETURN 

550 XROUND#=O:YROUND#=O:MSEL%(6)=MDF%(6) :SFIL$="":MSEL%(8)=MDF%(8) :RETURN 

555 MSEL%(2)=1:IF IRET%=1 THEN SFIL$="":MSEL%(8)=MDF%(B):RETURN 

560 MSEL%(6)=1:MSEL%(8)=1:RETURN 

565 'get ID type choice 

570 PRM%(0)=1:PRM%(1)=3:GOSUB 1000:MSEL%(3)=IRET% 'gosub jknuminp 

575 CLS:PRINT:PRINT "THE ID CAN HAVE CONSTANT CHARACTERS AT THE BEGINNING." 

580 PRINT:PRINT "INSERT CONSTANT CHARACTERS (OR JUST CR TO RETURN): "; 

585 INPUT IDCHR$:RETURN 

590 'get output file name and open 

595 PRM%(0)=2:PRM%(1)=1:PRM%(2)=2:PRM1$="0UTPUT FILE NAME" 

600 GOSUB 17000 'gosub jkdigfil 

605 IF IRET%=1 THEN NPTS%=0 

610 MSEL%(4)=IRET%:0FIL$=PRM2$:FLMOD%=IRET1%:RETURN 

615 'get template location parameters 

620 PRM%(0)=1:PRM%(1)=0:GOSUB 27000 'gosub jksclctl 

625 IF IRET%=5 THEN RETURN 

630 IF IRET%=1 THEN MSEL%(5)=1 :MFIL$="":MSEL%(9)=MDF%(9) :RETURN 

635 IF IRET%=2 THEN MSEL%(5)=1:MSEL%(9)=1:MFIL$=PRM2$:RETURN 

640 MSEL%(5)=MDF%(5):CDEG%(0)=0:RETURN 

645 'get roundoff parameters 650 GOSUB 13000 'gosub jkgetrnd 

655 MSEL%(6)=1:RETURN 

660 'validate coordinate scaling parameters 665 PRM%(0)=1:PRM%(1)=MSEL%(1) :GOSUB 11000 'gosub jkvalscl 

670 MSEL%(7)=IRET%:RETURN 

675 'save coordinate scaling parameters in file 

680 PRM%(0)=3:PRM%(1)=1:PR~~(2)=2:PRM%(3)=MSEL%(1):GOSUB 15000 'gosub jkfilprm 

685 SFIL$=PRM2$:MSEL%(8)=IRET%:RETURN 

690 'save menu placement parameters in file 

695 PRM%(0)=3:PRM%(1)=1:PRM%(2)=1:PRM%(3)=MSEL%(1) :GOSUB 15000 'gosub jkfilprm 

700 MFIL$=PRM2$:MSEL%(9)=IRET%:RETURN 

705 'select beep option 710 BPON=FALSE:PRM%(0)=1:PRM%(1)=1:GOSUB 7000 'gosub jkdigutl 

715 MSEL%(10)=IRET%:IF IRET%=2 THEN BPON = TRUE 

720 RETURN 

725 'select line printer option 730 LPON=FALSE:PRM%(0)=1:PR~~(1)=2:GOSUB 7000 'gosub jkdigutl 

735 MSEL%(11)=IRET%:IF IRET%=1 THEN LPON = TRUE 

740 RETURN 

745 'select switch stream increment value 

750 PRM%(0)=1:PRM%{1)=8:GOSUB 1000 'gosub jknuminp 

755 INCR%=IRET%:MSEL%(12)=1:RETURN 

760 'start digitizing in point mode 

Appendixes 13 
Appendix 1. Commented listing of all modules in JKDIGIT.BAS-Continued 

765 PRM%(0)=3:PRM%(1)=MSEL%(1):PRM%(2)=MSEL%(3):PRM%(3)=2 

770 GOSUB 23000 'gosub jkgetpnt 775 MSEL%(13)=1:MSEL%(14)=MDF%(14):RETURN 

780 'start digitizing in switch stream mode 

785 PRM%(0)=3:PRM%(1)=MSEL%(1):PRM%(2)=MSEL%(3):PRM%(3)=1:PRM1$=INCS$(INCR%) 

790 GOSUB 23000 'gosub jsgetpnt 795 MSEL%(14)=1:MSEL%(13)=MDF%(13):RETURN 

800 LPON=FALSE:PRM%(0)=1:PRM%(1)=2:GOSUB 7000 'gosub jkdigutl, printer option 

805 MSEL%(11)=IRET%:IF IRET%=1 THEN LPON=TRUE 

810 RETURN 

815 'terminate digitizing program 

820 CLS:PRINT "DIGITIZING PROGRAM TERMINATION 11 

825 PRINT:IF MSEL%(4)=1 THEN PRINT "LAST OUTPUT FILE WAS ";OFIL$ 

830 IF LEN(SFIL$) > 0 THEN PRINT "SCALE PARAMETERS SAVED IN ";SFIL$ 

835 IF LEN(MFIL$) > 0 THEN PRINT "TEMPLATE PARAMETERS SAVED IN ";MFIL$ 

840 PRINT:PRINT "NUMBER OF NEW POINTS IN OUTPUT FILE: ";NPTS% 

845 IF NOT LPON GOTO 870 

850 IF MSEL%(4)=1 THEN LPRINT:LPRINT "LAST OUTPUT FILE \~AS ";OFIL$ 

855 IF LEN(SFIL$)>0 THEN LPRINT "SCALE PARAMETERS SAVED IN ";SFIL$ 

860 IF LEN04FIL$)>0 THEN LPRINT "TEMPLATE PARAMETERS SAVED IN ";MFIL$ 

865 LPRINT "NUMBER OF NEW POINTS IN OUTPUT FILE: ";NPTS% 

870 CLOSE 

875 END 

1000 REM ********************************************************************** 

1005 REM &&& SUBROUTINE JKNUMINP *** 

1010 REM *** FOR GETTING NUMERICAL KEYBOARD INPUT FROM MENU CHOICES *** 

1015 REM *** FOR DIGITIZER PROGRAMS *** 

1020 REM ********************************************************************** 

1025 REM*** DATED: AUGUST 8, 1983 *** 

1030 REM ********************************************************************** 

1035 REM *** INPUT VARIABLES *** 

1040 REM *** PRM%(0) NUMBER OF OTHER PARAMETERS *** 

1045 REM*** PRM%(1) SPECIFIES WHICH MENU TO PRINT *** 

1050 REM*** 1) COORDINATE TYPE SELECTION (1<=IRET%<=6) *** 

1055 REM*** 2) SCALING PARAMETER INPUT TYPE (1<=IRET%<=7) *** 

1060 REM*** 3) ID INPUT METHOD (1<=IRET%<=5) *** 

1065 REM*** 4) SCALING VALIDATION CHOICE (1<=IRET%<=3) *** 

1070 REM*** 5) FILE OPENING DECISION (1<=IRET%<=4) *** 

1075 REM*** 6) DIGITIZER INITIALIZATION CHECK (1<=IRET%<=3) *** 

1080 REM*** 7) DEGREE FOR REGRESSION SCALING (1<=IRET%<=4) *** 

1085 REM*** 8) STREAM MODE DIGITIZING CHOICE (1<=IRET%<=8) *** 

1090 REM *** !NCR$(*) ARRAY OF STREAM DIGITIZING INCREMENTS *** 

1095 REM *** MSK$ MASK SPECIFYING HIGHLIGHTING OF OPTIONS *** 

1100 REM *** MSGT$(*) ARRAY OF TOP LINES ON MENU *** 

1105 REM *** MSGT% NUMBER OF TOP LINES IN MENU *** 

1110 REM *** PRM2$ FILE NAME FOR 1/0 MENU *** 

1115 REM *** RETURNED VARIABLES *** 

14 JKDIGIT, A Program to Control a Digitizing Board 
Appendix 1. Commented listing of all modules in JKDIGIT.BAS-Continued 

1120 REM *** !RET% RETURNED INTEGER FROM KEYBOARD INPUT *** 

1125 REM *** OTHER VARIABLES AND FUNCTIONS *** 

1130 REM *** BAS$ DESCRIPTION OF MENU CHOICE TYPE *** 

1135 REM*** FNRET%() STACK RESETTING FUNCTION *** 

1140 REM*** FNSTK%() FUNCTION RETURNS INPUT PARAMETER VALUE *** 

1145 REM *** HIGH COLOR VALUE FOR HIGHLIGHTING *** 

1150 REM *** I% INDEX VARIABLE *** 

1155 REM *** ISTK% STACK POINTER *** 

1160 REM *** LOW COLOR VALUE FOR NON-HIGHLIGHTED OPTIONS *** 

1165 REM*** M$(*) ARRAY OF MENU CHOICES *** 

1170 REM *** MAX% LARGEST ALLOWABLE RETURN VALUE *** 

1175 REM *** MSGB% NUMBER OF LOWER BASE LINES ON MENU *** 

1180 REM *** NSTK% STACK LEVEL *** 

1185 REM *** TOP$ LINES TO BE PRINTED ABOVE MENU *** 

1190 REM *** SUBROUTINES CALLED *** 

1195 GOTO 1215 

1200 GOTO 5000 •subroutine jknumenu *** 

1205 GOTO 35000 •subroutine jkstack *** 

1210 REM ********************************************************************** 

1215 IF PRM%(0) <> 1 THEN PRINT 11 FATAL PARAMETER ERROR11 :STOP 

1220 GOSUB 35000 •gosub jkstack 

1225 WIDTH 80:MSGB%=0:HIGH=15:LOW=7 

1230 ON FNSTK%(1) GOTO 1245,1300,1360,1405,1445,1495,1545,1590 

1235 PRINT "PROGRAMING ERROR, NO MENU FOR PRM1% = ";FNSTK%(1) :IRET%=0:GOTO 1620 

1240 •menu for coordinate type selection************************************* 

1245 MAX%=6:MSK$="111111 11 :MSGT%=0 

1250 M$( 1)="REAL X-Y SCALED CARTESIAN COORDINATES" 

1255 M$(2)="INTEGER X-Y SCALED CARTESIAN COORDINATES .. 1260 M$(3)="LATITUDE AND LONGITUDE IN DECIMAL DEGREES .. 1265 M$(4)="LATITUDE AND LONGITUDE IN DEG, MIN AND SEC (REAL) 11 

1270 M$( 5)="INTEGER BOARD COORDINATES IN .001 IN. UNITS11 

1275 M$(6)="RETURN TO MAIN MENU" 

1280 TOP$="COORDINATE TYPE SELECTION MENU" 

1285 BAS$= 11 a highlighted coordinate type" 

1290 GOSUB 5000:GOTO 1620 'gosub jknumenu 

1295 'menu for scaling parameter inpu~**************************************** 

1300 MAX%=7:MSGT%=0 

1305 M$(1)="ENTER PARAMETERS FR0~1 KEYBOARD 11 

1310 M$(2)="READ PARAMETERS FROM A PREVIOUSLY SAVED FILE" 

1315 M$(3)="DIGITIZE CONTROL POINTS AND CALCULATE NEW PARAMETERS" 

1320 M$(4)="REGISTER 7.5 MIN QUAD 11 

1325 M$(5)="REGISTER 15 MIN QUAD" 

1330 M$(6)="REGISTER 2 DEG SHEET11 

1335 M$(7)="RETURN TO MAIN MENU 11 

1340 TOP$= 11SCALING SELECTION MENU 11 

1345 BAS$="a scaling option" 1350 GOSUB 5000:GOTO 1620 'gosub jknumenu 

Appendixes 15 
Appendix 1. Commented listing of all modules in JKDIGIT.BAS-Continued 

1355 •menu for id input method************************************************* 

1360 MAX%=5:MSK$= 11 11111 11 :MSGT%=0 

1365 M$(1)= 11KEYBOARD INPUT11 

1370 M$(2)= 11 CURSOR BUTTON INPUT11 

1375 M$(3)= 11CONSTANT ID - 1 PUSH PER POINT11 

1380 M$ ( 4) = 11CURSOR ALPHANUMERIC I NPUT 11 

1385 M$( 5)= 11 RETURN TO MAIN MENU 11 

1390 TOP$= 11 MENU FOR ID INPUT METHOD 11 

1395 BAS$= 11 an ID input option .. 1400 GOSUB 5000:GOTO 1620 •gosub jknumenu 

1405 •menu for scaling validation********************************************** 

1410 MAX%=3:MSK$= 11 111 11 

1415 M$( 1) = 11TRY ANOTHER VAL I DATION POI NT? II 

1420 M$(2)= 11 SCALING VALIDATION OK- RETURN TO MAIN MENU 11 

1425 M$(3)= 11 SCALING VALIDATION FAILED - RETURN TO MAIN MENU 11 

1430 TOP$= 11 SCALING VALIDATION MENU 11 

1435 BAS$= 11 a scaling validation option .. 1440 GOSUB 5000:GOTO 1620 •gosub jknumenu 

1445 •menu for file opening choice********************************************* 

1450 MAX%=4:MSK$= 11 111111 :MSGT%=1 

1455 MSGT$(1)= 11 FILE 11+PRM2$+ 11 ALREADY EXISTS. 11 

1460 M$(1)= 11CHOOSE A DIFFERENT FILE NAME 11 

1465 M$(2)= 11 APPEND OUTPUT TO THIS FILE 11 

1470 M$(3)= 11 0VERWRITE THIS FILE11 

1475 M$(4)= 11 RETURN TO MAIN MENU 11 

1480 TOP$= 11 FILE EXISTENCE MENU 11 

1485 BAS$= .. a fi 1 e overwrite/ append opti on 11 

1490 GOSUB 5000:GOTO 1620 •gosub jknumenu 

1495 •menu for digitizer opening check***************************************** 

1500 MAX%=3:MSK$= 11 11111 :MSGT%=2 

1505 MSGT$(1)= 11The digitizer horn should have just give a 2 second beep ... 1510 MSGT$(2)= 11 If it did not beep there is trouble with the connection ... 1515 M$(1)= 11 DIGITIZER BEEPED - CONTINUE 11 

1520 M$(2)= 11 NO BEEP - TROUBLE CORRECTED - TRY AGAIN 11 

1525 M$(3)= 11 NO BEEP - EXIT FROM DIGITIZER PROGRAM .. 1530 TOP$= 11DIGITIZER CONNECTION CHECK MENU 11 

1535 BAS$= 11 the desired action11 

1540 GOSUB 5000:GOTO 1620 •gosub jknumenu 1545 •menu for geographic coordinate scaling regression degree***************** 

1550 MAX%=4:MSK$= 11 1111 11 :MSGT%=0 

1555 M$(1)= 11LINEAR- 3 or more points 11 

1560 M$(2)= 11QUADRATIC - 6 or more points .. 1565 M$(3)= 11 CUBIC - 10 or more points .. 1570 M$(4)= 11 RETURN TO MAIN MENU 11 

1575 TOP$= 11 GEOGRAPHIC SCALING REGRESSION MODEL MENU 11 

1580 BAS$= 11 the degree of the regression model .. 1585 GOSUB 5000:GOTO 1620 •gosub jknumenu 

16 JKDIGIT, A Program to Control a Digitizing Board 
Appendix 1. Commented listing of all modules in JKDIGIT.BAS-Continued 

1590 'menu for selection of increment for stream digitizing******************** 1595 MAX%=8:MSK$= 11 11111111 11 :MSGT%=0 

1600 FOR I%=1 TO 8:M$(I%)=INCR$(I%) :NEXT I% 

1605 TOP$= 11 STREAM INCREMENT SELECTION MENU 11 

1610 BAS$= .. an increment 11 

1615 GOSUB 5000:GOTO 1620 'gosub jknumenu 

1620 NSTK%=NSTK%-1:ISTK%=FNRET%(0):RETURN 

3000 REM ********************************************************************** 

3010 REM &&& SUBROUTINE JKMNMENU *** 

3020 REM*** CONSTRUCTS MAIN MENU *** 

3030 REM ********************************************************************** 

3040 REM*** DATED: AUGUST 8, 1983 *** 

3050 REM ********************************************************************** 

3060 REM *** INPUT VARIABLES *** 

3070 REM *** CDEG%(*) ARRAY OF REGRESSION MODEL DEGREES *** 

3080 REM *** IDCHR$ CONSTANT PORTION OF PRESENT ID *** 

3090 REM *** !NCR$(*) ARRAY OF STREAM INCREMENT CHOICES FOR MENU *** 

3100 REM *** INCR% PRESENT STREAM INCREMENT CHOICE *** 

3110 REM*** M1$(*) ARRAY OF MAIN MENU CHOICES *** 

3120 REM *** M1% NUMBER OF MAIN MENU OPTIONS *** 

3130 REM *** MFIL$ ID MENU SCALING PARAMETER SAVE FILE NAME *** 

3140 REM *** MKR$(*) ARRAY OF PRESENT CHOICE SYMBOLS FOR MENU *** 

3150 REM*** MSEL%{*) PRESENT MAIN MENU SELECTIONS *** 

3160 REM *** OFIL$ PRESENT OUTPUT FILE NAME *** 

3170 REM*** SFIL$ COORDINATE SCALING PARAMETER SAVE FILE NAME *** 

3180 REM *** ST$(*) ARRAY OF PRESENT STATUS MASKS *** 

3190 REM *** ST% PRESENT STATUS INDEX *** 

3200 REM *** XROUND# PRESENT X-ROUNDOFF VALUE *** 

3210 REM *** YROUND# PRESENT Y-ROUNDOFF VALUE *** 

3220 REM *** OUTPUT VARIABLE *** 

3230 REM *** IRET% KEYBOARD CHOICE *** 

3240 REM *** OTHER VARIABLES *** 

3250 REM *** BAS$ DESCRIPTION OF MENU CHOICE TYPE *** 

3260 REM *** HIGH COLOR VALUE FOR HIGHLIGHTING *** 

3270 REM *** I% INDEX VARIABLE *** 

3280 REM *** LOW COLOR VALUE FOR NON-HIGHLIGHTED OPTIONS *** 

3290 REM *** M${*) ARRAY OF MENU CHOICES SENT TO JKNUMENU *** 

3300 REM *** MAX% MAXIMUM ALLOWABLE MENU CHOICE *** 

3310 REM *** MSGB% NUMBER OF BASE LINES IN MENU *** 

3320 REM *** MSGT% NUMBER OF TOP LINES IN MENU *** 

3330 REM *** MSK$ MASK VARIABLE FOR HIGHLIGHTING *** 

3340 REM *** TOP$ LINE TO BE PRINTED AT TOP OF MENU *** 

3350 REM *** SUBROUTINES CALLED *** 

3360 GOTO 3390 

3370 GOTO 5000 'subroutine jknumenu *** 

3380 REM ********************************************************************** 

3390 FOR I%=1 TO M1%-1 

Appendixes 17 
Appendix 1. Commented listing of all modules in JKDIG1T.BAS-Continued 

3400 M$( I%)=M1$( I%)+" ["+MKR$( I%,MSEL%( I%)) 

3410 IF I%=3 AND IDCHR$<> ""THEN M$(I%)=M$(I%)+"- INITIAL: 11+IDCHR$ 

3420 IF I%=4 AND MSEL%(I%)=1 THEN M$(I%)=M$(I%)+0FIL$ 

3430 IF I%=6 THEN M$(I%)=M$(I%)+ 11 - 11+STR$(XROUND#)+ 11 , 11+STR$(YROUND#) 

3440 IF I%=8 AND MSEL%(I%)=1 THEN M$(I%)=M$(I%)+SFIL$ 

3450 IF I%=9 AND MSEL%(I%)=1 THEN M$(I%)=M$(I%)+MFIL$ 

3460 IF I%=12 THEN M$( I%)=M$( I%)+" "+INCR$( INCR%) 3470 M$(I%)=M$(I%)+"] 11 

3480 NEXT I% 

3490 M$(M1%)=M1$(I%) 

3500 MAX%=M1%:MSK$=ST$(ST%):MSGT%=0:MSGB%=0 

3510 IF CDEG%(0) <> 0 THEN MID$(MSK$,9,1)="1 11 ELSE MID$(MSK$,9,1)="0" 

3520 TOP$="MAIN MENU":BAS$= 11 a highlighted option11 

3530 HIGH=15:LOW=7:GOSUB 5000 'gosub jknumenu to get menu selection*** 

3540 RETURN 

5000 REM ******************************************************************** 

5010 REM &&& SUBROUTINE JKNUMENU.BAS *** 

5020 REM *** PRINTS MENU AND CHECKS FOR PROPER NUMERICAL INPUT *** 

5030 ·REM ******************************************************************** 

5040 REM *** DATED: AUGUST 8, 1983 *** 

5050 REM ******************************************************************** 

5060 REM *** INPUT VARIABLES *** 

5070 REM *** BAS$ MENU CHOICE TYPE *** 

5080 REM *** HIGH COLOR VALUE FOR HIGHLIGHTED OPTIONS *** 

5090 REM *** LOW COLOR VALUE FOR NON-HIGHLIGHTED OPTIONS *** 

5100 REM *** MAX% NUMBER OF MENU CHOICES *** 

5110 REM *** M$(*) ARRAY OF MENU CHOICES *** 

5120 REM *** MSK$ MASK SHOWING ACCEPTABLE CHOICES *** 

5130 REM *** MSGT% NUMBER OF MESSAGE LINES TO BE PRINTED AT TOP *** 

5140 REM *** MSGB% NUMBER OF MESSAGE LINES TO BE PRINTED AT BASE*** 

5150 REM *** MSGT$(*) ARRAY OF MESSAGE LINES AT TOP *** 

5160 REM *** MSGB$(*) ARRAY OF MESSAGE LINES AT BASE *** 

5170 REM *** TOP$ MENU TITLE LINE *** 

5180 REM *** RETURNED VARIABLES *** 

5190 REM *** !RET% NUMERICAL RETURN *** 

5200 REM *** INTERNAL VARIABLES *** 

5210 REM *** A$ CHARACTER FOR INPUT *** 

5220 REM *** XTMP REAL FOR CHECKING FOR INTEGER INPUT *** 

5230 REM *** I% LOOP INDEX *** 

5240 REM *** ITMP% SAVE INPUT VALUE OF MSGB% *** 

5250 REM*** STAR(1,2)$ LINES OF STARS AND MESSAGE FOR HEADER *** 

5260 REM ******************************************************************** 

5270 ITMP%=MSGB%:STAR1$=STRING$(79, 11 *") :STAR2$=STAR1$:WIDTH 80 

5280 MID$(STAR2$,39-INT(LEN(TOP$)/2),LEN(TOP$))=TOP$ 

5290 CLS:COLOR HIGH:PRINT STAR1$:PRINT STAR2$:PRINT STAR1$ 

5300 IF MSGT%>0 THEN PRINT:FOR I%=1 TO MSGT%:PRINT MSGT$(I%):NEXT I% 

5310 PRINT:COLOR LOW:FOR I%=1 TO MAX% 

18 JKDIGIT, A Program to Control a Digitizing Board 
Appendix 1. Commented listing of all modules in JKDIGIT.BAS-Continued 

5320 IF MID$(MSK$,I%,1)= 11 111 THEN COLOR HIGH 

5330 PRINT USING 11 ## II; I%; 

5340 PRINT II 11+M$ ( I%) :COLOR LOW 

5350 NEXT I% 

5360 PRINT 

5370 IF MSGB%>0 THEN COLOR HIGH:FOR I%=1 TO MSGB%:PRINT MSGB$(1%) :NEXT I% 

5380 MSGB%= ITMP% 

5390 PRINT: COLOR HIGH+ 16: PRINT 11 Choose 11; BAS$; 11: 

11

;: COLOR LOW: INPUT A$ 

5400 XTMP=VAL{A$) 

5410 IF XTMP = 0 GOTO 5450 

5420 I RET%= I NT{ XT~·1P) 

5430 IF IRET% = XTMP THEN GOTO 5440 

5440 IF !RET% >= 1 AND !RET% <= MAX% GOTO 5480 

5450 MSGB%=MSGB%+2 

5460 MSGB${MSGB%-1)= 11 Please insert an integer between 1 and 11+STR$(MAX%) 

5470 MSGB$(MSGB%)= 11 You inserted {11+A$+ 11 ) 11 :GOTO 5290 

5480 IF MID$(MSK$,IRET%,1) = 11 111 THEN MSGT%=0:MSGB%=0:RETURN 

5490 MSGB%=MSGB%+1 

5500 MSGB${MSGB%)= 11 Please select a highlighted ootion. You selected 11+A$ 

5510 GOTO 5290 

7000 REM ********************************************************************* 

7010 REM &&& SUBROUTINE JKDIGUTL *** 

7020 REM *** CHOICE OF GOODIES FOR DIGITIZER PROGRAM *** 

7030 REM ********************************************************************* 

7040 REM *** DATED: AUGUST 10, 1983 *** 

7050 REM ********************************************************************* 

7060 REM *** INPUT VARIABLES *** 

7070 REM*** PRM%(0) NUMBER OF OTHER PARAMETERS *** 

7080 REM *** PRM%( 1) SPECIFIES ~IHICH GOODIE *** 

7090 REM *** 1 = BEEP CHOICE *** 

7100 REM *** 2 = LINE PRINTER OPTION *** 

7110 REM *** RETURNED VARIABLES *** 

7120 REM *** !RET% GOODIE CHOICE *** 

7130 REM *** OTHER VARIABLES AND FUNCTIONS *** 

7140 REM *** INPUT VALUES FOR SUBROUTINE JKNUMENU *** 

7150 REM*** BAS$,M$(*),MAX%,MSGB%,MSGB$(*),MSGT%,MSGT$(*) ,TOP$ *** 

7160 REM *** STACK VARIABLES AND FUNCTIONS *** 

7170 REM *** FNRET%{), FNSTK%() , ISTK% ,NSTK% *** 

7180 REM *** SUBROUTINES CALLED *** 

7190 GOTO 7230 

7200 GOTO 5000 'subroutine jknumenu *** 

7210 GOTO 35000 'subroutine jkstack *** 

7220 REM ********************************************************************* 

7230 IF PRM%(0) <> 1 THEN PRINT 11 FATAL PARAMETER ERROR 11 :STOP 

7240 GOSUB 35000 'gosub jkstack 

7250 ON FNSTK%(1) GOTO 7270,7330 

7260 IRET%=3:RETURN 

Appendixes 19 
Appendix 1. Commented listing of all modules in JKDIGIT.BAS-Continued 

7270 MAX%=2:MSGT%=0:MSGB%=0 

7280 M$(1)= 11 no beep11 

7290 M$(2)= 11 beep enabled .. 7300 TOP$= 11 BEEP OPTION MENU" 

7 310 BAS$= .. a beep option" 

7320 GOSUB 5000:GOTO 7390 'gosub jknumenu 

7330 MAX%=2:MSGT%=0:MSGB%=0 

7340 M$(1)= 11 line printing enabled11 

7350 M$(2)="line printing disabled .. 7360 TOP$= 11 L INE PRINTING OPTION MENU 11 

7370 BAS$= 11 a line printing option .. 7380 GOSUB 5000 'gosub jknumenu 

7390 NSTK%=NSTK%-1: ISTK%=FNRET%( 0): RETURN 

9000 REM ****************************************************************** 

9010 REM &&& SUBROUTINE JKYESNO *** 

9020 REM*** PRINTS QUERY AND REQUIRES A 11 Y11 OR 11 N11 RESPONSE *** 

9030 REM ****************************************************************** 

9040 REM *** DATED: AUGUST 10, 1983 *** 

9050 REM ****************************************************************** 

9060 REM *** INPUT VARIABLES *** 

9070 REM *** PRM1$ CHARACTER PROMPT TO BE PRINTED *** 

9080 RE *** RETURNED VARIABLES *** 

9090 RE~*** IRET% = 1 IF ANSWER WAS YES *** 

9100 REM *** = 2 IF ANSWER WAS NO *** 

9110 REM *** INTERNAL VARIABLES *** 

9120 REM *** A$ CHARACTER HOLDING KEYBOARD RESPONSE *** 

9130 REM ****************************************************************** 

9140 PRINT:PRINT PRM1$;:INPUT A$ 

9150 IF A$ = nyu OR A$ = 11Y11 THEN !RET% = 1: RETURN 

9160 IF A$ = 11 N11 OR A$ = 11 n11 THEN IRET% = 2: RETURN 

9170 PRINT 

9180 IF LEN(A$) = 0 THEN PRINT 11 YOU INSERTED A BLANK. 11 ;:GOTO 9200 

9190 PRINT 11 YOU INSERTED 11 A$ 11 • 11 ; 

9200 PRINT "PLEASE INSERT Y OR N. 11 :GOTO 9140 

11000 REM ******************************************************************** 

11010 REM &&& SUBROUTINE JKVALSCL *** 

11020 REM*** CHECKS SCALING WITH VALIDATION CHECK POINTS *** 

11030 REM ******************************************************************** 

11040 REM*** DATED: AUGUST 10, 1983 *** 

11050 REM ******************************************************************** 

11060 REM*** INPUT VARIABLES *** 

11070 REM*** PRM%(0) NUMBER OF OTHER PARAMETERS *** 

11080 REM*** PRM%(1) COORDINATE TYPE CHOICE *** 

110q0 REM *** BPON BEEP ON/OFF FLAG *** 

11100 REM*** LA(*) GEOGRAPHIC USER COORDINATE LATITUDE ARRAY *** 

11110 REM *** LO(*) GEOGRAPHIC USER COORDINATE LONGITUDE ARRAY *** 

11120 REM*** XDB#,YDB# CARTESIAN USER COORDINATES *** 

20 J KDIGIT, A Program to Control a Digitizing Board 
Appendix 1. Commented listing of all modules in JKDIGIT.BAS-Continued 

11130 REM *** RETURNED VARIABLES *** 

11140 REM *** !RET% !=SUCCESS, 2=FAILURE *** 

11150 REM *** OTHER VARIABLES *** 

11160 REM*** INPUT VARIABLES FOR CALL TO SUBROUTINE JKNUMINP *** 

11170 REM*** MSGB%,MSGT%,MSGT$(*) *** 

11180 REM *** STACK VARIABLES AND FUNCTIONS *** 

11190 REM*** FNRET%(),FNSTK%(),ISTK%,NSTK% *** 

11200 REM*** NOTE THAT ALL SCALING PARAMETERS ARE USED IN THE *** 

11210 REM *** CALL TO SUBROUTINE JKDIGDBL *** 

11220 REM *** SUBROUTINES CALLED *** 

11230 GOTO 11280 

11240 GOTO 1000 'subroutine jknuminp *** 

11250 GOTO 19000 'subroutine jkdigdbl *** 

11260 GOTO 35000 'subroutine jkstack *** 

11270 REM ******************************************************************** 

11280 IF PRM%(0) <> 1 THEN PRINT "FATAL PARAMETER ERROR.":STOP 

11290 GOSUB 35000 'gosub jkstack 

11300 MSGT%=0:MSGB%=0 

11310 PRM%{0)=1:PRM%{1)=4:GOSUB 1000 'gosub jknuminp 

11320 ON !RET% GOTO 11330,11490,11500 

11330 CLS :PRINT "DIGITIZE A KNOWN CHECK PO I NT" 

11340 PRM%{0)=1 :'PRM%( l)=FNSTK%( 1) :GOSUB 19000 'gosub jkdigdbl, user coordinates 

11350 IF BPON THEN BEEP 

11360 MSGT%=2:MSGB%=0 

11370 ON FNSTK%(1) GOTO 11460,11460,11380,11410,11460 

11380 MSGT${1)="LATITUDE: "+STR$(LA{1,3) )+" deg" 

11390 MSGT$(2)="LONGITUDE: "+STR${L0(1,3))+" deg" 

11400 GOTO 11310 

11410 MSGT$(1)="LATITUDE: "+STR$(LA{1,1))+" deg "+STR$(LA(1,2))+" min" 

11420 MSGT$(1)=MSGT$(1)+STR$(LA{l,3))+ " sec" 

11430 MSGT${2)="LONGITUDE: "+STR$(L0(1,1))+" deg "+STR$(L0{1,2))+" min" 

11440 MSGT${2)=MSGT$(2)+STR$(L0{1~3))+ " sec" 

11450 GOTO 11310 

11460 MSGT${1)="X COORDINATE IS: "+STR$(XDB#) 

11470 MSGT$(2)="Y COORDINATE IS: "+STR$(YDB#) 

11480 GOTO 11310 

11490 IRET%=1:GOTO 11510 

11500 IRET%=2 

11510 NSTK%=NSTK%-l:ISTK%=FNRET%(0) :RETURN 

13000 REM ******************************************************************** 

13010 REM &&& SUBROUTINE JKGETRND *** 

13020 REM*** GETS USER UNIT ROUNDOFF VALUES *** 

13030 REM*** DATED: APRIL 12, 1983 *** 

13040 REM ******************************************************************** 

13050 CLS:PRINT "THE PRESENT ROUNDOFF FACTORS ARE:" 

13060 PRINT:PRINT "XROUND# : ";XROUND# 

13070 PRINT "YROUND# : ";YROUND# 

Appendixes 21 
Appendix 1. Commented listing of all modules in JKDIGIT.BAS-Continued 

13080 COLOR 31:PRINT:INPUT 11 INSERT NEW XROUND#: 11 ;XROUND# 

13090 IF XROUND#<.0000001 OR XROUND#>1 THEN TMP#=XROUND#:CLS:GOSUB 13130:GOTO 13080 

13100 COLOR 31:PRINT:INPUT 11 INSERT NEW YROUND#: 11 ;YROUND# 

13110 IF YROUND#<.0000001 OR YROUND#>1 THEN TMP#=YROUND#:CLS:GOSUB 13130:GOTO 13100 

13120 COLOR 7:RETURN 

13130 COLOR 15:PRINT:PRINT 11 ROUNDOFF FACTORS MUST BE BETWEEN .0000001 AND 1. 11 

13140 PRINT 11 YOU INSERTED 11 ;TMP#:RETURN 

15000 REM ***************************************************************** 

15010 REM &&& SUBROUTINE JKFILPRM *** 

15020 REM*** WRITES OR READS A FILE OF SCALING PARAMETERS *** 

15030 REM ***************************************************************** 

15040 REM *** DATED: AUGUST 10, 1983 *** 

15050 REM ***************************************************************** 

15060 REM *** INPUT VARIABLES *** 

15070 REM*** PRM%(0) NUMBER OF OTHER PARAMETERS *** 

15080 REM*** PRM%(1) READ OR WRITE PARAMETER *** 

15090 REM *** 1 = WRITE, 2 = READ *** 

15100 REM*** PRM%(2) TYPE OF SCALE PARAMETER FILE *** 

15110 REM *** 1=TEMPLATE *** 

15120 REM *** 2=USER COORDINATE SCALING *** 

15130 REM*** PRM%(3) COORDINATE TYPE SELECTION *** 

15140 REM *** SCALING PARAMETERS *** 

15150 REM *** CDEG%(*) DEGREE OF SCALING REGRESSION *** 

15160 REM *** CX#(*) SCALING MATRIX FOR HORIZONTAL COORDINATE *** 

15170 REM *** CY#(*) SCALING MATRIX FOR VERTICAL COORDINATE *** 

15180 REM *** RNUM%(*) ARRAY HOLDING THE NUMBER OF TERMS IN *** 

15190 REM *** THE REGRESSION MODEL FOR SCALING *** 

15200 REM *** XBOFF(*) BOARD COORDINATE OFFSET *** 

15210 REM *** YBOFF(*) BOARD COORDINATE OFFSET *** 

15220 REM *** XUOFF#(*) USER COORDINATE OFFSET *** 

15230 REM *** YUOFF#(*) USER COORD! NATE OFFSET *** 

15240 REM*** (OFFSETS ARE SET TO BE THE COORDINATES OF *** 

15250 REM*** THE FIRST REGISTRATION POINT DIGITIZED) *** 

15260 REM *** XROUND# HORIZONTAL COORDINATE ROUNDOFF FACTOR *** 

15270 REM*** YROUND# VERTICAL COORDINATE ROUNDOFF FACTOR *** 

15280 REM *** OUTPUT VARIABLES *** 

15290 REM *** !RET% STATUS VARIABLE *** 

15300 REM *** 1 = READ OR WRITE ACCOMPLISHED *** 

15310 REM *** 2 = READ OR WRITE FAILED *** 

15320 REM *** PRM1$ FILE OPERATED ON *** 

15330 REM *** OTHER VARIABLES *** 

15340 REM *** A$ CHARACTER ANSI~ER VARIABLE *** 

15350 REM*** K% INDEX SPECIFYING MENU OR COORDINATE PARMS *** 

15360 REM*** (0 IS MENU, 1 IS COORDINATE) *** 

15370 REM *** TMP3$ FIRST LINE OF PARM SAVE FILE *** 

( 15380 REM *** STACK VARIABLES AND FUNCTIONS *** 

15390 REM*** FNRET%(),FNSTK%() ,ISTK%,NSTK% *** 

22 JKDIGIT, A Program to Control a Digitizing Board 
Appendix 1. Commented listing of all modules in JKDIGIT.BAS-Continued 

15400 GOTO 15460 

15410 REM *** SUBROUTINES CALLED *** 

15420 GOTO 17000 'subroutine jkdigfil 

15430 GOTO 35000 'subroutine jkstack 

15440 REM ***************************************************************** 

15450 IF PRM%(0) <> 3 THEN PRINT "FATAL PARAMETER ERROR11 :STOP 

15460 GO SUB 35000 :PRM1$=" 11 • gosub j kstack 

15470 ON FNSTK%(2) GOTO 15480,15490 

15480 TMP3$="TEMPLATE PARAMETER FILE":GOTO 15520 

15490 ON FNSTK%(3) GOTO 15500,15500,15510,15510,15500 

15500 TMP3$="CARTESIAN PARAMETER FILE":GOTO 15520 

15510 TMP3$="GEOGRAPHIC PARAMETER FILE" 

15520 ON FNSTK%(1) GOTO 15550,15760 

15530 CLS:PRINT "PROGRA~1MING ERROR, PRt~1% CANNOT BE ";FNSTK%(1) 

15540 IRET% = 2: GOTO 16040 

15550 WIDTH 80 

15560 'get file name and write parameters 15570 PRM%(0)=2:PRM%(1)=1:PRM%(2)=3:GOSUB 17000 'gosub jkdigfil 

15580 IF IRET%=2 GOTO 15950 

15590 ON ERROR GOTO 15970 

15600 PRINT #3,TMP3$ 

15610 PRINT #3, "SAVED ON "+DATE$ 

15620 IF FNSTK%(2)=1 THEN K%=0 ELSE K%=1 

15630 PRINT #3,XBOFF(K%) 

15640 PRINT #3,YBOFF(K%) 

15650 PRINT #3,XUOFF#(K%) 

15660 PRINT #3,YUOFF#(K%) 

15670 PRINT #3,CDEG%(K%) :ITMP%=RNUM%(CDEG%(K%)) 

15680 FOR I%=1 TO ITMP%:PRINT #3,CX#(I%-1,K%):NEXT I% 

15690 FOR I%=1 TO ITMP%:PRINT #3,CY#(I%-1,K%) :NEXT I% 

15700 IF K%=0 GOTO 15730 

15710 PRINT #3,XROUND# 

15720 PRINT #3,YROUND# 

15730 CLOSE #3 

15740 !RET% = 1 

15750 GOTO 16060 

15760 'get filename and read parameters 

15770 PRM%(0)=2:PRM%(1)=3:PRM%(2)=3:GOSUB 17000 'gosub jkdigfil 

15780 ON !RET% GOTO 15790,15990 

15790 ON ERROR GOTO 16000 

15800 LINE INPUT #3,A$ 

15810 IF A$ <> TMP3$ GOTO 16020 

15820 LINE INPUT #3,A$ 

15830 IF FNSTK%(2) = 1 THEN K%=0 ELSE K%=1 

15840 INPUT #3,XBOFF(K%) 

15850 INPUT #3,YBOFF(K%) 

15860 INPUT #3,XUOFF#(K%) 

Appendixes 23 
Appendix 1. Commented listing of all modules in JKDIGIT.BAS-Continued 

15870 INPUT #3,YUOFF#(K%) 

15880 INPUT #3,CDEG%(K%) :ITMP%=RNUM%(CDEG%(K%)) 

15890 FOR I%=1 TO ITMP%:INPUT #3,CX#(I%-1,K%) :NEXT I% 

15900 FOR I%=1 TO ITMP%:INPUT #3,CY#(I%-1,K%) :NEXT I% 

15910 IF K%=0 GOTO 15940 

15920 INPUT #3,XROUND# 

15930 INPUT #3,YROUND# 

15940 CLOSE #3:IRET%=1:0N ERROR GOTO O:GOTO 16060 

15950 PRINT "Output file not open- parameters not saved.":GOTO 16040 

15960 PRINT "No coordinate type selected yet.":GOTO 16040 

15970 CLOSE #3:0N ERROR GOTO 0 

15980 PRINT "Error writing parameter file - parameters not saved.": GOTO 16040 

15990 PRINT "Input file not open - parameters not read." :GOTO 16040 

16000 CLOSE #3:0N ERROR GOTO 0 

16010 PRINT 11 Error reading parameter file - parameters not read.": GOTO 16040 

16020 CLOSE #3 

16030 PRINT "Selected file is not 11 ;TMP3$ 

16040 IRET%=2:PRINT 11 PRESS ANY KEY TO RETURN TO MAIN MENU. 11 

16050 A$= I NKEY$: IF A$=" 11 THEN 16050 

16060 NSTK%=NSTK%-1:ISTK%=FNRET%(0):RETURN 

17000 REM ********************************************************************* 

17010 REM &&& SUBROUTINE JKDIGFIL *** 

17020 REM*** GETS FILENAME, CHECKS FOR GROSS ERRORS, AND OPENS IT *** 

17030 REM*** FILE HAS EXTENSION (.DIG) *** 

17040 REM ********************************************************************* 

17050 REM*** DATED AUGUST 10, 1983 *** 

17060 REM ********************************************************************* 

17070 REM *** INPUT VARIABLES *** 

17080 REM *** PR~h(O) NUMBER OF OTHER PARAMTERS *** 

17090 REM*** PRM%(1) SPECIFIES WHICH TYPE OF OPEN *** 

17100 REM *** 1) OPEN NEW FILE FOR OUTPUT *** 

17110 REM *** 2) OPEN OLD FILE FOR APPEND OUTPUT *** 

17120 REM *** 3) OPEN OLD FILE FOR INPUT *** 

17130 REM *** PRM%(2) NUMBER OF FILE TO OPEN *** 

17140 REM *** PRM1$ INPUT FILE USE MESSAGE *** 

17150 REM*** VARIABLES RETURNED *** 

17160 REM *** PRM2$ NAME OF FILE OPERATED ON *** 

17170 REM *** IRET% INTEGER STATUS VARIABLE *** 

17180 REM *** 1 = FILE OPENED *** 

17190 REM*** 2 = FAILED TO OPEN FILE *** 

17200 REM*** IRET1% RETURNED TO BE FLMOD%, TYPE OF WRITE CHOSEN *** 

17210 REM *** 1 = WRITING NEW FILE *** 

17220 REM *** 2 = APPENDING TO OLD FILE *** 

17230 REM *** 3 = OVERWRITING OLD FILE *** 

17240 REM *** 4 = RETURNED - NO FILE OPEN *** 

17250 REM *** INTERNAL VARIABLES *** 

17260 REM *** A$ TEMPORARY FILENAME VARIABLE *** 

24 JKDIGIT, A Program to Control a Digitizing Board 
Appendix 1. Commented listing of all modules in JKDIGIT.BAS-Continued 

17270 REM *** I%,J% LOOP INDEX VARIABLES *** 

17280 REM*** TMP% TEMP STORAGE FOR ASCII CHAR REPRESENTATION *** 

17290 REM *** TMP1$ TEMP STORAGE FOR PRM1$ *** 

17300 REM *** STACK VARIABLES AND FUNCTIONS *** 

17310 REM*** FNRET%(),FNSTK%(),ISTK%,NSTK% *** 

17320 REM *** SUBROUTINES CALLED *** 

17330 GOTO 17380 

17340 GOTO 1000 •subroutine jknuminp *** 

17350 GOTO 9000 •subroutine jkyesno *** 

17360 GOTO 35000 •subroutine jkstack *** 

17370 REM ********************************************************************* 

17380 IF PRM%(0) <> 2 THEN PRINT 11 FATAL PARAMETER ERROR11 :STOP 

17390 GOSUB 35000 •gosub jkstack 

17 400 PRM2$= 1111: I RET%=2: T~1P1$=PRM1$: I RET1%=1 

17410 CLS:WIDTH 80 

17420 ON ERROR GOTO 17450 

17430 CLOSE #FNSTK%(2) 

17440 GOTO 17460 

17450 ON ERROR GOTO 0: RESUME 17460 

17460 PRINT 11 FILE OPENING SUBROUTINE11 

17470 PRINT:PRINT 11 lNSERT FILE NAME •iTMP1$ 11 (OR JUST CR TO RETURN): 11 ; :INPUT A$ 

17480 PRM2$=A$ 

17490 REM *** TRANSFER IF LENGTH OK 

17500 IF LEN(PRM2$) > 0 AND LEN(PRM2$) < 9 GOTO 17600 

17510 REM *** RETURN AND ABORT TRY IF LENGTH IS ZERO 

17520 IF LEN(PRM2$) <> 0 GOTO 17570 

17530 CLS 

17540 PRM1$= 11 BLANK INPUT. DO YOU WANT TO RETURN TO MAIN MENU 11 :GOSUB 9000 

17550 ON !RET% GOTO 17560,17470 •gosub jkyesno 

17560 IRET%=2:GOTO 18040 

17570 CLS :PRINT 11 FI LE NAME TOO LONG. USE 8 OR FEWER CHARACTER. TRY AGAIN. 11 

17580 GOTO 17470 

17590 REM *** CHECK EACH CHARACTER POSITION FOR NON-LETTER OR NON-NUMBER 

17600 FOR I%=1 TO LEN{PRM2$) 

17610 TMP% = ASC(MID${PRM2$,I%,1)) 

17620 FOR J%=65 TO 90 

17630 IF TMP%=J% GOTO 17720 

17640 NEXT J% 

17650 FOR J% = 48 TO 57 

17660 IF TMP% = J% GOTO 17720 

17670 NEXT J% 

17680 FOR J% = 97 TO 122 

17690 IF TMP% = J% GOTO 17720 

17700 NEXT J% 

17710 PRINT:PRINT 11 FILENAME CAN HAVE ONLY LETTERS OR NUMBERS IN IT. 11 :GOTO 17470 

17720 NEXT I% 

17730 REM *** CHARACTERS IN NAME OK - APPEND .DIG 

Appendixes 25 
Appendix 1. Commented listing of all modules in JKDJGIT.BAS-Continued 

17740 PRM2$=PRM2$+".DIG" 

17750 ON FNSTK%(1) GOTO 17760,17920,17970 

17760 REM *** CASE FOR OPENING NEW FILE FOR OUTPUT 

17770 REM*** TRY TO OPEN FOR INPUT. IF ERROR, THEN NO FILE YET EXISTS. OPEN IT 

17780 REM *** IF NO ERROR, THEN FILE DOES EXIST 

17790 ON ERROR GOTO 17850 

17800 OPEN "I",#FNSTK%(2),PRM2$ 

17810 CLOSE #FNSTK%(2) 

17820 ON ERROR GOTO 0 

17830 PRM%(0)=1:PRM%(1)=5:GOSUB 1000:IRET1%=IRET% 'gosub jknuminp 17840 ON IRET% GOTO 17470,17920,17880,17960 

17850 RESUME 17860 

17860 ON ERROR GOTO 0 

17870 CLOSE #FNSTK%(2) . 17880 OPEN "0" ,#FNSTK%( 2), PRM2$ 

17890 I RET%=1 

17900 PRINT "FILE "PRM2$" OPENED FOR OUTPUT." 

17910 GOTO 18040 

17920 OPEN "A",#FNSTK%(2),PRM2$ 

17930 PRINT "FILE "PRM2$" OPENED IN OUTPUT APPEND MODE." 

17940 IRET% = 1 

17950 GOTO 18040 

17960 IRET%=2:GOTO 18040 

17970 REM*** CASE FOR OPENING FOR INPUT 

17980 ON ERROR GOTO 18010 

17990 OPEN "I" ,#FNSTK%(2) ,PRM2$ 

18000 ON ERROR GOTO O:IRET%=1:PRINT "FILE "A$ 11 OPENED FOR INPUT.":GOTO 18040 

18010 PRINT "FILE "PRM2$" DOES NOT EXIST. TRY AGAIN ... 18020 RESUME 18030 

18030 ON ERROR GOTO O:GOTO 17460 

18040 NSTK%=NSTK%-1:ISTK%=FNRET%(0):RETURN 

19000 REM ********************************************************************* 

19010 REM &&& SUBROUTINE JKDIGDBL *** 

19020 REM*** RETURNS USER COORDINATES SCALED *** 

19030 REM ********************************************************************* 

19040 REM*** DATED: AUGUST 10, 1983 *** 

19050 REM ********************************************************************* 

19060 REM *** INPUT VARIABLES *** 

19070 REM *** PRM%(0) NUMBER OF OTHER PARAMETERS *** 

19080 REM*** PRM%(1) COORDINATE TYPE CHOICE *** 

19090 REM *** (0 = MENU) *** 

19100 REM *** SCALING PARAMETERS *** 

19110 REM *** CDEG%(*) DEGREE OF SCALING REGRESSION *** 

19120 REM*** CX#(*) SCALING MATRIX FOR HORIZONTAL COORDINATES *** 

19130 REM *** CY#(*) SCALING MATRIX FOR VERTICAL COORDINATES *** 

19140 REM *** RNUM%(*) ARRAY HOLDING THE NUMBER OF TERMS IN *** 

19150 REM*** THE REGRESSION MODEL FOR SCALING *** 

26 JKDIGIT, A Program to Control a Digitizing Board 
Appendix 1. Commented listing of all modules in JKDIGIT.BAS-Continued 

19160 REM *** XBOFF{*) BOARD COORDINATE OFFSET 

19170 REM *** YBOFF(*) BOARD COORD I NATE OFFSET 

19180 REM *** XUOFF#{*) USER COORDINATE OFFSET 

19190 REM*** YUOFF#(*) USER COORDINATE OFFSET 

19200 REM*** {OFFSETS ARE SET TO BE COORDINATES OF 

19210 REM*** THE FIRST REGISTRATION POINT DIGITIZED 

19220 REM *** XROUND# HORIZONTAL COORDINATE ROUNDOFF FACTOR 

19230 REM*** YROUND# VERTICAL COORDINATE ROUNDOFF FACTOR 

19240 REM *** VARIABLES RETURNED 

19250 REM*** XDB#,YDB# X,Y USER COORDINATES 

19260 REM *** (OR) LA{*) USER GEOGRAPHIC COORDINATES 

19270 REM*** LO(*) USER GEOGRAPHIC COORDINATES 

19280 REM *** CBTN$ CURSOR ENTRY CHARACTER 

19290 REM *** !RET% ERROR RETURN VARIABLE 

19300 REM *** 0 = NO ERROR RETURN 

19310 REM *** 1 = ERROR-ABORT 

19320 REM*** OTHER VARIABLES 

19330 REM*** AX#(.,.) HOLDS VALUES FOR DEPENDENT VARIABLES FOR 

19331 REM *** REGRESSION 

19340 REM*** A$,B$,C$ TEMPORARY CHARACTER VARIABLES HOLDING 

19350 REM *** DOUBLE PRECISION VALUES 

19360 REM*** B#,C#,D# NUMBERS USED IN ROUNDING DOUBLE PRECISION 

19370 REM *** COORDINATES 

19380 REM*** B%,TMP% INTEGER VARIABLES USED REMOVING EXPONENT 

19390 REM*** C%,C INTEGER AND SINGLE PRECISION VERSIONS OF C# 

19400 REM*** I%,J% LOOP INDEX VARIABLES 

19410 REM*** K% SPECIFIES TEMPLATE OR COORDINATE SCALING 

19420 REM*** (0 = TEMPLATE, 1 = COORDINATE) 

19430 REM *** S% SIGN HOLDING VARIABLE 

19440 REM *** TROUND# TEMPORARY ROUNDING FACTOR IN SUBROUTINE 

19450 REM*** XI,YI RETURNED RAW BOARD COORDINATES 

19460 REM*** XT#,YT# BOARD COORDINATES WITH BOARD OFFSET REMOVED 

19470 REM*** USED FOR CALCULATING AX#() ARRAYS 

19480 REM *** STACK VARIABLES AND FUNCTIONS 

19490 REM*** FNRET%(),FNSTK%{),ISTK%,NSTK% 

19500 REM *** SUBROUTINES CALLED 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

19510 GOTO 19640 

19520 GOTO 21000 

19530 GOTO 20050 

19540 GOTO 20150 

19550 GOTO 20270 

19560 GOTO 35000 

19570 REM*** NOTE: 

19580 REM *** 

•subroutine jkdigbrd *** 

19590 REM *** 

19600 REM *** 

19610 REM *** 

•subroutine dblrnd (internal) *** 

•subroutine grdrnd (internal) *** 

• subroutine nnvexp {internal) *** 

•subroutine jkstack *** 

THE DOUBLE PRECISION EXPONENTIAL FORMAT IS REMOVED *** 

IN THIS PROGRAM BY DECREASING THE NUMBER OF SIGNIFICANT*** 

DIGITS BY THE EXPONENT VALUE. THIS IS DONE SO THAT THE*** 

RETURNEO VALUE IS ALWAYS IN INTEGER OR REAL FORMAT. IN*** 

THE UNLIKELY EVENT THAT THIS CAUSES ACCURACY PROBLEMS *** 

Appendixes 27 
Appendix 1. Commented listing of all modules in JKDIGIT.BAS-Continued 

19620 REM *** NOTIFY THE AUTHOR. *** 

19630 REM ********************************************************************* 

19640 IF PRM%(0) <> 1 THEN PRINT "FATAL PARAMETER ERROR":STOP 

19650 GOSUB 35000 'gosub jkstack 

19660 IRET%=0:IF FNSTK%(1)=0 THEN K%=0 ELSE K%=1 

19670 'get raw board coordinates 

19680 GO SUB 21000 'subroutine j kdi gbrd 

19690 IF CBTN$= II: II THEN GOTO 20040 

19700 XT#=CDBL(XI-XBOFF(K%)):YT#=CDBL(YI-YBOFF(K%)) 

19710 'scale coordinates 

19720 'calculate dependent variable values for regression 

19730 AX#(1,1)=XT#:AX#(1,2)=YT#:IF CDEG%(K%)=1 GOTO 19790 

19740 AX#(1,3)=XT#*XT#:AX#(1,4)=XT#*YT#:AX#(1,5)=YT#*YT# 

19750 IF CDEG%(K%)=2 GOTO 19790 

19760 AX#(1,6)=XT#*AX#(1,3):AX#(1,7)=XT#*AX#(1,7):AX#(1,8)=XT#*AX#(1,5) 

19770 AX#(1,9)=YT#*AX#(1,5) 

19780 'calculate user coordinates 

19790 XDB#=CX#(O,K%)+XUOFF#(K%):YDB#=CY#(O,K%)+YUOFF#(K%) 

19800 FOR J%=1 TO RNUM%(CDEG%(K%))-1 

19810 XDB#=XDB#+CX#(J%,K%)*AX#(1,J%) 

19820 YDB#=YDB#+CY#(J%,K%)*AX#(1,J%) 

19830 NEXT J% 

19840 ON FNSTK%(1) GOTO 19900,19900,19900,19860,19900 

19850 GOTO 20040 

19860 FOR 1%=1 TO 2 

19870 LA(1,I%)=FIX(CSNG(YDB#)):YDB#=(YDB#-LA(1,1%))*60 

19880 L0(1,1%)=FIX(CSNG(XDB#)) :XDB#=(XDB#-L0(1,1%))*60 

19890 NEXT I% 

19900 'remove exponential format 

19910 B#=XDB#:GOSUB 20270:XDB#=C# 

19920 B#=YDB#:GOSUB 20270:YDB#=C# 

19930 IF FNSTK%(1) <> 2 GOTO 19960 

19940 B#=XDB#:GOSUB 20050:XDB#=C# 

19950 B#=YDB#:GOSUB 20050:YDB#=C#:GOTO 20040 

19960 TROUND#=XROUND#:B#=XDB#:GOSUB 20150:XDB#=C# 

19970 TROUND#=YROUND#:B#=YDB#:GOSUB 20150:YDB#=C# 

19980 ON FNSTK%(1) GOTO 20040,20040,20000,20000,20040 

19990 GOTO 20040 

20000 LA(1,3)=CSNG(YDB#):L0(1,3)=CSNG(XDB#) 

20010 IF FNSTK%(1)=3 GOTO 20040 

20020 IF LA(1,3)>=60 THEN LA(1,2)=LA(1,2)+1:LA(1,3)=LA(1,3)-60 

20030 IF L0(1,3)>=60 THEN L0(1,2)=L0(1,2)+1:L0(1,3)=L0(1,3)-60 

20040 NSTK%=NSTK%-1:ISTK%=FNRET%(0):RETURN 

20050 REM*** INTERNAL SUBROUTINE DBLRND 

20060 REM *** INPUT VARIABLE: B# 

20070 REM*** RETURNED VARIABLE: C# (ROUNDED TO INTEGER VALUE) 

20080 A$=STR$ ( B#) : B$= II II 

28 JKDIGIT, A Program to Control a Digitizing Board 
Appendix 1. Commented listing of all modules in JKDIGIT.BAS-Continued 

20090 FOR I% = 1 TO LEN(A$) 

20100 IF MID${ A$' I% ,1) = II. II GOTO 20130 

20110 B$=B$+MID$(A$,I%,1) 

20120 NEXT I% 

20130 D#=VAL(B$) :C=CSNG(B#-D#) :C%=CINT(C):C#=D#+CDBL(C%) 

20140 RETURN 

20150 REM *** INTERNAL SUBROUTINE GRDRND 

20160 REM*** INPUT B# 

20170 REM*** OUTPUT C# {ROUNDED) 

20180 A$=STR$(B#) :B$="" 

20190 FOR I%=1 TO LEN(A$) 

20200 IF MID$(A$,I%,1)="." GOTO 20230 

20210 B$=B$+MID$(A$,I%,1) 

20220 NEXT I% 

20230 D#=VAL(B$):C=CSNG(B#-D#):S%=+1 

20240 IF C < 0! THEN S%=-1:C=-C 

20250 C#=D#+CDBL( S%*( INT( (C/TROUND#)+.5) )*TROUND#) 

20260 RETURN 

20270 REM *** INTERNAL SUBROUTINE RMVEXP 

20280 REM *** REMOVES EXPONENTIAL FORMAT OF DOUBLE PRECISION NUMBER 

20290 C#=B#:A$=STR$(B#) :TMP%=INSTR(A$,"D") :IF TMP%=0 THEN RETURN 

20300 B$=MID${A$,TMP%+2,2):B%=VAL(B$) :IF B%>=TMP%-1 THEN C#=O:RETURN 

20310 C$=MID$(A$,1,TMP%-B%-1)+MID$(A$,TMP%,4) 

20320 C#=VAL(C$) 

20330 RETURN 

21000 REM ********************************************************************* 

21010 REM &&& SUBROUTINE JKDIGBRD *** 

21020 REM*** RETURNS BOARD COORDINATES OF SINGLE POINT, AND CURSOR BOTTON *** 

21030 REM ********************************************************************* 

21040 REM *** DATED AUGUST 10, 1q83 *** 

21050 REM ********************************************************************* 

21060 REM *** RETURNED VARIABLES *** 

21070 REM *** XI, YI :DIGITIZER COORD! NATES ( .001 ") *** 

21080 REM *** CBTN$ :CURSOR BOTTON CHARACTER *** 

21090 REM ********************************************************************* 

21100 ON ERROR GOTO 21150 

21110 INPUT #1,XI,YI,CBTN$ 

21120 CBTN$=MID$(CBTN$,1,1) 

21130 ON ERROR GOTO 0 

21140 RETURN 

21150 WIDTH 80:PRINT "COMMUNICATIONS TROUBLE IN JKDIGBRD?" 

21160 PRINT "ERR: ",ERR,"ERL: ",ERL 

21170 PRINT:PRINT "RESTART THE PROGRAM- ERROR SHOULD NOT OCCUR AGAIN." 

21180 CLOSE:STOP 

23000 REM ********************************************************************* 

23005 REM &&& SUBROUTINE JKGETPNT *** 

23010 REM*** TO READ POINT LOCATIONS FROM THE DIGITIZER BOARD, SCALE THEM *** 

Appendixes 29 
Appendix 1. Commented listing of all modules in JKDIGIT.BAS-Continued 

23015 REM *** AND WRITE THE COORDINATES TO A FILE *** 

23020 REM ********************************************************************* 

23025 REM *** DATED: AUGUST 10, 1983 *** 

23030 REM ********************************************************************* 

23035 REM *** INPUT VARIABLES *** 

23040 REM*** PRM%(0) NUMBER OF OTHER PARAMETERS *** 

23045 REM*** PRM%(1) COORDINATE TYPE SELECTION *** 

23050 REM*** PRM%(2) ID TYPE SELECTION *** 

23055 REM *** PR~-1%( 3) DIGITIZING MODE *** 

23060 REM*** (1=STREAM, 2=POINT) *** 

23065 REM *** BPON BEEP CHOICE INDICATOR *** 

23070 REM *** CLR%(*) HIGHLIGHTING COLOR NUMBERS FOR ACTION TABLE *** 

23075 REM*** (I,J,K):I=ROW,J=COL,K=ENTRY NUMBER *** 

23080 REM *** ALSO HOLDS NEW COLORS FOR ACTION TABLE UPDATE *** 

23085 REM*** OAT$(*) ACTION TABLE PRINT ENTRIES *** 

23090 REM *** DATX%(*) LABEL POSITIONS FOR ACTION TABLE *** 

23095 REM *** DATY%(*) LABEL POSITIONS FOR ACTION TABLE *** 

23100 REM *** IDCHR$ CONSTANT PORTION OF ID *** 

23105 REM *** LPON LINE PRINTER OPTION CHOICE *** 

23110 REM *** MKR$(*) MENU ST.l\TUS LABEL-USED FOR ID TYPE CHOICE *** 

23115 REM *** NPTS% NUMBER OF PTS DIGITIZED IN THIS RUN *** 

23120 REM *** OFIL$ OUTPUT FILE NAME *** 

23125 REM *** PRM1$ CONTROL CHARACTER FOR DIGITIZING MODE *** 

23130 REM *** ALSO HOLDS PRINT LINE FOR CALL TO JKYESNO *** 

23135 REM*** TNE$ MUSIC SHOWING EMPTY BUFFER (SAINTS) *** 

23140 REM*** TNF$ MUSIC SHOWING FULL BUFFER (VOLGA BOATMAN) *** 

23145 REM *** FLMOD% OUTPUT FILE OPENING MODE *** 

23150 REM *** OTHER VARIABLES . *** 

23155 REM *** A$ CHARACTER ANSWER VARIABLE, ALSO VERTICAL *** 

23160 REM *** LINE CHARACTER FOR ACTION TABLE *** 

23165 REM *** 8$ HORIZONTAL LINE CHARACTER FOR ACTION TABLE *** 

23170 REM*** BPBF LOGICAL COMBINATION OF BPON AND NOT MBUF *** 

23175 REM*** CLO%(*) COLOR INDICATOR FOR TABLE ENTRIES (SEE CLR%(*))*** 

23180 REM*** I%,J%,K% LOOP INDICES *** 

23185 REM *** IDTOP$ SHORTENED FORM OF IDCHR$ FOR TABLE *** 

23190 REM *** IDWRT$ ID ACCUMULATOR FOR PRINTING LABEL *** 

23195 REM *** IFRST FIRST POINT DIGITIZED FLAG (FOR FILE HEADER) *** 

23200 REM *** !RET% ERROR RETURN VARIABLE FROM VARIOUS SUBROUTINES *** 

23205 REM*** LA(),LO() LATITUDE AND LONGITUDE COORDINATES *** 

23210 REM *** MBUF BUFFER NEAR FULL INDICATOR *** 

23215 REM *** TMP1$ TEMPORARY STORAGE FOR PRM1$ *** 

23220 REM *** XOB#, YDB# USER CARTES I AN COORD I NATES *** 

23225 REM*** X#,Y# TEMPORARY STORAGE FOR HOLDING USER COORDINATES*** 

23230 REM *** WHILE ENTERING REST OF ID *** 

23235 REM*** XMEN%,YMEN% : RELATIVE LOCATION COORDINATES WITHIN *** 

23240 REM *** MENU BOX *** 

23245 REM *** STACK VARIABLES AND FUNCTIONS *** 

30 JKDIGIT, A Program to Control a Digitizing Board 
Appendix 1. Commented listing of all modules in JKDIGIT.BAS-Continued 

23250 REM*** FNRET%(),FNSTK%(),ISTK%,NSTK% *** 

23255 REM *** SUBROUTINES CALLED *** 

23260 GOTO 23290 

23265 GOTO 19000 'subroutine jkdigdbl *** 

23270 GOTO 23850 • subroutine j kmenhi t (internal) *** 

23275 GOTO 24000 'subroutine jkaction (internal) *** 

23280 GOTO 35000 • subroutine j kstack *** 

23285 REM ********************************************************************* 

23290 IF PR~i,{O) <> 3 THEN PRINT 11 FATAL PARAMETER ERROR11 :STOP 

23295 GOSUB 35000:TMP1$=PRM1$:IFRST=TRUE 

23300 WIDTH 40:MBUF=FALSE:PRINT 11 STARTING DIGITIZING OF POINTS11 

23305 IDWRT$=IDCHR$:0N FLMOD% GOTO 23310,23315,23310 

23310 PRINT #2, 11DIGITIZED ON 11 DATE$:FLMOD%=2 

23315 IF NOT LPON GOTO 23370 

23320 'error trap for printer troubles 

23325 ON ERROR GOTO 23350 

23330 LPRINT 11 DIGITIZER OUTPUT PRINTOUT. 11 

23335 LPRINT 11 STORED IN FILE 11 0FIL$ 

23340 LPRINT 11 DATED: 11 DATE$ 

23345 GOTO 2339 5 

23350 ON ERROR GOTO 0 

'gosub jkstack 

23355 PRINT:PRINT 11 CHECK YOUR PRINTER- POWER, ETC. 11 :RESUME 23360 

23360 PRM1$= 11 WANT TO TRY PRINTER AGAIN 11 :GOSUB 9000 'gosub jkyesno 23365 ON IRET% GOTO 23320,23370 

23370 ON FNSTK%(3) GOTO 2337~,23395 

23375 PRINT #1, 11 #]K 11 

23380 PRINT #1, 11 #]M11 

23385 PRINT #1, 11 #] Ill ;TMP1$ 

23390 'initialize action table 

23395 PRM%(1)=1:GOSUB 24000 

'set digitizer to switch stream mode 

'set digitizer to incremental mode 

'send increment character 

23400 'refresh action table before next point 

23405 IF FNSTK%(3)=1 THEN CLR%(1,1,2)=15 ELSE CLR%(1,1,1)=15 

23410 CLR%(1,2,2)=15 

23415 PRM%(1)=2:IDWRT$=IDCHR$:GOSUB 24000 

23420 'check for full i/o buffer 

23425 IF LOF(1) >= 1500 GOTO 23435 

23430 IF NOT MBUF THEN MBUF=TRUE:PLAY TNF$:GOTO 23445 

23435 IF LOC(1) <= 32 AND MBUF THEN MBUF=FALSE ELSE GOTO 23450 

'gosub jkaction 

• gosub j kact ion 

23440 PLAY TNE$:LOCATE 25,10:COLOR 7:PRINT SPC(20) :LOCATE 1,1,0:GOTO 23450 

23445 LOCATE 25,10:COLOR 31:PRINT 11 BUFFER FULL- WAIT11 ;:LOCATE 1,1,0 

23450 BPBF=BPON AND NOT MBUF 

23455 'get next location- or symbol to halt 

23460 PRM%(0)=1:PRM%(1)=FNSTK%(1) :GOSUB 19000 

23465 IF BPBF THEN BEEP 

23470 IF CBTN$= 11 : II OR CBTN$= 11 J II OR CBTN$= 11 Z11 GOTO 24440 

23475 'save location coordinates 

23480 ON FNSTK%(1) GOTO 23485,23485,23495,23490,23485 

'gosub jkdigdbl 

Appendixes 31 
Appendix 1. Commented listing of all modules in JKDIGIT.BAS-Continued 

23485 X#=XDB#:Y#=YDB#:GOTO 23505 

23490 LA(2,1)=LA(1,1):LA(2,2)=LA(1,2):L0(2,1)=L0(1,1):L0(2,2)=L0(1,2) 

23495 LA(2,3)=LA(1,3):L0(2,3)=L0(1,3) 

23500 'get id if applicable mode 

23505 ON FNSTK%(3) GOTO 23745,23510 

23510 ON FNSTK%(2) GOTO 23515,23550,23745,23585 

23515 'gosub jkaction 

23520 CLR%(1,2,1)=15:CLR%(2,1,1)=15:CLR%(2,2,1)=15:PRM%(1)=3:GOSUB 24000 

23525 A$=I NKEY$: IF A$=" 11 GOTO 23525 

23530 IF A$="*" GOTO 24435 

23535 IF ASC(A$)=13 GOTO 23640 

23540 IDWRT$=IDWRT$+A$:PRM%(1)=4:GOSUB 24000 

23545 GOTO 23525 

23550 IDWRT$=IDCHR$+CBTN$ 'v gosub jkaction 

23555 CLR%(1,2,2)=15:CLR%(2,1,2)=15:CLR%(2,2,2)=15:PRM%(1)=3:GOSUB 24000 

23560 PRM%(0)=1:PRM%(1)=FNSTK%(1):GOSUB 19000:IF BPBF THEN BEEP 'gosub jkdigdbl 23565 IF CBTN$= II: II GOTO 24440 

23570 IF CBT N$ = II ; II GOTO 2 3640 

23575 IDWRT$=IDWRT$+CBTN$:PRM%{1)=5:GOSUB 24000 'gosub jkaction 

23580 GOTO 23560 

23585 'template input 

23590 CLR%(1,2,3)=15:CLR%(2,1,3)=15:CLR%(2,2,3)=15 

23595 PRM%(1)=3:GOSUB 24000 'gosub jkaction 

23600 PR~k(0)=1:PRM%(1)=0:GOSUB 19000:IF BPBF THEN BEEP 'gosub jkdigbrd 

23605 IF CBTN$= II: II GOTO 24440 

23610 PRM%(1)=1:GOSUB 23850:IF !RET% <> 1 GOTO 23600 

23615 IF CBTN$ = 11 # II GOTO 23640 

23620 IF CBTN$="*" THEN GOTO 24440 

23625 IDWRT$=IDWRT$+CBTN$:PRM%{1)=5:GOSUB 24000 'gosub jkaction 

23630 GOTO 23600 

23635 'verification screen printing 

23640 ON FNSTK%{2) GOTO 23645,23685,23770,23715 

23645 CLR%(3,1,1)=15:CLR%{3,2,1)=15:PRM%{1)=6:GOSUB 24000 'gosub jkaction 

23650 PRM%(1)=5:GOSUB 24000 'gosub jkaction 

23655 A$= INK EY$: IF A$= 1111 GOTO 2 3655 

23660 LOCATE 25,10:COLOR 7:PRINT SPC{20);:LOCATE 1,1,0 

23665 IF A$="Y" OR A$= 11 y" GOTO 23770 

23670 IF A$="N" OR A$="n" GOTO 23845 

23675 LOCATE 25,10:COLOR 31:PRINT "PLEASE INSERT Y OR N";:LOCATE 1,1,0 

23680 GOTO 23650 

23685 CLR%(1,2,2)=15:CLR%{3,1,2)=15:CLR%(3,2,2)=15 

23690 PRM%{ 1) =6 :GO SUB 24000 'gosub j kacti on 

23695 PRM%{0)=1:PRM%(1)=FNSTK%(1):GOSUB 19000 'gosub jkdigdbl 

23700 IF BPBF THEN BEEP 

23705 IF CBTN$ = II: II GOTO 24440 

23710 IF CBTN$ <> "0" GOTO 23845 ELSE GOTO 23770 

23715 CLR%(3,1,2)=15:CLR%{3,1,3)=15:CLR%{3,2,3)=15 

32 JKDIGIT, A Program to Control a Digitizing Board 
Appendix 1. Commented listing of all modules in JKDIGIT.BAS-Continued 

23720 PRM%(1)=6:GOSUB 24000 'gosub jkaction 

23725 PRM%(0)=1:PRM%(1)=0:GOSUB 19000:IF BPBF THEN BEEP 'gosub jkdigdbl 

23730 IF CBTN$= 11 011 GOTO 23770 

23735 PRM%(1)=2:GOSUB 23850 

23740 IF !RET%<> 1 OR CBTN$ <> 11 011 GOTO 23845 ELSE GOTO 23770 

23745 'update only coords in action table 

23750 LOCATE 6,11:PRINT SPC(32); 

23755 LOCATE 7,11:PRINT SPC(32); 

23760 PR~h(1)=4:GOSUB 24000 'gosub jkaction 

23765 'write output to file and printer 

23770 ON FNSTK%(1) GOTO 23775,23775,23790,23805,23775 

23775 PRINT #2,X#,Y#,IDWRT$ 

23780 IF LPON THEN LPRINT X#,Y#,IDWRT$ 

23785 GOTO 23840 

23790 PRINT #2,LA(2,3),L0(2,3),IDWRT$ 

23795 IF LPON THEN LPRINT LA(2,3),L0(2,3) ,IDWRT$ 

23800 GOTO 23840 

23805 FOR I%=1 TO 3:PRINT #2,LA(2,I%);TAB(10*(I%)):NEXT I% 

23810 FOR I%=1 TO 3:PRINT #2,L0(2,I%);TAB(10*(I%+3)):NEXT I% 

23815 PRINT #2,IDWRT$ 

23820 IF NOT LPON GOTO 23840 

23825 FOR I%=1 TO 3:LPRINT LA(2,I%);TAB(10*(I%)):NEXT I% 

23830 FOR I%=1 TO 3:LPRINT L0(2,I%);TAB(10*{I%+3)):NEXT I% 

23835 LPRINT IDWRT$ 

23840 NPT~k=NPTS%+1 

23845 IF FNSTK%(2)=3 OR FNSTK%(3)=1 THEN GOTO 23425 ELSE GOTO 23405 

23850 'internal subroutine menhit to return character from template 

23855 LOCATE 25,1:PRINT SPC(39); 

23860 IF XDB#<O OR YDB#<O GOTO 23935 'not in template 

23865 XMEN%=1:FOR I%=1 TO 10:IF XDB#<=.1*I% GOTO 23880 

23870 XMEN%=X~~EN%+1 :NEXT I% 

23875 GOTO 23935 'not in template 

23880 YMEN%=1:FOR I%=1 TO 4:IF YDB#<=.25*I% GOTO 23895 

23885 YMEN%=YMEN%+1:NEXT I% 

23890 GOTO 23935 'not in template 

23895 IF YMEN%=4 THEN CBTN$=CHR$(47+XMEN%):GOTO 23960 

23900 IF YMEN%>=2 THEN CBTN$=CHR${64+10*(3-YMEN%)+XMEN%) :GOTO 23960 

23905 IF XMEN%<=6 THEN CBTN$=CHR$(84+XMEN%):GOTO 23960 

23910 ON {11-XMEN%) GOTO 23915,23920,23925,23930 

23915 CBTN$=CHR$(42) :GOTO 23960 

23920 CBTN$=CHR$(35) :GOTO 23960 

23925 CBTN$=CHR$(43):GOTO 23960 

23930 CBTN$=CHR$(45):GOTO 23960 

23935 'error- not in template 

23940 IF PRM%(1)=2 GOTO 23955 

23945 LOCATE 25,1:COLOR 31 

23950 PRINT 11CURSOR NOT PLACED ON TEMPLATE. TRY AGAIN ... ;:COLOR 7 

Appendixes 33 
Appendix 1. Commented listing of all modules in JKDJGIT.BAS-Continued 

23955 IRET%=2:GOTO 23965 

23960 IRET%=1 

23965 RETURN 

24000 'subroutine to draw and update digitizer action table 

24005 • prm%(1)=entry point 

24010 • fnstk%(1)=coord type selection 

24015 ·================================================================= 

24020 • action table list 

24025 ·================================================================= 

24030 'initialize xx 

24035 'new id XX XX 

24040 'clear coords xx xx 

24045 'update npts xx xx 

24050 'update choices xx xx xx 

24055 'update coords xx xx 

24060 1Update id XX XX XX XX 

24065 ·================================================================= 

24070 'status I init I before I after I 1-push I id I verify I 

24075 • 1 oc 1 oc stream 1 oop 

24080 ·================================================================= 

24085 COLOR 15 

24090 ON PRM%(1) GOTO 24100,24260,24305,24270,24420,24305 

24095 'initialize 

24100 A$=CHR$(196) :B$=CHR$(179):WIDTH 40:CLS 

24105 • draw fonn 

24110 LOCATE 1,5:PRINT 11*** DIGITIZING ACTION TABLE***"; 

24115 LOCATE 2,1:PRINT STRING$(39,A$); 

24120 LOCATE 3,1:PRINT 11 DIG MODE:";:LOCATE 3,23:PRINT 11 ID MODE: 11; 

24125 LOCATE 4,1:PRINT 11 ID CONST: 11; :LOCATE 4,23:PRINT 11 NO PNTS: 11; 

24130 LOCATE 5,1:PRINT STRING$(39,A$); 

24135 LOCATE 10,1:PRINT STRING$(39,A$); 

24140 LOCATE 11,1:PRINT"GET NEW LOCATION"SPC(6) 11 HALT DIGITIZING11; 

24145 LOCATE 15,1:PRINT STRING$(39,A$); 

24150 LOCATE 16,1:PRINT 11 NEXT ID CHARACTER11 SPC(5) 11 END ID INPUT11; 

24155 LOCATE 20,1:PRINT STRING$(39,A$); 

24160 LOCATE 21,l:PRINT 11 ACCEPT POINT11 SPC(10) 11 REJECT POINT11; 

24165 FOR I%=11 TO 24:LOCATE I%,19:PRINT CHR$(179);:NEXT I% 

24170 'initialize header 

24175 IF LEN(IDCHR$)>10 THEN IDTOP$=MID$(IDCHR$,1,8)+ 11+? 11 ELSE IDTOP$=IDCHR$ 

24180 LOCATE 3,11:IF FNSTK%(3)=1 THEN PRINT 11 Stream11; ELSE PRINT 11 point 11; 

24185 LOCATE 3,32:PRINT MKR$(3,FNSTK%(2)); 

24190 LOCATE 4,11:PRINT SPC(10);:LOCATE 4,11:PRINT IDTOP$; 

24195 ON FNSTK%(1) GOTO 24200,24200,24215,24215,24200 

2 4 20 0 L ocATE 6 ' 1 : p RI NT II X : II ; 

24205 LOCATE 7 '1: PRINT II y: II; 

24210 GOTO 24225 

24215 LOCATE 6 '1: PRINT II LAT: II; 

34 JKDIGIT, A Program to Control a Digitizing Board 
Appendix 1. Commented listing of all modules in JKDIGIT.BAS-Continued 

24220 LOCATE 7 '1: PRINT II LON: II; 

24225 LOCATE 8,1:PRINT II ID: 11; 

24230 'initialize choices 

24235 COLOR 7 

24240 FOR I%=1 TO 3:FOR J%=1 TO 2:FOR K%=1 TO 3 

24245 LOCATE DATX%(I%,J%,K%) ,DATY%(I%,J%,K%) :PRINT DAT$(I%,J%,K%); 

24250 NEXT K%:NEXT J%:NEXT I% 

24255 GOTO 24430 

24260 'insert initial id in present id lac 

24265 COLOR 15:LOCATE 8,11:PRINT SPC(10); :LOCATE 4,11:PRINT IDTOP$; 

24270 'clear coordinate locations 

24275 LOCATE 6,8:PRINT SPC(32); 

24280 LOCATE 7,8:PRINT SPC(32); 

24285 LOCATE 8,8:PRINT SPC(32); 

24290 'update npts 

24295 LOCATE 4,32:PRINT NPTS%; 

24300 IF PRM%(1)=4 GOTO 24360 

24305 'update choices 

24310 FOR I%=1 TO 3: FOR J%=1 TO 2: FOR K%=1 TO 3 

24315 IF CLR%(I%,J%,K%)=15 GOTO 24325 

24320 IF CLO%(I%,J%,K%)=CLR%(I%,J%,K%) GOTO 24340 

24325 COLOR CLR%(I%,J%,K%) :LOCATE DATX%(I%,J%,K%) ,DATY%(I%,J%,K%) 

24330 PRINT DAT$(I%,J%,K%); 

24335 CLO%(I%,J%,K%)=CLR%(I%,J%,K%) 

24340 CLR%(I%,J%,K%)=7 

24345 NEXT K%:NEXT J%:NEXT I% 

24350 IF PRM%(1)=2 GOTO 24430 

24355 IF PRM%(1)=4 GOTO 24425 

24360 'update coordinates 

24365 COLOR 15 

24370 IF PR~h(1)=6 GOTO 24420 

24375 ON FNSTK%(1) GOTO 24380,24380,24395,24410,24380 

24380 LOCATE 6,8:PRINT X#; 

24385 LOCATE 7,8:PRINT Y#; 

24390 GOTO 24420 

24395 LOCATE 6,8:PRINT LA(2,3) ; 11 deg 11 ; 

24400 LOCATE 7,8:PRINT L0(2,3); 11 deg 11; 

24405 GOTO 24420 

24410 LOCATE 6,8:PRINT LA(2,1); 11 deg ";LA(2,2);" min 11 ;LA(2,3); 11 sec"; 

24415 LOCATE 7,8:PRINT L0(2,1);" deg ";L0(2,2) ;

11 min ";L0(2,3);" sec"; 

24420 'update present id 

24425 LOCATE 8,8:PRINT IDWRT$; 

24430 LOCATE 1,1,0:COLOR 7:RETURN 

24435 'digitizing halted- return to main driver 

24440 CLS:PRINT 11 DIGITIZING HALTED ... 24445 PRINT 11 PRESS ANY KEY TO RETURN TO MAl N MENU. 11 

24450 A$=INKEY$:IF A$="" THEN 24450 

Appendixes 35 
Appendix 1. Commented listing of all modules in JKDIGIT.BAS-Continued 

24455 WIDTH 80 

24460 PRINT #1, 11 #]I 11 'return digitizer to point mode 

24465 NSTK%=NSTK%-1:ISTK%=FNRET%(0):RETURN 

25000 REM ****************************************************************** 

25010 REM &&& SUBROUTINE JKINTVAR *** 

25020 REM *** INITIALIZES VARIABLES AND ARRAYS FOR DIGITIZER PROGRAM *** 

25030 REM ****************************************************************** 

25040 REM *** DATED: AUGUST 10, 1983 *** 

25050 REM ****************************************************************** 

25060 REM *** RETURNED VARIABLES *** 

25070 REM *** IRET% DIGITIZER CONNECTION CHECK ACTION *** 

25080 REM*** 1=0K,2=RETRY,3=EXIT FROM PROGRAM *** 

25090 REM *** OTHER VARIABLES *** 

25100 REM *** A$ KEYBOARD RESPONSE VARIABLE *** 

25110 REM *** BPON BEEP CHOICE INDICATOR *** 

25120 REM *** CDEG%(*) DEGREE OF REGRESSION MODELS *** 

25130 REM*** CLD%(*) COLORS INITIALIZED FOR ACTION TABLE ENTRIES *** 

25140 REM *** CLO%(*) COLORS FOR ACTION TABLE ENTRIES *** 

25150 REM *** CLR%(*) COLORS FOR ACTION TABLE ENTRIES *** 

25160 REM *** OAT$(*) ENTRIES FOR ACTION TABLE LAYOUT *** 

25170 REM *** DATX%(*) LOCATIONS FOR ACTION TABLE ENTRIES *** 

25180 REM *** DATY%(*) LOCATIONS FOR ACTION TABLE ENTRIES *** 

25190 REM *** FALSE LOGICAL VALUE *** 

25200 REM*** I%,J%,K% LOOP INDICES *** 

25210 REM*** INCR$(*) INCREMENTS FOR MAIN MENU DISPLAY *** 

25220 REM *** INCR% PRESENT INCREMENT CHOICE *** 

25230 REM*** INCS$(*) INCREMENT CODES FOR SENDING TO DIGITIZER *** 

25240 REM *** LPON LINE PRINTER OPTION INDICATOR *** 

25250 REM*** M1$(*) MAIN MENU CHOICE ARRAY *** 

25260 REM*** M1% NUMBER OF MAIN MENU CHOICES AVAILABLE *** 

25270 REM*** MDF%(*) DEFAULT CHOICES FOR MAIN MENU OPTIONS *** 

25280 REM *** MKR$(*) MARKERS SHOWING PRESENT MAIN MENU CHOICES *** 

25290 REM *** MPRM% NUMBER OF ~1AI N MENU CHOICES (EXCEPT QUIT) *** 

25300 REM*** MSEL%(*) PRESENT MAIN MENU SELECTIONS *** 

25310 REM *** PRM%(*) PARAMETER PASSING ARRAY *** 

25320 REM *** RNUM%(*) NUMBER OF TERMS IN REGRESSION MODELS *** 

25330 REM *** ST$(*) ARRAY OF PRESENT STATUS MASKS *** 

25340 REM*** TNE$ BUFFER EMPTY TUNE (SAINTS GO MARCHING IN) *** 

25350 REM*** TNF$ BUFFER FULL TUNE (VOLGA BOATMAN) *** 

25360 REM *** TRUE LOGICAL VALUE *** 

25370 REM *** XROUND# X ROUNDOFF FACTOR *** 

25380 REM *** YROUND# Y ROUNDOFF FACTOR *** 

25390 REM *** STACK VARIABLES AND FUNCTIONS *** 

25400 REM*** FNRET%(),FNSTK%(),ISTK%,NSTK% *** 

25410 REM *** SUBROUTINES CALLED *** 

25420 GOTO 25450 

25430 GOTO 1000 'subroutine jknuminp 

36 JKDIGIT, A Program to Control a Digitizing Board 

*** 
Appendix 1. Commented listing of all modules in JKDIGIT.BAS-Continued 

25440 REM ****************************************************************** 

25450 •initialize MDF% to default main menu parameter values 

25460 MPRf'fh=14:M1%=MPRtfh+1 :KEY OFF 

25470 DATA 6,2,5,2,2,2,2,2,2,2,2,2,2,2 

25480 •selection symbols 

25490 DATA 11 XY REAL 11 , 11 XY INT11 ,

11 DECDEG 11 ,

11 DEGMS 11

,

11 BOARD 11

,

11 NOT SELECTED 11 

25500 DATA 11 SCALED 11 '

11 NOT SCALED 11 

25510 DATA 11KEYBOARD 11, 11 BUTTON 11, 11 1 PUSH 11,

11TEMPLATE11

,

11 NOT SELECTED 11 

25520 DATA 11 FILE OPEN- 11 '

11 NOT SELECTED 11 

'

11LOCATED 11 

'

11 NOT LOCATED 11 

25530 DATA 11 SELECTED 11, 11 DEFAULT11, 11 VALIDATED 11,

11 NOT VALIDATED 11 

25540 DATA 11 SAVED IN- 11,

11 NOT SAVED 11 

25550 DATA 11 SAVED IN- 11 , 11 NOT SAVE0 11 ,

11 NO BEEP 11

,

11BEEP 11

,

11 LPRINT11

,

11 NO LPRINT11 

25560 DATA 11 SELECTE0 11 '

11 DEFAULT11 

'

11DIGITIZING 11 

'

11 NOT DIGITIZING 11 

25570 DATA 11 DIGITIZING11 ,

11 NOT DIGITIZING11 

25580 DATA 11 01 11 , 11 02 11 , 11 0: 11 ,

11 1411 , 11 28 11 , 11 32 11 ,11 3< 11 , 11 3? 11 

25590 DATA 11 .00511 , 11 .01 11 , 11 .0511 , 11 .1011 , 11 .2011 ,

11 .2511 ,

11 .3011 ,

11 .31511 

25600 DATA 11Crsr button 11 ,

11Crsr move 11 ,

1111 ,

11 kybd *11 ,11Crsr *11 ,

11 template * 11 

25610 DATA 11 kybd {not CR) 11 , 11Crsr (not #,*) .. ,"template {not #,*) 11 

25620 DATA 11 kybd CR11 '

11Crsr #11 

'

11 template #11 

'

11 kybd Y11 

'

11Crsr 011 

'

11 template 011 

25630 DATA 11 kybd N11 , 11Crsr (not 0,*) 11 , 11 template (not 0,*) 11 

25640 DATA 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7 

25650 DATA 12,13,14,12,13,14,17,18,19,17,18,19,22,23,24,22,23,24 

25660 DATA 4,4,4,26,26,26,4,4,4,26,26,26,4,4,4,26,26,26 

25670 TSTK%=20:ISTK%=0:NSTK%=0 

25680 TRUE=-1:FALSE=NOT TRUE 

25690 FOR I%=1 TO MPRM% 

25700 READ MDF%(I%) 

25710 MSEL%(I%)=MDF%(I%) 

25720 NEXT I% 

25730 FOR I%=1 TO MPRM% 

25740 FOR J%=1 TO MDF%(I%) 

25750 READ MKR$(I%,J%) 

25760 NEXT J% 

25770 NEXT I% 

25780 FOR I%=1 TO 8:READ INCS$(I%):NEXT I% 

25790 FOR I%=1 TO 8:READ INCR$(I%) :NEXT I% 

25800 FOR I%=1 TO 3:FOR J%=1 TO 2:FOR K%=1 TO 3 

25810 READ DAT${I%,J%,K%) :NEXT K%:NEXT J%:NEXT I% 

25820 FOR I%=1 TO 3:FOR J%=1 TO 2:FOR K%=1 TO 3 

25830 READ CLD%{I%,J%,K%):CLO%{I%,J%,K%)=CLD%(I%,J%,K%) 

25840 CLR%(I%,J%,K%)=CLD%(I%,J%,K%):NEXT K%:NEXT J%:NEXT I% 

25850 FOR I%=1 TO 3:FOR J%=1 TO 2:FOR K%=1 TO 3 

25860 READ DATX%(I%,J%,K%):NEXT K%:NEXT J%:NEXT 1% 

25870 FOR I%=1 TO 3:FOR J%=1 TO 2:FOR K%=1 TO 3 

25880 READ DATY%(1%,J%,K%):NEXT K%:NEXT J%:NEXT I% 

25890 M1${1)= 11 Select Coordinate Type 11 

25900 M1$(2)="Get Scaling Matrix .. 

Appendixes 37 
Appendix 1. Commented listing of all modules in JKDIGIT.BAS-Continued 

25910 M1${3)="Select ID Type" 

25920 M1${4)="Select Output File Name" 

25930 M1${5)="Get Template Location Parameters" 

25940 M1${6)="Select Roundoff Values" 

25950 M1${7)="Validate Scaling" 

25960 M1${8)="Save Coordinate Scaling Parameters" 

25970 M1$(9)="Save Template Scaling Parameters" 

25980 M1$(10)="Select Beep Option" 

25990 M1$(11)="Select Printer Option" 

26000 M1$ ( 12) ="Select Switch Stream Increment" 

26010 M1$( 13)="Start Point Mode Digitizing" 

26020 M1$(14)="Start Switch Stream Mode Digitizing" 26030 M1$(15)="Quit" 

26040 ST$(1)="100000000000001":ST$(2)="110000000000001" 

26050 ST$(3)="111100000000001 11 :ST$(4)="111110000000001" 

26060 ST$(5)="111111111111111" 

26070 RNUM%(1)=3:RNUM%(2)=6:RNUM%(3)=10 

26080 XROUND#=.0000001#:YROUND#=.0000001#:CDEG%(0)=0:1NCR%=4 

26090 OPEN "COM1:9600,N,8,2,RS,CS,DS11 AS 1 

26100 PRINT #1,"#]b11 

26110 PRINT #1,"#]1 11 

26120 PRM%(0)=1:PRM%(1)=6:GOSUB 1000 

26130 ON IRET% GOTO 26140,26100,26240 

26140 ON ERROR GOTO 26250 

26150 WHILE NOT EOF(1) 

26160 A$=I~PUT$(LOC(1),#1) 

26170 WEND 

26180 ON ERROR GOTO 0 

26190 A$="FDMLGMNGMLDDMND" 

26200 TNF$="MF01"+A$+"E"+A$ 

26210 A$="MSCEFMLGGGGMNG" 

26220 TNE$="MFL803 11+A$+A$ 

26230 BPON=TRUE:LPON=FALSE 

26240 RETURN 

'send beep request 

'go to point mode 

• gosub j knumi np 

'device error retry 

26250 RESUME 'device error retry 

27000 REM ********************************************************************* 

27005 REM &&& SUBROUTINE JKSCLCTL *** 

27010 REM *** CONTROL FOR SCALING FOR DIGITIZER PROGRAM *** 

27015 REM ********************************************************************* 

27020 REM*** DATED: AUGUST 10, 1983 *** 

27025 REM ********************************************************************* 

27030 REM*** INPUT VARIABLES *** 

27035 REM *** PRM%(0) NUMBER OF OTHER PARAMETERS *** 

27040 REM*** PRM%(1) COORDINATE TYPE CHOICE *** 

27045 REM *** (0 FOR TEMPLATE SCALING) *** 

27050 REM *** RETURNED VARIABLES *** 

27055 REM *** IRET% COMPLETION VARIABLES *** 

38 JKDIGIT, A Program to Control a Digitizing Board 
Appendix 1. Commented listing of all modules in JKDIGIT.BAS-Continued 

27060 REM*** !=COMPLETED, NOT READ FROM FILE 

27065 REM*** 2=COMPLETEO, READ FROM FILE 

27070 REM*** 3=FAILED, ERROR OTHER THAN FILE READ 

27075 REM*** 4=FAILED, ERROR IN FILE READ 

27080 REM *** 5=NO CHANGE 

27085 REM*** SCALING FACTORS (TEMPLATE=O,COORDINATE=l) 

27090 REM*** CDEG%( .) DEGREE OF REGRESSION MODEL 

27095 REM*** XBOFF(.) ,YBOFF(.) BOARD COORDINATE OFFSET 

27100 REM*** XUOFF#(.),YUOFF#(.) USER COORDINATE OFFSET 

27105 REM*** CX#(I,.),CY#{I,.) REGRESSION COEFFICIENTS 

27110 REM *** SFIL$ COORDINATE SCALING PARAMETER SAVE FILE NAME 

27115 REM *** MFIL$ TEMPLATE SCALING PARAMETER SAVE FILE NAME 

27120 REM *** OTHER VARIABLES 

27125 REM *** A#{*) ARRAY OF REGRESSION COEFFICIENTS RETURNED 

27130 REM *** FROM SUBROUTINE JKREGRES 

27135 REM*** A$ KEYBOARD INPUT CHARACTER 

27140 REM *** AX#{*) ARRAY OF BOARD COORDINATES SENT TO 

27145 REM *** REGRESSION SUBROUTINE 

27150 REM *** I%,J% LOOP INDEX VARIABLES 

27155 REM*** ITRM'h TEMP NU~1BER OF TERMS IN REGRESSION 

27160 REM *** MPTS% NUMBER OF REGISTRATION POINTS 

27165 REM*** MSGT$(*) LINES FOR TOP OF MENU 

27170 REM *** MSGT% NUMBER OF LINES FOR TOP OF MENU 

27175 REM *** MSK$ MASK FOR HIGHLIGHTING MENU OPTIONS 

27180 REM *** PRM2$ FILE NAME RETURNED FROM SUBROUTINE JKFILPRM 

27185 REM*** RNUM%{*) NU~1BER OF TERMS IN REGRESSION MODEL . 27190 REM *** TDEG% TEMP STORAGE FOR DEGREE OF REGRESSION MODEL 

27195 REM*** TX#(*) BOARD COORD! NATES OF REGISTRATION POINTS 

27200 REM *** TY#{*) BOARD COORDINATES OF REGISTRATION POINTS 

27205 REM *** STACK VARIABLES AND FUNCTIONS 

27210 REM*** FNRET%{),FNSTK%{),ISTK%,NSTK% 

27215 REM *** SUBROUTINES CALLED 

27220 GOTO 27260 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

27225 GOSUB 1000 • subroutine j knumi no *** 

27230 GOSUB 15000 'subroutine jkfilprm *** 

27235 GOSUB 28000 'subroutine jkregres *** 

27240 GOSUB 29000 'subroutine jksclcrd *** 

27245 GOSUB 31000 'subroutine jksclkey *** 

27250 GOSUB 35000 'subroutine jkstack *** 

27255 REM ********************************************************************* 

27260 GOSUB 35000 'gosub jkstack 

27265 IF FNSTK%(1) <> 5 GOTO 27290 

27270 'case for raw board coordinates 

27275 CDEG%{1)=l:XBOFF{l)=O:YBOFF{l)=O:XUOFF#{l)=O:YUOFF#{l)=O 

27280 FOR I%=0 TO 9:CX#(I%,l)=O:CY#{I%,l)=O:NEXT I% 

27285 CX#{l,l)=l:CY#{2,1)=l:GOTO 27490 

27290 'get scaling type 

Appendixes 39 
Appendix 1. Commented listing of all modules in JKDIGIT.BAS-Continued 

27295 MSK$="1110001" 

27300 IF FNSTK%(1)=0 THEN MSGT$(1)="TEMPLATE PLACEMENT SCALING .. :GOTO 27315 

27305 MSGT$( 1 )= 11 COORDI NATE SCALING11 

27310 IF FNSTK%(1)=3 OR FNSTK%{1)=4 THEN MSK$= 11 1111111 11 

27315 MSGT%=1 

27320 PRM%{0)=1:PR~h(1)=2:GOSUB 1000 

27325 IF IRET%=7 THEN IRET%=5:GOTO 27520 

27330 ON !RET% GOTO 27335,27340,27365,27365,27365,27365 

27335 PRM%(0)=1:PRM%(1)=FNSTK%{1) :GOSUB 31000:GOTO 27490 

27340 IF FNSTK%{1)=0 THEN PRM%{2)=1 ELSE PRM%{2)=2 

27345 PRM%{0)=3:PRM%(1)=2:PRM%(3)=FNSTK%(1) :GOSUB 15000 

27350 IF IRET%=2 THEN IRET%=4:GOTO 27520 

27355 IF FNSTK%(1) <> 0 THEN SFIL$=PRM2$ ELSE MFIL$=PRM2$ 

27360 IRET%=2:GOTO 27520 

• gosub j knumi np 

• gosub j ksc 1 key 

• gosub j kfi 1 prm 

27365 'get degree of regression model and prepare for coordinate entry 

27370 IF IRET%>3 THEN TDEG%=3:CDEG%(1)=3:ITRM%=10:PRM%(2)=IRET%-3:GOTO 27405 

27375 IF FNSTK%{1) <> 0 GOTO 27385 

27380 TDEG%=1:CDEG%(0)=TDEG%:ITRM%=3:GOTO 27405 

27385 PRM%(0)=1:PRM%{1)=7:GOSUB 1000 

'case for template scaling 'coordinate scaling 

27390 IF IRET%=4 THEN IRET%=5:GOTO 27520 

27395 TDEG%= !RET%: CDEG%( 1) =TDEG%: ITRf'.fh=RNUM%{ TDEG%) : PRM%{ 2) =0 

27400 'gosub jksclcrd to get coordinates for registration 

27405 PRM%(0)=2:PRM%(1)=FNSTK%(1) :GOSUB 29000 

27410 IF IRET%=2 GOTO 27365 

• gosub j kscl crd 

27415 'calculate regression coefficients 

27420 PRINT:PRINT "CALCULATING X-REGRESSION COEFFICIENTS-\~AIT{up to 1 minute)." 

27425 FOR 1%=1 TO MPTS%:AX#{I%,ITRM%)=TX#{I%):NEXT I% 

27430 PRM%{0)=2:PRM%{1)=MPTS%:PRM%(2)=ITRM%:GOSUB 28000 

27435 IF !RET% <> 1 GOTO 27500 

27440 IF FNSTK%(1) <> 0 THEN J%=1 ELSE J%=0 

'gosub jsregres 

27445 FOR I%=1 TO ITR~-1:CX#{I%,J%)=A#(ITRM%,I%) :NEXT I% 

27450 CX#{O,J%)=A#{ITRM%,ITRM%+1) 27455 PRINT:PRINT 11CALCULATING Y-REGRESSION COEFFICIENTS-WAIT{up to 1 minute)." 

27460 FOR I%=1 TO MPTS%:AX#{I%,ITRM%)=TY#{I%):NEXT I% 

27465 PR~h{0)=2:PRM%(1)=MPTS%:PR~R{2)=ITRM%:GOSUB 28000 

27470 IF IRET% <> 1 GOTO 27500 

27 4 7 5 IF FNSTK% ( 1) <> 0 THEN J%=1 ELSE J%=0 

27480 FOR I%=1 TO ITRM%-1:CY#{I%,J%)=A#{ITRM%,1%):NEXT I% 

27485 CY#{O,J%)=A#{ITRM%,ITRM%+1) 

27490 IRET%=1:GOTO 27520 

'gosub jsregres 

27495 'signal numerical error and retry 27500 COLOR 15 :PRINT 11 SERIOUS NUMERICAL ERROR CALCULATING REGRESSION." 

27505 PRINT 11 PRESS ANY KEY TO START SCALING OVER ... 27510 A$=I NKEY$: IF A$=" 11 GOTO 27510 

27515 GOTO 27265 

27520 NSTK%=NSTK%-1:ISTK%=FNRET%{0):RETURN 

28000 REM ******************************************************************* 

40 JKDIGIT, A Program to Control a Digitizing Board 
Appendix 1. Commented listing of all modules in JKDIGIT.BAS-Continued 

28010 REM &&& SUBROUTINE JKREGRES *** 

28020 REM *** CALCULATES REGRESSION COEFFICIENTS-USES BEATON SWEEP *** 

28030 REM ******************************************************************* 

28040 REM*** DATED AUGUST 10, 1983 *** 

28050 REM ******************************************************************* 

28060 REM *** INPUT VARIABLES *** 

28070 REM *** PRM%(0) NUMBER OF OTHER PARAMETERS *** 

28080 REM*** PRM%(1) NUMBER OF DATA POINTS *** 

28090 REM *** PRM%(2) NUMBER OF TERMS IN REGRESSION MODEL *** 

28100 REM *** AX# (.) ARRAY-AUG~£NTED DATA MATRIX ( NPTS x ITRMt+1) *** 

28110 REM *** RETURNED VARIABLES 

28120 REM*** IRET% STATUS VARIABLE (1=NO ERROR, 2=ERROR) 

28130 REM*** A#(.,.) SWEPT COVARIANCE MATRIX 

28140 REM *** OTHER VARIABLES 

28150 REM*** I%,J%,K%,L% : LOOP INDEX VARIABLES 

28160 REM *** N% NUMBER OF PIVOTS 

28170 REM *** NDIM% DIMENSION OF AUGMENTED COVARIANCE MATRIX 

28180 REM*** P%(*) ARRAY OF INDICES FOR FINDING LARGEST PIVOT 

28190 REM *** V~~AX LARGEST REMAINING PIVOT VALUE 

28200 REM *** STACK VARIABLES AND FUNCTIONS 

28210 REM*** FNRET%(),FNSTK%(),ISTK%,NSTK% 

28220 REM SUBROUTINES CALLED 

28230 GOTO 28270 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

*** 

28240 GOSUB 28480 •subroutine jksweep- internal *** 

28250 GOSUB 35000 •subroutine jkstack *** 

28260 REM ******************************************************************* 

28270 IF PRM%(0) <> 2 THEN PRINT 11FATAL PARAMETER ERROR 11 :STOP 

28280 GOSUB 35000:IRET%=1 

28290 NDIM%=FNSTK%(2)+1:N%=FNSTK%(1) 

28300 •calculate augmented raw product matrix 

28310 FOR I%=1 TO NDIM%:FOR J%=1 TO NDIM%:A#(I%,J%)=0! 

28320 FOR K%=1 TO N% 

28330 A#(I%,J%)=A#(I%,J%)+AX#(K%,I%)*AX#(K%,J%) 

28340 NEXT K%:NEXT J%:NEXT I% 

•gosub jkstack 

28350 •sweep last row/col to calculate augmented covariance matrix 

28360 K%=NDIM%:GOSUB 28480:IF !RET% <> 1 GOTO 28470 •gosub jksweep 

28370 •sweep to calculate regression coefficients- choosing largest pivots 

28380 N%=FNSTK%(2)-1:FOR I%=1 TO N%:P%(I%)=I%:NEXT I% 

28390 VMAX=ABS(A#(P%(1),P%(1))):K%=P%(1):L%=1:IF N%=1 GOTO 28430 

28400 FOR I%=2 TO N%:IF ABS(A#(P%(I%),P%(I%))) <= VMAX GOTO 28420 

28410 VMAX=ABS(A#(P%( I%) ,P%( I%))) :K%=P%(J%) :L%=I% 

28420 NEXT I% 

28430 GOSUB 28480:IF !RET% <> 1 GOTO 28470 • gosub j ksweep 

28440 N%=N%-l:IF N%=0 THEN GOTO 28470 

28450 IF L%=N%+1 GOTO 28390 

28460 FOR I%=L% TO N%:P%(I%)=P%(I%+1):NEXT I%:GOTO 28390 

28470 NSTK%=NSTK%-1:ISTK%=FNRET%(0):RETURN 

Appendixes 41 
Appendix 1. Commented listing of all modules in JKDIGIT.BAS-Continued 

28480 • internal subroutine jksweep to sweep matrix a#(.,.} by row/col k% 

28490 ON ERROR GOTO 28630 

28500 A#(K%,K%}=-1!/A#(K%,K%} 

28510 FOR 1%=1 TO NDH~:IF I%=K% GOTO 28530 

28520 A#(I%,K%}=-A#(I%,K%}*A#(K%,K%} 

28530 NEXT 1% 

28540 FOR 1%=1 TO NDIM%:FOR J%=1 TO NDIM%:IF I%=K% OR J%=K% GOTO 28560 

28550 A#(I%,J%}=A#(I%,J%}-A#(I%,K%}*A#(K%,J%} 

28560 NEXT J%:NEXT I% 

28570 FOR J% = 1 TO NOIMt 

28580 IF J% = K% GOTO 28600 

28590 A#(K%,J%}=-A#(K%,J%}*A#(K%,K%} 

28600 NEXT J% 

28610 IRET%=1:GOTO 28640 

28620 'signal error for return 

28630 IRET%=2:0N ERROR GOTO O:RESUME 28640 

28640 RETURN 

29000 REM ********************************************************************* 

29010 REM &&& SUBROUTINE JKSCLCRD *** 

29020 REM *** GETS BOARD AND USER COORDINATES FOR REGISTRATION POINTS *** 

29030 REM ********************************************************************* 

29040 REM *** DATED: AUGUST 10, 1983 *** 

29050 REM ********************************************************************* 

29060 REM *** INPUT VARIABLES *** 

29070 REM*** PRM%(0) NUMBER OF OTHER PARAMETERS *** 

29080 REM*** PRM%(1} COORDINATE TYPE CHOICE *** 

29090 REM *** (0 FOR TEMPLATE SCALING} *** 

29100 REM*** PRM%(2} QUAD REGISTRATION SELECTION INDICATOR *** 

29110 REM*** 0 = NO QUAD - MUST INPUT ALL USER COORDS *** 

29120 REM*** 1=7.5 MIN QUAD, 2=15 MIN QUAD, 3=2 DEG SHEET *** 

29130 REM *** TDEG% DEGREE OF REGRESSION MODEL *** 

29140 REM *** ITRM% NO OF TERMS IN REGRESSION MODEL *** 

29150 REM *** RETURNED VARIABLES *** 

29160 REM *** IRET% COMPLETION VARIABLES *** 

29170 REM*** (1=COMPLETED, 2=NOT COMPLETED} *** 

29180 REM*** AX#(.,.} COORDINATE MATRIX FOR DEPENDENT VARIABLES *** 

29190 REM*** TX#(} ,TV#(} DEPENDENT VARIABLES FOR REGRESSION *** 

29200 REM *** SCALING FACTORS (0 FOR TEMPLATE, 1 FOR COORDINATE} *** 

29210 REM *** CDEG%(.} DEGREE OF REGRESSION MODEL *** 

29220 REM*** XBOFF(.},YBOFF(.} BOARD COORDINATE OFFSET *** 

29230 REM*** XUOFF#( .},YUOFF#(.) USER COORDINATE OFFSET *** 

29240 REM *** OTHER VARIABLES *** 

29250 REM *** A$ KEYBOARD INPUT VARIABLE *** 

29260 REM *** CBTN$ RETURNED CURSOR BUTTON CHARACTER *** 

29270 REM*** I%,J%,K%,L% : LOOP INDEX VARIABLES *** 

29280 REM *** LA(*) LATITUDE ARRAY *** 

29290 REM *** LO(*) LONGITUDE ARRAY *** 

42 JKDIGIT, A Program to Control a Digitizing Board 
Appendix 1. Commented listing of all modules in JKDIGIT.BAS-Continued 

29300 REM *** MPTS% NUMBER OF REGISTRATION POINTS *** 

29310 REM*** MSGB$(*): MESSAGE LINES FOR BOTTOM OF MENU *** 

29320 REM*** MSGT$(*): MESSAGE LINES FOR TOP OF ~~ENU *** 

29330 REM *** NMAX% MAX ALLOWABLE NUMBER OF REGISTRATION POINTS *** 

29340 REM *** TMP FACTOR FOR CALCULATING GEOGRAPHIC COORDINATES *** 

29350 REM*** TMP1 FACTOR FOR CALCULATING GEOGRAPHIC COORDINATES *** 

29360 REM*** XI,YI RAW BOARD COORDINATES RETURNED *** 

29370 REM *** STACK VARIABLES AND FUNCTIONS *** 

29380 REM*** FNRET%(),FNSTK%(),ISTK%,NSTK% *** 

29390 REM *** SUBROUTINES CALLED *** 

29400 GOTO 29460 

29410 GOSUB 21000 'subroutine jkdigbrd *** 

29420 GO SUB 30070 'subroutine getxy - internal *** 

29430 GOSUB 30590 'subroutine getgeo - internal *** 

29440 GOSUB 35000 'subroutine jkstack *** 

29450 REM ********************************************************************* 

29460 IF PRM%(0) <> 2 THEN PRINT "FATAL PARAMETER ERROR":STOP 

29470 GOSUB 35000:IRET%=2 'gosub jkstack 

29480 IF FNSTK%(1) <> 0 GOTO 29620 

29490 'case for menu sealing 

29500 MSGT$(1)=" LOWER LEFT ":MSGT$(2)=" LOWER RIGHT ":MSGT$(3)=" UPPER LEFT 11 

29510 CLS:PRINT "*****DIGITIZING TD~PLATE SCALING BOARD COORDINATES*****" 

29511 PRINT 

29520 FOR I%=1 TO 3 :PRINT "DIGITIZE" ;MSGT$( I%); "TEMPLATE CORNER" 

29530 GOSUB 21000:BEEP 'gosub jkdigbrd 

29540 IF I% <> 1 GOTO 29560 

29550 XBOFF(O)=XI:YBOFF(O)=YI:AX#(I%,1)=0:AX#(I%,2)=0:GOTO 29570 

29560 AX#(I%,1)=XI-XBOFF(O):AX#(I%,2)=YI-YBOFF(O) 

29570 AX#(I%,4)=1:NEXT I% 

29580 MPTS%=3 

29590 XUOFF#(O)=O:YUOFF#(O)=O 

29600 TX#(1)=0:TY#(1)=0:TX#(2)=1:TY#(2)=0:TX#(3)=0:TY#(3)=1 

29610 GOTO 30710 

29620 'case for coordinate scaling 

29630 'get registration board coordinates 

29640 CLS:PRINT "***** DIGITIZING REGISTRATION POINT BOARD COORDINATES*****" 

29650 NMAX%=25:IF FNSTK%(2)=0 GOTO 29730 

29660 IF FNSTK%(2)=1 OR FNSTK%{2)=2 THEN NMAX%=16 ' 

29670 PRINT:PRINT"***** SPECIAL REGISTRATION - 2 DEG SHEET OR 7.5 ,15 MIN QUAD" 

29680 PRINT: PRINT "YOU MUST DIGITIZE ALL THE TICK MARKS IN ORDER:" 

29690 PRINT "BY ROWS FROM LOWER LEFT TO UPPER RIGHT ON THE MAP." 

29700 PRINT "16 POINTS FOR 7.5 OR 15 MIN QUAD, 25 POINTS FOR 2 DEG SHEET" 

29710 PRINT "FOR 2 OEG SHEET, OELTA=30 t~IN HORIZ: 15 ~UN VERT" 

29720 PRINT 

29730 I%=0 

29740 WHILE I% < NMAX% 

29750 I%=I%+1:PRINT USING "&##";"DIGITIZE REGISTRATION POINT NUMBER: ";I% 

Appendixes 43 
Appendix 1. Commented listing of all modules in JKDIGIT.BAS-Continued 

29760 GOSUB 21000:BEEP •gosub jkdigbrd 29770 IF CBTN$ = II: II GOTO 29870 

29780 IF I% <> 1 GOTO 29800 

29790 XBOFF(1)=XI:YBOFF(1)=YI 

29800 AX#(I%,1)=XI-XBOFF(1):AX#(I%,2)=YI-YBOFF(1):IF TDEG% = 1 GOTO 29850 

29810 AX#(I%,3)=AX#(I%,1)*AX#(I%,1):AX#(I%,4)=AX#(I%,1)*AX#(I%,2) 

29820 AX#(I%,5)=AX#(I%,2)*AX#(I%,2):IF TDEG% = 2 GOTO 29850 

29830 AX#(I%,6)=AX#(I%,1)*AX#(I%,3):AX#(I%,7)=AX#(I%,1)*AX#(I%,4) 

29840 AX#(I%,8)=AX#(I%,1)*AX#(I%,5):AX#(I%,9)=AX#(I%,2)*AX#(I%,5) 

29850 AX#(I%,ITRMt+1)=1 

29860 WEND 

29870 IF CBTN$= 11 : 

11 THEN MPTS%=I%-1 ELSE MPTS%=I% 

29880 IF MPTS% >= ITRM% GOTO 29930 

29890 PRINT 11 NO. OF REGISTRATION POINTS IS 11 ;MPTS% 

29900 PRINT:PRINT 11 NOT ENOUGH FOR REGRESSION DEGREE 11 ;ITRM% 

29910 PRINT:PRINT 11 PRESS ANY KEY TO RETURN TO REGRESSION MODEL MENU ... 29920 A$=I NKEY$: IF A$= 1111 GOTO 29920 ELSE GOTO 30720 

29930 •get user coordinates of registration points 29940 •case for x-y coordinates 

29950 ON FNSTK%(1) GOTO 29960,29960,30110,30110 

29960 FOR I%=1 TO MPTS%:PRINT:GOSUB 30070:NEXT I% •gosub getxy 

29970 CLS:PRINT 11 *** VERIFICATION OF USER COORDINATES FOR REGISTRATION ***11 

29980 PRINT 11 number 11 ;TAB(20); 11 x-horizontal 11 ;TAB(40); 11 y-vertical 11 :PRINT 

29990 FOR I%=1 TO MPTS%:PRINT I%;TAB(20);TX#(I%);TAB(40);TY#(I%) 30000 NEXT I% 

30010 PRINT:PRINT 11 INSERT POINT NUMBER OF ANY CORRECTION NEEDED. 11 

30020 PRINT II INSERT 0 IF ALL ARE OK. II: INPUT I% 

30030 IF I% >= 0 AND I% <= MPTS% GOTO 30050 

30040 PRINT:PRINT 11 PLEASE INSERT AN INTEGER BETWEEN 0 AND 11 ;MPTS%:GOTO 30010 

30050 IF I%=0 GOTO 30670 

30060 GOSUB 30070:GOTO 29970 

30070 •internal subroutine to get user x,y for i-th point 

30080 PRINT 11 INSERT X-HORIZONTAL COORDINATE FOR POINT NO 11 ;I%; :INPUT TX#(I%) 

30090 PRINT 11 INSERT Y-VERTICAL COORDINATE FOR POINT NO 11 ;I%;:INPUT TY#(I%) 30100 RETURN . 30110 •get geographic user coordinates of registration points 30120 IF FNSTK%(1)=4 GOTO 30140 

30130 NMAX%=1:MSGT$(1)= 11 (decimal degrees): 11 :GOTO 30160 

30140 NMAX%=3:MSGT$(1)= 11 (integer degrees): 11 :MSGT$(2)= 11 (integer minutes): 11 

30150 MSGT$(3)= 11 (real seconds): .. 30160 CLS: IF FNSTK%(2)=0 GOTO 30280 

30170 I%=1:PRINT 11 INSERT COORDINATES FOR LOWER LEFT (SW) CORNER OF MAP ... 30180 PRINT:GOSUB 30590 •gosub getgeo- internal 

30190 L%=4:TMP=.0416667:TMP1=TMP 

30200 IF FNSTK%(2)=3 THEN L%=5:TMP=.166667:TMP1=TMP/2 

30210 FOR I%=0 TO L%-1:FOR J%=1 TO L% 

30220 K%=I%*L%+J% 

44 JKDIGIT, A Program to Control a Digitizing Board 
Appendix 1. Commented listing of all modules in JKDIGIT.BAS-Continued 

30230 LA(K%,1)=LA(1,1)+TMP1*FNSTK%(2)*I% 

30240 LA( K% ,2) =LA( 1 ,2) :LA( K% ,3) =LA( 1 ,3) 

30250 LO(K%,1)=L0(1,1)-TMP*FNSTK%{2)*{J%-1) 

30260 LO(K%,2)=L0(1,2) :LO(K%,3)=L0(1,3) 

30270 NEXT J%:NEXT I%:GOTO 30520 

30280 FOR I%=1 TO MPTS% 

30290 GOSUB 30590 'gosub getgeo - internal subroutine 

30300 NEXT I% 

30310 'verify user coords are ok 

30320 CLS:PRINT 11 *** VERIFICATION OF USER COORDINATES FOR REGISTRATION *** 11 

30330 MSGB$(1)= 11' number":MSGB$(2)= 11 lat deg 11 :MSGB$(3)= 11 lat min 11 

30340 MSGB$(4)= 11 lat sec'~:MSGB$(5)= 11 lon deg 11 :MSGB$(6)= 11 lon min 11 

30350 MSGB$(7)= 11 lon sec .. 30360 IF FNSTK%(1)=3 GOTO 30400 

30370 K%=1:FOR I%=1 TO 7 

30380 PRINT MSGB${I%);TAB(10*I%):NEXT I% 

30390 PRINT:GOTO 30410 

30400 K%=2:PRINT MSGB$(1);TAB{20);MSGB$(2);TAB(40);MSGB$(5) 

30410 FOR I%=1 TO MPTS% 

30420 PRINT I%;TAB{K%*10) 

30430 FOR J%=1 TO NMAX%:PRINT LA(I%,J%);TAB(10*K%*(J%+1)):NEXT J% 

30440 FOR J%=1 TO NMAX%:PRINT LO(I%,J%);TAB{10*K%*(J%+1+NMAX%)) :NEXT J% 

30450 PRINT:NEXT I% 

30460 PRINT:PRINT 11 INSERT THE POINT NUMBER OF ANY CORRECTION NEEDE0. 11 

30470 PRINT 11 INSERT 0 IF ALL ARE OK. 11 

30480 INPUT I%:IF I%>=0 AND I%<=MPTS% GOTO 30500 

30490 PRINT 11 PLEASE INSERT AN INTEGER BETWEEN 0 AND 11 ;MPTS%:GOTO 30480 

30500 IF I% = 0 GOTO 30520 

30510 CLS:GOSUB 30590:GOTO 30310 'gosub jkgetgeo- internal subroutine 

30520 FOR I%=1 TO MPTS%:TX#{I%)=0:TY#(I%)=0 

30530 FOR J%=1 TO NMAX% 

30540 TY#{I%)=TY#{I%)+LA(I%,J%)/(6a={J%-1)) 

30550 TX#{I%)=TX#{I%)+LO(I%,J%)/{6a=(J%-1)) 

30560 NEXT J% 

30570 NEXT I% 

30580 GOTO 30670 

30590 'internal subroutine to get user lat/lon for point i 

30600 FOR J%=1 TO NMAX% 

30610 PRINT 11 INSERT LATITUDE 11 ;MSGT${J%); 11 FOR REGISTRATION POINT NUMBER 11 ;I% 

30620 INPUT LA(I%,J%) :NEXT J% 

30630 FOR J%=1 TO NMAX% 

30640 PRINT 11 INSERT LONGITUDE 11 ;MSGT${J%); 11 FOR REGISTRATION POINT NUMBER 11 ;I% 

30650 INPUT LO{I%,J%) :NEXT J% 

30660 RETURN 

30670 'set offsets and shift coordinates 

30680 XUOFF#(1)=TX#(1) :YUOFF#(1)=TY#(1) 

30690 FOR I%=1 TO MPTS% 

Appendixes 45 
Appendix 1. Commented listing of all modules in JKDIGIT.BAS-Continued 

30700 TX#(I%)=TX#(I%)-XUOFF#(1):TY#(I%)=TY#(I%)-YUOFF#(1):NEXT I% 

30710 IRET%=1 

30720 NSTK%=NSTK%-1:ISTK%=FNRET%(0):RETURN 

31000 REM ********************************************************************* 

31010 REM &&& SUBROUTINE JKSCLKEY *** 

31020 REM *** GETS SCALING FACTORS FROM KEYBOARD *** 

31030 REM ********************************************************************* 

31040 REM*** DATED: AUGUST 10, 1983 *** 

31050 REM ********************************************************************* 

31060 REM *** INPUT VARIABLES *** 

31070 REM *** PRM%(0) NUMBER OF INPUT OTHER PARAMETERS *** 

31080 REM*** PRM%(1) COORDINATE TYPE CHOICE *** 

31090 REM *** OUTPUT VARIABLES *** 

31100 REM *** CDEG%(*) DEGREE OF REGRESSION MODEL *** 

31110 REM *** CX#(*) REGRESSION COEFFICIENTS FOR HORIZONTAL COORDS *** 

31120 REM *** CY#(*) REGRESSION COEFFICIENTS FOR VERTICAL COORDS *** 

31130 REM *** XBOFF(*) BOARD COORDINATE OFFSET *** 

31140 REM*** YBOFF(*) BOARD COORDINATE OFFSET *** 

31150 REM *** XUOFF#(*) USER COORDINATE OFFSET *** 

31160 REM*** YUOFF#(*) USER COORDINATE OFFSET *** 

31170 REM *** XROUND# X-ROUNDOFF FACTOR *** 

31180 REM *** YROUND# Y-ROUNDOFF FACTOR *** 

31190 REM*** !RET% ERROR RETURN (NOT CHECKED NOW) *** 

31200 REM *** OTHER VARIABLES *** 

31210 REM *** I%,J%,K%: LOOP INDEX VARIABLES *** 

31220 REM *** RNUM%(*) NUMBER OF TERMS IN REGRESSION MODEL *** 

31230 REM *** SUBROUTINES CALLED *** 

31240 GOTO 31270 

31250 GOSUB 35000 'subroutine jkstack 

31260 REM ********************************************************************* 

31270 IF PRM%(0) <> 1 THEN PRINT "FATAL PARAMETER ERROR":STOP 

31280 GOSUB 35000 'gosub jkstack 

31290 I RET%=2 

31300 CLS 

31310 PRINT "*************** KEYBOARD SCALE FACTOR INPUT *******************" 

31320 ON FNSTK%(1) GOTO 31340,31340,31390,31390 

31330 PRINT"*** MENU SCALING KEYBOARD INPUT ***":K%=0:GOTO 31350 

31340 PRINT "*** COORDINATE SCALING KEYBOARD INPUT ***":K%=1 

31350 PRINT:INPUT "INSERT XBOFF : ";XBOFF(K%) 

31360 INPUT II INSERT YBOFF : II; YBOFF( K%) 

31370 INPUT "INSERT XUOFF# : ";XUOFF#(K%) 

31380 INPUT "INSERT YUOFF# : ";YUOFF#(K%) 

31390 INPUT "INSERT CDEG%: ";CDEG%(K%) 

31400 PRINT 

31410 FOR I%=1 TO RNUM%(CDEG%(K%)) 

31420 J%=I%-1 

31430 PRINT "INSERT CX#("+STR$(J%)+"): ":INPUT CX#(J%,K%) 

46 JKDIGIT, A Program to Control a Digitizing Board 
Appendix 1. Commented listing of all modules in JKDIGIT.BAS-Continued 

31440 NEXT I% 

31450 PRINT 

31460 FOR I%=1 TO RNUtt1%(CDEG%(K%)) 

31470 J%=I%-1 

31480 PRINT 11 INSERT CY#( 11+STR$(J%)+ 11): 

11 :INPUT CY#(J%,K%) 

31490 NEXT I% 

31500 NSTK%=NSTK%-1:ISTK%=FNRET%(0):RETURN 35000 REM *************************************************************** 

35010 REM &&& SUBROUTINE JKSTACK *** 

35020 REM*** BUILDS STACK OF INTEGER PARAMETERS PASSED TO SUBROUTINES*** 

35030 REM *************************************************************** 

35040 REM *** DATED: AUGUST 10, 1983 *** 

35050 REM *************************************************************** 

35060 REM *** GLOBAL STACK VARIABLES *** 

35070 REM*** NSTK% STACK LEVEL (SUBROUTINE NEST COUNT) *** 

35080 REM *** ISTK% PRESENT STACK COUNT *** 

35090 REM*** VSTK%() ARRAY OF STACKED VALUES *** 

35100 REM*** TSTK% MAX STACK COUNT (DH~ENSION LIMITATION) *** 

35110 REM *** JSTK% TEMPORARY INDEX VARIABLE *** 

35120 REM *** KSTK% TEMPORARY VARIABLE *** 

35130 REM *** prm%(0) as input is the number of other integer parameters 

35140 REM*** passed to the subroutine being entered as prm%{1-prm%(0)). 

35150 REM *************************************************************** 

35160 KSTK%=ISTK%:ISTK%=ISTK%+PRM%{0)+1:IF ISTK% <= TSTK% GOTO 35190 

35170 CLS:WIDTH 40:COLOR 15 

35180 PRINT 11 FATAL ERROR- STACK SIZE EXCEEDED 11 ;ISTK%:STOP 

35190 FOR JSTK%=1 TO PRM%(0):KSTK%=KSTK%+1 

35200 VSTK%(KSTK%)=PRM%(JSTK%) :NEXT JSTK% 

35210 VSTK%{ISTK%)=PRM%(0) 

35220 NSTK%=NSTK%+1:RETURN 

Appendix 2. System macro to concatenate programs and subroutines, with comments for listing 

COPY JKMERGE.RAS+JKDIGDRV.BAS+JKNUMINP.BAS+JKMNMENU.BAS TMP.TMP 

COPY TMP. T~·1P+JKNUMENU. BAS+JKD IGUTL. BAS TMP. TMP 

COPY TMP.TMP+JKYESNO.BAS+JKVALSCL.BAS+JKGETRND.BAS TMP.TMP 

COPY TMP.TMP+JKFILPRM.BAS+JKDIGFIL.BAS+JKDIGOBL.BAS TMP.TMP 

COPY TMP.TMP+JKDIGBRD.BAS+JKGETPNT.BAS+JKINTVAR.BAS TMP.TMP 

COPY TMP. TMP+JKSCLCTL. BAS+JKREGRES. BAS+JKSCLCRD. BAS T~~P. TMP 

COPY TMP. TMP+JKSCLKEY. BAS+JKSTACK. B.AS J KD IGLST. BAS 

ERASE TMP.TMP 

Appendixes 47 
Appendix 3. Cross-reference list of subroutine calls, by calling program 

PROGRAM JKDIGDRV CALLS SUBROUTINES 

25000 AT 425, 3000 AT 465, 480 AT 470, 

35000 AT 485, 1000 AT 490, 27000 AT 530, 

1000 AT 570, 17000 AT 600' 27000 AT 620' 

13000 AT 650, 11000 AT 665, 15000 AT 680, 

15000 AT 695, 7000 AT 710, 7000 AT 730' 

1000 AT 750, 23000 AT 770, 23000 AT 790, 

7000 AT 800 

SUBROUTINE JKNUMINP CALLS SUBROUTINES 

35000 AT 1220, 5000 AT 1290, 5000 AT 1350' 

5000 AT 1400, 5000 AT 1440, 5000 AT 1490' 

5000 AT 1540' 5000 AT 1585' 5000 AT 1615 

SUBROUTINE JKMNMENU CALLS SUBROUTINES 

5000 AT 3530 

SUBROUTINE JKDIGUTL CALLS SUBROUTINES 

35000 AT 7240, 5000 AT 7320, 5000 AT 7380 

SUBROUTINE JKVALSCL CALLS SUBROUTINES 

35000 AT 11290' 1000 AT 11310, 19000 AT 11340 

SUBROUTINE JKGETRND CALLS SUBROUTINES 

13130 AT 13090, 13130 AT 13110 

SUBROUTINE JKFILPRM CALLS SUBROUTINES 

35000 AT 15460, 17000 AT 15570, 17000 AT 15770 

SUBROUTINE JKDIGFIL CALLS SUBROUTINES 

35000 AT 17390' 9000 AT 17540' 1000 AT 17830 

SUBROUTINE JKDIGDBL CALLS SUBROUTINES 

35000 AT 19650' 21000 AT 19680' 20270 AT 19910' 

20270 AT 19920' 20050 AT 19940' 20050 AT 19950' 

20150 AT 19960' 20150 AT 19970 

48 JKDIGIT, A Program to Control a Digitizing Board 
Appendix 3. Cross-reference list of subroutine calls, by calling program-Continued 

SUBROUTINE JKGETPNT CALLS SUBROUTINES 

35000 AT 23295' 9000 AT 23360, 24000 AT 23395' 

24000 AT 23415, 19000 AT 23460, 24000 AT 23520, 

24000 AT 23540, 24000 AT 23555, 19000 AT 23560 

24000 AT 23575, 24000 AT 23595, 19000 AT 23600' 

23850 AT 23610, 24000 AT 23625, 24000 AT 23645, 

24000 AT 23650, 24000 AT 23690, 19000 AT 23695, 

24000 AT 23720, 19000 AT 23725, 23850 AT 23735, 

24000 AT 23760 

SUBROUTINE JKINTVAR CALLS SUBROUTINES 

1000 AT 26120 

SUBROUTINE J K$CLCTL CALLS SUBROUTINES 

35000 AT 27260, 1000 AT 27320, 31000 AT 27335' 

15000 AT 27345' 1000 AT 27385, 29000 AT 27405, 

28000 AT 27430, 28000 AT 27465 

SUBROUTINE JKREGRES CALLS SUBROUTINES 

35000 AT 28280' 28480 AT 28360, 28480 AT 28430 

SUBROUTINE JKSCLCRD CALLS SUBROUTINES 

35000 AT 29470' 21000 AT 29530, 21000 AT 29760' 

30070 AT 29960, 30070 AT 30060, 30590 AT 30180' 

30590 AT 30290' 30590 AT 30510 

SUBROUTINE JKSCLKEY CALLS SUBROUTINES 

35000 AT 31280 

Appendixes 49 
Appendix 4. Cross-reference list of subroutine calls, by called program 

SUBROUTINE 480 CALLED FROM 

PROGRAM JKDIGDRV AT 470 

SUBROUTINE 1000 C.ALLED FROM 

PROGRAM JKDIGDRV AT 490, PROGRAM JKDIGDRV AT 570' 

PROGRAM JKDIGDRV AT 750, SUBROUTINE JKVALSCL AT 11310, 

SUBROUTINE JKDIGFIL AT 17830' SUBROUTINE JKINTVAR AT 26120, 

SUBROIJTI N E J KSCLCTL AT 27320, SUBROUTINE JKSCLCTL AT 27385 

SUBROUTINE 3000 CALLED FROM 

PROGRAM JKOIGDRV AT 465 

SUBROUTINE 5000 CALLED FROM 

SUBROUTINE JKNUMINP AT 1290, SUBROUTINE JKNUMINP AT 1350, 

SUBROUTINE JKNUMINP AT 1400, SUBROUTINE JKNUMINP AT 1440, 

SUBROUTINE JKNUMINP AT 1490, SUBROUTINE JKNUMINP AT 1540, 

SUBROUTINE JKNUMINP AT 1585, SUBROUTINE JKNUMINP AT 1615, 

SUBROUTINE JKMNMENU AT 3530, SUBROUTINE JKDIGUTL AT 7320, 

SUBROUTINE JKDIGUTL AT 7380 

SUBROUTINE 7000 CALLED FROM 

PROGRAM JKDIGDRV AT 710, PROGRAM JKDIGDRV AT 730' 

PROGRAM JKDIGDRV AT 800 

SUBROUTINE 9000 CALLED FROM 

SUBROUTINE JKDIGFIL AT 17540' SUBROUTINE JKGETPNT AT 23360 

SUBROUTINE 11000 CALLED FROtl1 

PROGRAM JKDIGDRV AT 665 

SUBROUTINE 13000 CALLED FROM 

PROGRAM JKDIGDRV AT 650 

SUBROUTINE 13130 CALLED FROM 

SUBROUTINE JKGETRND AT 13090, SUBROUTINE JKGETRND AT 13110 

SUBROUTINE 15000 CALLED FROM 

PROGRAM JKDIGDRV AT 680, PROGRAM JKDIGDRV AT 695, 

SUBROUTINE JKSCLCTL AT 27345 

SUBROUTINE 17000 CALLEO FROM 

PROGRAM JKDIGDRV .~T 600, SUBROUTINE JKFILPRM AT 15570, 

SUBROUTINE JKFILPRM AT 15770 

50 JKDIGIT, A Program to Control a Digitizing Board 
Appendix 4. Cross-reference list of subroutine calls, by called program-Continued 

SUBROUTINE 19000 CALLED FROM 

SUBROUTINE JKVALSCL AT 11340, SUBROUTINE JKGETPNT AT 23460, 

SUBROUTINE JKGETPNT AT 23560' SUBROUTINE JKGETPNT AT 23600' 

SUBROUTINE JKGETPNT AT 23695, SUBROUTINE JKGETPNT AT 23725 

SUBROUTINE 20050 CALLED FROM 

SUBROUTINE JKDIGDBL AT 19940' SUBROUTINE JKDIGDBL AT 19950 

SUBROUTINE 20150 CALLED FROM 

SUBROUTINE JKDIGDBL AT 19960' SUBROUTINE JKDIGDBL AT 19970 

SUBROUTINE 20270 CALLED FROM 

SUBROUTINE JKDIGDBL AT 19910' SUBROUTINE JKDIGDBL AT 19920 

SUBROUTINE 21000 CALLED FROM 

SUBROUTINE JKDIGDBL AT 19680' SUBROUTINE JKSCLCRD AT 29530, 

SUBROUTINE JKSCLCRD AT 29760 

SUBROUTINE 23000 CALLED FROM 

PROGRAM JKDIGDRV AT 770, PROGRAM JKDIGDRV AT 790 

SUBROUTINE 23850 CALLED FROM 

SUBROUTINE JKGETPNT AT 23610' SUBROUTINE JKGETPNT AT 23735 

SUBROUTINE 24000 CALLED FROM 

SUBROUTINE JKGETPNT AT 23395' SUBROUTINE JKGETPNT AT 23415, 

SUBROUTINE JKGETPNT AT 23520, SUBROUTINE JKGETPNT AT 23540' 

SUBROUTINE J KGETP NT AT 23555, SUBROUTINE JKGETPNT AT 23575, 

SUBROUTINE JKGETPNT AT 23595, SUBROUTINE JKGE'TPNT AT 23625, 

SUBROUTINE JKGETPNT AT 23645, SUBROUTINE JKGETPNT AT 23650' 

SUBROUTINE JKGETPNT AT 23690, SUBROUTINE JKGETPNT AT 23720, 

SUBROUTINE JKGETPNT AT 23760 

SUBROUTINE 25000 CALLED FROM 

PROGRAM JKD IGDRV AT 425 

SUBROUTINE 27000 CALLED FROM 

PROGRAM JKD IGDRV AT 530' PROGRAM JKD IGDRV AT 620 

SUBROUTINE 28000 CALLED FRm~ 

SUBROUTINE JKSCLCTL AT 27430, SUBROUTINE JKSCLCTL AT 27465 

SUBROUTINE 28480 CALLED FROM 

SUBROUTINE JKREGRES AT 28360' SUBROUTINE JKREGRES AT 28430 

SUBROUTINE 29000 CALLED FROM 

SUBROUTINE JKSCLCTL AT 27405 

Appendixes 51 
Appendix 4. Cross-reference list of subroutine calls, by called program-Continued 

SUBROUTINE 30070 CALLED FROM 

SUBROUTINE JKSCLCRO AT 29960, SUBROUTINE JKSCLCRD AT 30060 

SUBROUTINE 30590 CALLED FROM 

SUBROUTINE JKSCLCRD AT 30180, SUBROUTINE JKSCLCRO AT 30290 

SUBROUTINE JKSCLCRD AT 30510 

SUBROUTINE 31000 CALLED FROM 

SUBROUTINE JKSCLCTL AT 27335 

SUBROUTINE 35000 CALLED FROM 

PROGRAM JKDIGDRV AT 485, SUBROUTINE JKNUMINP AT 1220, 

SUBROUTINE JKDIGUTL AT 7240, SUBROUTINE JKVALSCL AT 11290' 

SUBROUTINE JKFILPRM AT 15460, SUBROUTINE· JKDIGFIL AT 17390' 

SUBROUTINE JKOIGDBL AT 19650' SUBROUTINE JKGETPNT AT 23295' 

SUBROUTINE JKSCLCTL AT 27260, SUBROUTINE JKREGRES AT 28280, 

SUBROUTINE JKSCLCRD AT 29470, SUBROUTINE JKSCLKEY AT 31280 

52 JKDIGIT, A Program to Control a Digitizing Board 
Appendix 5. Complete variable list with reference lines 

SYMBOL REFERENCE LINE 

-------------------------------------------------------------------------------

------------------------------------------------------------------------------- A#( 385 27445 27450 27480 27485 28310 28330 

28390 28400 28410 28500 28520 28550 28590 

A$ 91 5390 5400 5470 5500 9140 9150 

9160 9180 9190 15800 15810 15820 16050 

17470 17480 18000 20080 20090 20100 20110 

20180 20190 20200 20210 20290 20300 20310 

23525 23530 23535 23540 23655 23665 23670 

24100 24115 24130 24135 24145 24155 24450 

26160 26190 26200 26210 26220 27510 29920 

ALL 39 41 43 45 47 49 51 

53 55 57 59 61 63 65 

67 69 71 73 75 77 79 

83 85 

------------------------------------------------------------------------------- AX#( 385 19730 19740 19760 19770 19810 19820 

27425 27460 28330 29550 29560 29570 29800 

29810 29820 29830 29840 29850 

B# 19910 19920 19940 19950 19960 19970 20080 

20130 20180 20230 20290 

B$ 20080 20110 20130 20180 20210 20230 20300 

24100 

------------------------------------------------------------------------------- B% 20300 20310 

BAS$ 1285 1345 1395 1435 1485 1535 1580 

1610 3520 5390 7310 7370 

BPBF 23450 23465 23560 23600 23700 23725 

------------------------------------------------------------------------------- BPON 710 715 11350 23450 26230 

c 20130 20230 20240 20250 

C# 19910 19920 19940 19950 19960 19970 20130 

20250 20290 20300 20320 

-----------------------------------~------------------------------------------- C$ 20310 20320 

C% 20130 

CBTN$ 19690 21110 21120 23470 23550 23565 23570 

23575 23605 23615 23620 23625 23705 23710 

23730 23740 23895 23900 23905 23915 23920 

23925 23930 29770 29870 

------------------------------------------------------------------------------- COEG%( 400 460 640 3510 15670 15880 19730 

19750 19800 26080 27275 27370 27380 27395 

31390 31410 31460 

CLD%( 410 25830 25840 

CLO%( 410 24320 24335 25830 

------------------------------------------------------------------------------

Appendixes 53 
Appendix 5. Complete variable list with reference lines-Continued 

SYMBOL REFERENCE LINE 

------------------------------------------------------------------------------- CLR%( 405 23405 23410 23520 23555 23590 23645 

23685 23715 24315 24320 24325 24335 24340 

25840 

CX#( 390 15680 15890 19790 19810 27280 27285 

27445 27450 31430 

CY#( 390 15690 15(}00 19790 19820 27280 27285 

27480 27485 31480 

0# 20130 20230 20250 

------------------------------------------------------------------------------- DAT$( 405 24245 24330 25810 

DATX%( 405 24245 24325 25860 

DATY%( 405 24245 24325 25880 

------------------------------------------------------------------------------- ERROR 15590 15790 15940 15970 16000 17420 17450 

17790 17820 17860 17980 18000 18030 21100 

21130 23325 23350 26140 26180 28490 28630 

FALSE 710 730 800 23300 23435 25680 26230 

FLMOO% 610 23305 23310 

------------------------------------------------------------------------------- FNRET%( 420 1620 7390 11510 16060 18040 20040 

24465 27520 28470 30720 31500 

FNSTK%( 415 500 520 1230 1235 7250 11340 

11370 15470 15490 15520 15530 15620 15830 

17430 17750 17800 17810 17870 17880 17920 

17990 19660 19840 19930 19980 20010 23370 

23405 23460 23480 23505 23510 23560 23640 

23695 23770 23845 24180 24185 24195 24375 

27265 27300 27310 27335 27340 27345 27355 

27375 27405 27440 27475 28290 28380 29480 

29650 29660 29950 30120 30160 30200 30230 

30250 30360 31320 

HIGH 1225 3530 5290 5320 5370 5390 

------------------------------------------------------------------------------- I% 17 37 87 415 420 500 505 

510 1600 3390 3400 3410 3420 3430 

3440 3450 3460 3470 3480 3490 5300 

5310 5320 5330 5340 5350 5370 15680 

15690 15890 15900 17600 17610 17720 19860 

19870 19880 19890 20090 20100 20110 20120 

20190 20200 20210 20220 23805 23810 23825 

23830 23865 23870 23880 23885 24165 24240 

24245 24250 24310 24315 24320 24325 24330 

24335 24340 24345 25690 25700 25710 25720 

54 JKDIGIT, A Program to Control a Digitizing Board 
Appendix 5. Complete variable list with reference lines-Continued 

SYMBOL REFERENCE LINE 

------------------------------------------------------------------------------- I%( continued) 25730 25740 25750 25770 25780 25790 25800 

25810 25820 25830 25840 25850 25860 25870 

25880 27280 27425 27445 27460 27480 28310 

28330 28340 2B380 28400 28410 28420 28460 

28510 28520 28530 28540 28550 28560 29520 

29540 29550 29560 29570 29730 29740 29750 

29780 29800 29810 29820 29830 29840 29850 

29870 29960 29990 30000 30020 30030 30050 

30080 30090 30170 30210 30220 30230 30270 

30280 30300 30370 30380 30410 30420 30430 

30440 30450 30480 30500 30520 30540 30550 

30570 30610 30620 30640 30650 30690 30700 

31410 31420 31440 31460 31470 31490 

IOCHR$ 585 3410 23305 23415 23550 24175 

IDTOP$ 24175 24190 24265 

------------------------------------------------------------------------------- IDWRT$ 23305 23415 23540 23550 23575 23625 23775 

23780 23790 23795 23815 23835 24425 

IFRST 23295 

I NCR$ ( 400 1600 3460 25790 

------------------------------------------------------------------------------- !NCR% 755 785 3460 26080 

INCS$( 400 785 25780 

INPUT 585 5390 9140 13080 13100 15800 15820 

15840 15850 15860 15870 15880 15890 15900 

15920 15930 17470 21110 30020 30080 30090 

30480 30620 30650 31350 31360 31370 31380 

31390 31430 31480 

------------------------------------------------------------------------------- INPUT$( 26160 

!RET% 430 470 495 500 535 540 545 

555 570 605 610 625 630 635 

670 685 700 715 735 755 805 

1235 5420 5430 5440 5480 7260 9150 

9160 11320 11490 11500 15540 15580 15740 

15780 15940 16040 17400 17550 17560 17830 

17840 17890 17940 17960 18000 19660 23365 

23610 23740 23955 23960 26130 27325 27330 

27350 27360 27370 27390 27395 27410 27435 

27470 27490 28280 28360 28430 28610 28630 

29470 30710 31290 

IRET1% 610 17400 17830 

-------------------------------------------------------------------------------

Appendixes 55 
Appendix 5. Complete variable list with reference lines-Continued 

SYMBOL REFERENCE LINE 

------------------------------------------------------------------------------- ISTK% 415 420 520 1620 7390 11510 16060 

18040 20040 24465 25670 27520 28470 30720 

31500 35160 35180 35210 

ITMP% 5270 5380 15670 15680 15690 15880 15890 

15900 

ITRM% 27370 27380 27395 27425 27430 27445 27450 

27460 27465 27480 27485 29850 29880 29900 

------------------------------------------------------------------------------- J% 500 505 510 17620 17630 17640 17650 

17660 17670 17680 17690 17700 19800 19810 

19820 19830 24240 24245 24250 24310 24315 

24320 24325 24330 24335 24340 24345 25740 

25750 25760 25800 25810 25820 25830 25840 

25850 25860 25870 25880 27440 27445 27450 

27475 27480 27485 28310 28330 28340 28540 

28550 28560 28570 28580 28590 28600 30210 

30220 30250 30270 30430 30440 30530 30540 

30550 30560 30600 30610 30620 30630 30640 

30650 31420 31430 31470 31480 

JSTK% 35190 35200 

K% 15620 15630 15640 15650 15660 15670 15680 

15690 15700 15830 15840 15850 15860 15870 

15880 15890 15900 15910 19660 19700 19730 

19750 19790 19800 19810 19820 24240 24245 

24250 24310 24315 24320 24325 24330 24335 

24340 24345 25800 25810 25820 25830 25840 

25850 25860 25870 25880 28320 28330 28340 

28360 28390 28410 28500 28510 28520 28540 

28550 28580 28590 30220 30230 30240 30250 

30260 30370 30400 30420 30430 30440 31330 

31340 31350 31360 31370 31380 31390 31410 

31430 31460 31480 

KSTK% 35160 35190 35200 

------------------------------------------------------------------------------- L% 28390 28410 28450 28460 30190 30200 30210 

30220 

LA( 395 11380 11410 11420 19870 20000 20020 

23490 23495 23790 23795 23805 23825 24395 

24410 30230 30240 30430 30540 30620 

LO{ 395 11390 11430 11440 19880 20000 20030 

23490 23495 23790 23795 23810 23830 24400 

24415 30250 30260 30440 30550 30650 

-------------------------------------------------------------------------------

56 JKDIGIT, A Program to Control a Digitizing Board 
Appendix 5. Complete variable list with reference lines-Continued 

SYMBOL REFERENCE LINE 

------------------------------------------------------------------------------- LOCATE 87 23440 23445 23660 23675 23750 23755 

23855 23945 24110 24115 24120 24125 24130 

24135 24140 24145 24150 24155 24160 24165 

24180 24185 24190 24200 24205 24215 24220 

24225 24245 24265 24275 24280 24285 24295 

24325 24380 24385 24395 24400 24410 24415 

24425 24430 

LOW 1225 3530 5310 5340 5390 

LPON 730 735 800 805 845 23315 23780 

23795 23820 26230 

------------------------------------------------------------------------------- M$( 385 1250 1255 1260 1265 1270 1275 

1305 1310 1315 1320 1325 1330 1335 

1365 1370 1375 1380 1385 1415 1420 

1425 1460 1465 1470 1475 1515 1520 

1525 1555 1560 1565 1570 1600 3400 

3410 3420 3430 3440 3450 3460 3470 

3490 5340 7280 7290 7340 7350 

1'111$( 385 3400 3490 25890 25900 25910 25920 

25930 25940 25950 25960 25970 25980 25990 

26000 26010 26020 26030 

M1% 3390 3490 3500 25460 

-------------------------------------------------------------------------------

MAX% 1245 1300 1360 1410 1450 1500 1550 

1595 3500 5310 5440 5460 7270 7330 

MBUF 23300 23430 23435 23450 

MDF%( 385 445 450 455 515 540 545 

550 555 630 640 775 795 25700 

25710 25740 

MFIL$ 630 635 700 835 860 3450 27355 

MKR$( 385 3400 24185 25750 

-------------------------------------------------------------------------------

~4PRM% 25460 25690 25730 

MPTS% 27425 27430 27460 27465 29580 29870 29880 

29890 29960 29990 30030 30040 30280 30410 

30480 30490 30520 30690 

MSEL%( 385 445 450 455 460 485 500 

515 530 540 545 550 555 560 

570 610 630 635 640 655 665 

670 680 685 695 700 715 735 

755 765 775 785 795 805 825 

850 3400 3420 3440 3450 25710 

-------------------------------------------------------------------------------

Appendixes 57 
Appendix 5. Complete variable list with reference lines-Continued 

SYMBOL REFERENCE LINE 

---~-------------------------------------------~------------------------------- MSG$( 390 

MSGB$( 390 5370 5460 5470 5500 30330 30340 

30350 30380 30400 

MSGB% 1225 3500 5270 5370 5380 5450 5460 

5470 5480 5490 5500 7270 7330 11300 

11360 

----~-------------------------------------------------------------------------- MSGT$( 390 1455 1505 1510 5300 11380 11390 

11410 11420 11430 11440 11460 11470 27300 

27305 29500 29520 30130 30140 30150 30610 

30640 

MSGT% 1245 1300 1360 1450 1500 1550 1595 

3500 5300 5480 7270 7330 11300 11360 

27315 

MSK$ 1245 1360 1410 1450 1500 1550 1595 

3500 3510 5320 5480 27295 27310 

------------------------------------------------------------------------------- N% 28290 28320 28380 28390 28400 28440 28450 

28460 

NDIM% 28290 28310 28360 28510 28540 28570 

NMAX% 29650 29660 29740 30130 30140 30430 30440 

30530 30600 30630 

-~----------------------------------------------------------------------------- NPTS% 605 840 865 23840 24295 

NSTK% 520 1620 7390 11510 16060 18040 20040 

24465 25670 27520 28470 30720 31500 35220 

OFIL$ 610 825 850 3420 23335 

-------------~----------------------------------------------------------------- P%( 400 28380 28390 28400 28410 28460 

PRM'k ( 400 485 490 530 570 595 620 

665 680 695 710 730 750 765 

785 800 1215 7230 11280 11310 11340 

15450 15570 15770 17380 17830 19640 23290 

23395 23415 23460 23520 23540 23555 23560 

23575 23595 23600 23610 23625 23645 23650 

23690 23695 23720 23725 23735 23760 23940 

24090 24300 24350 24355 24370 26120 27320 

27335 27340 27345 27370 27385 27~95 27405 

27430 27465 28270 29460 31270 35160 35190 

35200 35210 

PRM1$ 595 785 9140 15460 17400 17540 23295 

23360 

PRM2$ 610 635 685 700 1455 17400 17480 

17500 17520 17600 17610 17740 17800 17880 

17900 17920 17930 17990 18010 27355 

--------~----------------------------------------------------------------------

58 JKDIGIT, A Program to Control a Digitizing Board 
Appendix 5. Complete variable list with reference lines-Continued 

SYMBOL REFERENCE LINE 

------------------------------------------------------------------------------- RNUf'fk( 395 15670 15880 19800 26070 27395 31410 

31460 

S% 20230 20240 20250 

SFIL$ 515 550 555 685 830 855 3440 

27355 

------------------------------------------------------------------------------- SPC( 

ST$( 

ST% 

STAR1$ 

STAR2$ 

TAB( 

TDEG% 

TMP 

TMP# 

TMP% 

TMP1 

TMP1$ 

23440 

24160 

410 

440 

5270 

5270 

23805 

30400 

27370 

30190 

13090 

17610 

30190 

17400 

23660 

24190 

3500 

445 

5290 

5280 

23810 

30420 

27380 

30200 

13110 

17630 

30200 

17470 

23750 

24265 

26040 

450 

5290 

23825 

30430 

27395 

30250 

13140 

17660 

30230 

23295 

23755 

24275 

26050 

455 

23830 

30440 

29800 

17690 

23385 

23855 24140 24150 

24280 24285 

26060 

460 3500 

29980 29990 30380 

29820 

20290 20300 20310 

------------------------------------------------------------------------------- TMP3$ 15480 15500 15510 15600 15810 16030 

TNE$ 23440 26220 

TNF$ 23430 26200 

------------------------------------------------------------------------------- TOP$ 1280 1340 1390 1430 1480 1530 1575 

1605 3520 5280 7300 7360 

TROUND# 19960 19970 20250 

TRUE 435 715 735 805 23295 23430 25680 

26230 

------------------------------------------------------------------------------- TSTK% 25670 35160 

TX#( 390 27425 29600 29990 30080 30520 30550 

30680 30700 

TY#( 390 27460 29600 29990 30090 30520 30540 

30680 30700 

------------------------------------------------------------------------------- VMAX 

VSTK%( 

X# 

28390 

400 

23485 

28400 

415 

23775 

28410 

420 

23780 

35200 

24380 

35210 

-------------------------------------------------------------------------------

Appendixes 59 
Appendix 5. Complete variable list with reference lin~s..,....,.Continued 

SYMBOL REFERENCE LINE 

------------------------------------------------------------------------------- XBOFF( 395 15630 15840 19700 27275 29550 29560 

29790 29800 31350 

XDB# 11460 19790 19810 19880 19910 19940 19960 

20000 23485 23860 23865 

XI 19700 21110 29550 29560 29790 29800 

------------------------------------------------------------------------------- X MEN% 23865 23870 23895 23900 23905 23910 

X ROUND# 550 3430 13060 13080 13090 15710 15920 

19960 26080 

XT# 19700 19730 19740 19760 

------------------------------------------------------------------------------- XTMP 5400 5410 5420 5430 

XU OFF#( 395 15650 15860 19790 27275 29590 30680 

30700 31370 

Y# 23485 23775 23780 24385 

------------------------------------------------------------------------------- YBOFF( 395 15640 15850 19700 27275 29550 29560 

29790 29800 31360 

YDB# 11470 19790 19820 19870 19920 19950 19970 

20000 23485 23860 23880 

YI 19700 21110 29550 29560 29790 29800 

------------------------------------------------------------------------------- YMEN% 23880 23885 23895 23900 

YROUND# 550 3430 13070 13100 13110 15720 15930 

19970 26080 

YT# 19700 19730 19740 19770 

------------------------------------------------------------------------------- YUOFF#( 395 15660 15870 19790 27275 29590 30680 

30700 31380 

=============================================================================== 

LINES: 1760 BYTES: 99333 SYMBOLS: 382 REFERENCES: 2154 

60 JKDIGIT, A Program to Control a Digitizing Board 
Appendix 6. Transfer statement cross-reference list 

SYt4BOL REFERENCE LINE 

------------------------------------------------------------------------------- 0 15940 15970 16000 17450 17820 17860 18000 

18030 21130 23350 26180 28630 

87 39 41 43 45 47 49 51 

53 55 57 59 61 63 65 

67 69 71 73 75 77 79 

91 91 

------------------------------------------------------------------------------- 380 

480 

520 

525 

555 

565 

590 

615 

645 

660 

675 

690 

705 

725 

745 

760 

780 

B15 

870 

875 

1000 

1215 

1245 

1300 

275 

470 

495 

470 

540 

470 

470 

470 

470 

470 

470 

470 

470 

470 

470 

470 

285 

470 

845 

430 

490 

25430 

1195 

1230 

1230 

505 

470 

570 

26120 

510 

750 

27225 

11240 

27320 

11310 

27385 

17340 17830 

Appendixes 61 
Appendix 6. Transfer statement cross-reference list-Continued 

SYMBOL REFERENCE LINE 

------------------------------------------------------------------------------- 1360 

1405 

1445 

1495 

1545 

1590 

1620 

3000 

3390 

5000 

5290 

5440 

5450 

5480 

7000 

7230 

7270 

7330 

7390 

9000 

9140 

9200 

11000 

11280 

11310 

11330 

11380 

11410 

11460 

11490 

1230 

1230 

1230 

1230 

1230 

1230 

1235 

1585 

290 

3360 

295 

1540 

7380 

5470 

5430 

5410 

5440 

300 

7190 

7250 

7250 

7320 

305 

9200 

9180 

310 

11230 

11400 

11320 

11370 

11370 

11370 

11320 

1290 

1615 

465 

1200 

1585 

5510 

710 

17350 

665 

11450 

62 JKDIGIT, A Program to Control a Digitizing o·oard 

1350 

1290 

1615 

730 

17540 

11480 

1400 

1350 

3370 

800 

23360 

1440 

1400 

3530 

1490 

1440 

7200 

1540 

1490 

7320 
SYMBOL 

11500 

11510 

13000 

13080 

13100 

13130 

15000 

15460 

15480 

15490 

15500 

15510 

15520 

15550 

15730 

15760 

15790 

15940 

15950 

15970 

15990 

16000 

16020 

16040 

16050 

16060 

17000 

17380 

17450 

17460 

17470 

17560 

17570 

Appendix 6. Transfer statement cross-reference list-Continued 

REFERENCE LINE 

11320 

11490 

315 

13090 

13110 

13090 

320 

15400 

15470 

15470 

15490 

15490 

15480 

15520 

15700 

15520 

15780 

15910 

15580 

15590 

15780 

15790 

15810 

15540 

16050 

15750 

325 

17330 

17420 

17440 

17550 

17550 

17520 

650 

13110 

680 

15500 

15950 

15940 

600 

17450 

17580 

695 27230 27345 

15960 15980 15990 

15420 15570 15770 

18030 

17710 17840 

16010 

Appendixes 63 
Appendix 6. Transfer statement cross-reference list-Continued 

SYMBOL REFERENCE LINE 

-----------------------------------------------~------------------------------- 17600 

17720 

17760 

17850 

17860 

17880 

17920 

17960 

17970 

18010 

18030 

18040 

19000 

19640 

19790 

19860 

19900 

19960 

20000 

20040 

20050 

20130 

20150 

20230 

20270 

21000 

21150 

23000 

23290 

23310 

23315 

23320 

23350 

17500 

17630 

17750 

17790 

17850 

17840 

17750 

17840 

17750 

17980 

18020 

17560 

330 

23695 

19510 

19730 

19840 

19840 

19930 

19980 

19690 

19530 

20100 

19540 

20200 

19550 

335 

21100 

340 

23260 

23305 

23305 

23365 

23325 

17660 

17840 

17910 

11250 

23725 

19750 

19850 

19940 

19960 

19910 

19520 

770 

64 JKDIGIT, A Program to Control a Digitizing Board 

17690 

17950 

11340 

19950 

19950 

19970 

19920 

19680 

790 

17960 

23265 

19980 

29410 

18000 

23460 23560 23600 

19990 20010 

29530 29760 
Appendix 6. Transfer statement cross-reference list-Continued 

SYMBOL REFERENCE LINE 

------------------------------------------------------------------------------- 23360 

23370 

23375 

23395 

23405 

23425 

23435 

23445 

23450 

23485 

23490 

23495 

23505 

23510 

23515 

23525 

23550 

23560 

23585 

23600 

23640 

23645 

23650 

23655 

23685 

23715 

23745 

23770 

23775 

23790 

23805 

23840 

23845 

23355 

23315 

23370 

23345 

23845 

23845 

23425 

23430 

23435 

23480 

23480 

23480 

23485 

23505 

23510 

23525 

23510 

23580 

23510 

23610 

23535 

23640 

23680 

23655 

23640 

23640 

23505 

23640 

23770 

23770 

23770 

23785 

23670 

23365 

23370 

23440 

23545 

23630 

23570 

23510 

23665 

23800 

23710 

23615 

23710 

23820 

23740 

23730 23740 

Appendixes 65 
Appendix 6. Transfer statement cross-reference list-Continued 

SYMBOL REFERENCE LINE 

--~---~------------------------------------------------------------------------ 23850 

23880 

23895 

23915 

23920 

23925 

23930 

23935 

23955 

23270 

23865 

23880 

23910 

23910 

23910 

23910 

23860 

23940 

23610 23735 

23875 23890 

-----~------------------------------------------------------------------------- 23960 

23965 

24000 

24100 

24200 

24215 

24225 

24260 

24270 

24305 

24325 

24340 

24360 

24380 

24395 

24410 

24420 

24425 

24430 

24435 

24440 

24450 

25000 

25450 

23895 

23955 

23275 

23595 

24090 

24195 

24195 

24210 

24090 

24090 

24090 

24315 

24320 

24300 

24375 

24375 

24375 

24090 

24355 

24255 

23530 

23470 

24450 

345 

25420 

23900 

23395 

23625 

24370 

24350 

23565 

425 

66 JKDIGIT, A Program to Control a Digitizing .Board 

23905 23915 23920 23925 23930 

23415 23520 23540 23555 23575 

23645 23650 23690 23720 23760 

24390 24405 

23605 23620 23705 
Appendix 6. Transfer statement cross-reference list-Continued 

SYMBOL REFERENCE LINE 

------------------------------------------------------------------------------- 26100 

26140 

26240 

26130 

26130 

26130 

------------------------------------------------------------------------------- 26250 

27000 

27260 

26140 

350 

27220 

530 620 

-----------------------------------------------------------------------------~- 27265 

27290 

27315 

27515 

27265 

27300 

------------------------------------------------------------------------------- 27335 

27340 

27365 

27385 

27405 

27490 

27500 

27510 

27520 

28000 

28270 

28390 

28420 

28430 

28470 

28480 

28530 

28560 

28600 

28630 

28640 

29000 

29460 

29560 

27330 

27330 

27330 

27375 

27370 

27285 

27435 

27510 

27325 

355 

28230 

28450 

28400 

28390 

28360 

28240 

28510 

28540 

28580 

28490 

28610 

360 

29400 

29540 

27410 

27380 

27335 

27470 

27350 

27235 

28460 

28430 

28360 

28630 

27240 

27360 27390 27490 

27430 27465 

28440 

28430 

27405 

Appendixes 67 
SYMBOL 

29570 

29620 

29730 

29800 

29850 

29870 

29920 

29930 

29960 

29970 

30010 

30050 

30070 

30110 

30140 

30160 

30280 

30310 

30400 

30410 

30480 

30500 

30520 

30590 

30670 

30710 

30720 

31000 

31270 

31340 

Appendix 6. Transfer statement cross-reference list-Continued 

REFERENCE LINE 

29550 

29480 

29650 

29780 

29800 

29770 

29920 

29880 

29950 

30060 

30040 

30030 

29420 

29950 

30120 

30130 

30160 

30510 

30360 

30390 

30490 

30480 

30270 

29430 

30050 

29610 

29920 

365 

31240 

31320 

29820 

29960 

30500 

30180 

30580 

27245 

30060 

30290 30510 

27335 

68 JKDIGIT, A Program to Control a Digitizing Board 
Appendix 6. Transfer statement cross-reference list-Continued 

SYMBOL REFERENCE LINE 

------------------------------------------------------------------------------- 31350 

31390 

35000 

35190 

31330 

31320 

370 

11290 

23280 

29470 

35150 

485 1205 

15430 15460 

232q5 27250 

31250 31280 

1220 7210 7240 11250 

17360 17390 19560 19650 

27260 28250 28280 29440 

----------------·--------------------------------------------~------------------

{{u.S. GOVERNMENT PRINTING OFFICE:1986-676-047/26028 

Appendixes 69