home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 May / PCP163A.iso / features / GPSS / gpss.exe / GFILTER.BAS < prev    next >
Encoding:
BASIC Source File  |  1995-09-21  |  999 b   |  33 lines

  1. '       GFILTER.BAS filters .GTX files within SY9280 to TQ4786
  2. '       sorry, but I can't give away all the data
  3. '       this example QBASIC program extracts places in a limited area
  4.  
  5.         x1! = 292              'limits of filter
  6.         y1! = 80     'SY9280
  7.         x2! = 547
  8.         y2! = 186    'TQ4786
  9.  
  10.         INPUT "Enter input file (e.g. $E.GTX) :", infile$
  11.  
  12.         OPEN infile$ FOR INPUT AS #1
  13.         OPEN "TMP.GTX" FOR OUTPUT AS #2
  14.  
  15.         LINE INPUT #1, tmp$   'copy first two comment lines
  16.         PRINT #2, tmp$
  17.         LINE INPUT #1, tmp$
  18.         PRINT #2, tmp$
  19.  
  20.         DO WHILE NOT EOF(1)  'then filter the data
  21.           INPUT #1, cat$, xx$, yy$, n1$, n2$
  22.           x! = VAL(xx$)
  23.           y! = VAL(yy$)
  24.           IF x! >= x1! AND x! <= x2! AND y! >= y1! AND y! <= y2! THEN
  25.             PRINT #2, cat$; ","; xx$; ","; yy$; ","; n1$; ","; n2$
  26.           END IF
  27.         LOOP
  28.  
  29.         CLOSE #1
  30.         CLOSE #2
  31.         PRINT "All done into TMP.GTX"
  32.  
  33.