Category : Science and Education
Archive   : WDBDISK5.ZIP
Filename : WDB.PAS

 
Output of file : WDB.PAS contained in archive : WDBDISK5.ZIP
PROGRAM WDB(INPUT, OUTPUT);

{By Fred Pospeschil - JUN 1986}
TYPE
POINT = RECORD {Micro World Data Base II input record}
CODE : INTEGER;
LAT : INTEGER;
LON : INTEGER;
END;

FGREAL = REAL4; {use single precision reals for graphics}
FGSTRING = LSTRING(80); {global string definition needed by}
{graphics routines}

VAR
SYSTEM : INTEGER; {stores system identifier 1-5}
DUMMY : LSTRING(80); {dummy variable for keyboard input purposes}

MAP_FILE : FILE OF POINT; {symbolic name for input map data file}
FILE_NAME : LSTRING(16); {stores map file name input by user}
NEXT_POINT : POINT; {holds next point to be plotted}
LAST_POINT : POINT; {holds last point plotted}

MAX_LAT : FGREAL; {stores north, south,}
MIN_LAT : FGREAL; {east, and west limits of area}
MAX_LON : FGREAL; {to be displayed - }
MIN_LON : FGREAL; {input by user}
INIT_VEC : ARRAY [1..7] OF INTEGER; {graphics initialization parms}

{*************************************************************************}

{$INCLUDE:'FGPASDEF.INC'} {include the external procedure declarations}
{$INCLUDE:'FGREADLN.INC'} {include the graphics string input routine}
{these are provided with the Flexi-Graph graphics libs}

{*************************************************************************}

{have the user identify the system configuration}
BEGIN
WRITELN(' MICRO WORLD DATA BANK II DISPLAY PROGRAM');
WRITELN;
WRITELN(' WHAT TYPE OF MICROCOMPUTER ARE YOU RUNNING ?');
WRITELN;
WRITELN(' 1 = IBM PC OR COMPATABLE WITH COLOR GRAPHICS ADAPTER');
WRITELN(' 2 = IBM AT WITH ENHANCED COLOR GRAPHICS ADAPTER');
WRITELN(' 3 = Z110 OR Z120 WITH 32K VIDEO MEMORY CHIPS');
WRITELN(' 4 = Z110 OR Z120 WITH 64K VIDEO MEMORY CHIPS');

WRITELN(' 5 = IBM PC WITH IDS 440 VIDEO DISPLAY CARD');
READLN(SYSTEM); {get type of computer and display system}
WRITELN;
WRITELN;
WRITELN;

{get map data file name and area to be displayed}
WRITE('ENTER MAP DATA FILE > ');
READLN(FILE_NAME);
WRITELN;
WRITELN(' "+" = NORTH AND EAST, "-" = SOUTH AND WEST');
WRITELN(' COORDINATES MAY BE INPUT IN INTEGER <45> OR REAL <45.00> FORMAT');
WRITELN;
WRITE('Enter northern most latitude +/- 90 Deg >');
READLN(MAX_LAT);
MAX_LAT := MAX_LAT * 60.0; {convert degrees to minutes}
WRITE('Enter southern most latitude +/- 90 Deg >');
READLN(MIN_LAT);
MIN_LAT := MIN_LAT * 60.0;
WRITE('Enter eastern most longitude +/- 180 Deg >');
READLN(MAX_LON);
MAX_LON := MAX_LON * 60.0;
WRITE('Enter western most longitude +/- 180 Deg >');
READLN(MIN_LON);
MIN_LON := MIN_LON * 60.0;


{initialize the graphics display and Flexi-Graph routines}
CASE SYSTEM OF
1 : GRSTRT(0,0,0); {IBM PC 320x200}
2 : BEGIN
INIT_VEC[1] := 16; {forground = white}
INIT_VEC[2] := 0; {background = black}
INIT_VEC[3] := 640; {pixels Y direction}
INIT_VEC[4] := 350; {pixels X direction}
INIT_VEC[5] := 1; {X aspect ratio}
INIT_VEC[6] := 1; {Y aspect ratio}
GRINIT(-1, 16, INIT_VEC[1]); {EGA 640x350}
END;
3 : GRSTRT(1,0,0); {Z100 640x240}
4 : GRSTRT(1,1,1); {Z100 640x480}
5 : GRSTRT(2,0,0); {PC / IDS 640x400}
END;

{check for plotting of the whole world}
IF (MAX_LAT = 90) {if plotting whole world then clipping}
AND (MIN_LAT = -90) {is not needed}
AND (MAX_LON = 180)
AND (MIN_LON = -180)
THEN
NOCLIP
ELSE
CLIP;

FGSFNT; {select the standard graphics font}
VECABS; {use absolute vectors}

{establish window into the world coordinate space}
WINDOW(MIN_LON, MAX_LON, MIN_LAT, MAX_LAT);
{establish normalized device coordinate (NDC) space for this program}
NDC(0.0, 1000.0, 0.0, 1000.0);
{establish viewport within the NDC space}
VIEW(0.0, 1000.0, 250.0, 1000.0);

LINCLR(7); {set line color to white}
DASHPT(16); {select a solid line style}
MOVE(MIN_LON, MIN_LAT); {locate to the lower left corner of viewport}
DRAW(MAX_LON, MIN_LAT); {draw a}
DRAW(MAX_LON, MAX_LAT); {box around}
DRAW(MIN_LON, MAX_LAT); {the}
DRAW(MIN_LON, MIN_LAT); {whole viewport}


DASHPT(0); {select solid line style}
ASSIGN(MAP_FILE, FILE_NAME); {identify map file to operating system}
RESET(MAP_FILE); {position to beginning of file}

{now we build the display}
WHILE NOT EOF(MAP_FILE) DO {process all records in file}
BEGIN
READ(MAP_FILE, NEXT_POINT); {get a record}
IF (NEXT_POINT.CODE > 5) {check for first point in each line}
OR (ABS(LAST_POINT.LON - NEXT_POINT.LON) > 10800) THEN
PLOT(FLOAT(NEXT_POINT.LON), FLOAT(NEXT_POINT.LAT)) {plot point}
ELSE
DRAW(FLOAT(NEXT_POINT.LON), FLOAT(NEXT_POINT.LAT)); {draw line}
LAST_POINT := NEXT_POINT; {save point just processed}
END; {display completed}

WRITE(CHR(7)); {signal plot is done}

CLOSE(MAP_FILE); {close map data input file}

FGREADLN(DUMMY); {wait for keyboard input}

LINCLR(7); {set foreground color to white}
BKGCLR(0); {set background color to black}

{exit the graphics mode and leave the system in normal text mode}
CASE SYSTEM OF
1 : GRSTOP;
2 : BEGIN
INIT_VEC[1] := 3; {leave EGA in 80 x 25 color text mode}
GRDONE(-1, INIT_VEC[1]);
END;
3 : GRSTOP;
4 : GRSTOP;
5 : GRSTOP;
END;

END.


  3 Responses to “Category : Science and Education
Archive   : WDBDISK5.ZIP
Filename : WDB.PAS

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/