Previous Page Table of Contents


Appendix V: Program listing of WS_SELEC.BAS

REM 
REM qbasic program to create BNA file with selected objects based on ID1
REM PROCEDURE:
REMRead a data file which holds ID1 and ID2 of selected objects
REMStore ID1 and ID2 in an array
REMRead through the complete bna file, one object at a time
REMCheck if ID1 of this object was present in the datafile
REMIf present write ID1 and ID2 from the datafile to a new BNA file
REM 
REM written by Lieven Verheust on 12/6/97

OPEN “c:\alcomwrd\ws\map\ws_sadc.bna” FOR INPUT AS #1
OPEN “c:\alcomwrd\ws\map\ws_selec.txt” FOR INPUT AS #2
OPEN “c:\alcomwrd\ws\map\ws_selec.bna” FOR OUTPUT AS #3

DIM id$(1201)
DIM na$(1201)

CLS
INPUT #2, w$, w$, w$, c

j = 0

10 IF EOF(2) THEN GOTO 20
j=j + l
INPUT #2, id$(j), na$(j), w$, c
m=j

GOTO 10

20 PRINT m;“ objects found in data file”
PRINT “now processing bna file, please be patient, this might take some time”

30 IF EOF(l) THEN PRINT m;“objects processed, ws_selec.bna was created”
IF EOF(l) THEN SYSTEM
INPUT #l,a$, b$, n

FOR j = 1 TO m

p = 0
IF id$(j) = a$ THEN p = 1
IF id$(j) = a$ THEN GOTO 40

NEXT j

40 IF p = 1 THEN WRITE #3, a$, na$(j), n
IF p = 1 THEN PRINT “processing object”; a$;“”; na$(j)

FOR k = 1 TO n

INPUT #l,x,y
IF p = 1 THEN WRITE #3, x, y

NEXT k
GOTO 30


Previous Page Top of Page