program LPMENU(input,output); { Program to run the Database suite} {Brian Gilmore September 1987} TYPE pns = string[40]; xxx = FILE of 0..255; {$I lptype.pas} VAR control: text; chainfile: xxx; {program file} s: string[14]; target, count, p1, p2, lno,vkey,row,col,spt,i,flag,dstart,rlen,lflag: integer; x_now, x_party, p3, labels, addno, last_address, prev: integer; key: char; chng: boolean; {$i lpexti.pas} PROCEDURE Sh_Reg; VAR i, j, n, col: byte; row : integer; s, info : string[40]; dsc: string[12]; c: char; BEGIN assign(control, 'control'); reset(control); readln(control, max_party); for i := 0 to max_party do begin readln(control, s); end; readln(control, max_attr); for i := 1 to max_attr do begin readln(control, s); end; readln(control, j); for i := 0 to j do begin readln(control, s); end; Clear_From_line(1); cursor(2, 0); for i := 1 to 2 do write(scr_inv, 'Reg. Disc Info Currently Mounted? '); writeln(scr_nor); readln(control, n); col := 0; row := 0; for i := 1 to n do begin readln(control, s); info := ''; j := pos(' ', s); if j = 0 then begin writeln(s, ' Control file format?'); dsc := ''; end else begin dsc := copy(s, j+1, length(s)-j); s := copy(s, 1, j-1); j := pos(' ', dsc); if j <> 0 then begin info := copy(dsc, j+1, length(dsc)-j); dsc := copy(dsc, 1, j-1); end end; cursor(row+i+2, col); write(s:4, dsc:2, info:8); if i >= max_row-7 then begin row := -max_row+7; col := 40; end; s := concat(dsc, ':', s, '.dat'); if fstat(s) then write(' Ok') else write(' Not Present'); end; close(control, true); {cursor(23,0); write('Press any key to continue:');} {c := get; } request_register; clearscreen; END; PROCEDURE main_menu; VAR i,j : integer; BEGIN reset_viewport; cursor(0, 0); write('Edinburgh South Election Package ((c) Brian Gilmore 1987)'); set_viewport(1); title := ''; REPEAT mess[0].s := 'Exit Program '; mess[1].s := 'Enter Canvass Returns '; mess[2].s := 'Count Canvass Totals '; mess[3].s := 'Print Target Lists or Labels'; mess[4].s := 'Run Polling Day Program '; mess[5].s := 'Select a Register '; i := get_option(0, 5, 0); s := ''; CASE i of 0: ; 1: s := 'LPVOT.com'; 2: s := 'LPCOUNT.com'; 3: s := 'LPPRINT.com'; 4: s := 'LPPOLL.com'; 5: Sh_Reg; END; if s <> '' then begin reset_Viewport; clearscreen; cursor(0, 20); write(scr_inv, mess[i].s, scr_nor); set_viewport(1); if reg <> '' then s := concat(s, ' ',reg); {PC ONLY} chain(s); end; UNTIL i = 0; END; BEGIN Ready_Keyboard; Clearscreen; main_menu; reset_viewport; clearscreen; END.