home *** CD-ROM | disk | FTP | other *** search
- {
- ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
- ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
- ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
- ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
- ▓▓▓▓▓▓▓▓·── ──·▓▓▓▓▓▓▓▓▓▓▓
- ▓▓▓▓▓▓▓▓│ │░░▓▓▓▓▓▓▓▓▓
- ▓▓▓▓▓▓▓▓ ECO_Door was conceived, designed and written ░░▓▓▓▓▓▓▓▓▓
- ▓▓▓▓▓▓▓▓ by Floor A.C. Naaijkens for ░░▓▓▓▓▓▓▓▓▓
- ▓▓▓▓▓▓▓▓ UltiHouse Software / The ECO Group. ░░▓▓▓▓▓▓▓▓▓
- ▓▓▓▓▓▓▓▓ ░░▓▓▓▓▓▓▓▓▓
- ▓▓▓▓▓▓▓▓ (C) MCMXCII by EUROCON PANATIONAL CORPORATION. ░░▓▓▓▓▓▓▓▓▓
- ▓▓▓▓▓▓▓▓ All Rights Reserved for The ECO Group. ░░▓▓▓▓▓▓▓▓▓
- ▓▓▓▓▓▓▓▓ ░░▓▓▓▓▓▓▓▓▓
- ▓▓▓▓▓▓▓▓ ECO_Door interfaces between Fossil, RA/Quick ░░▓▓▓▓▓▓▓▓▓
- ▓▓▓▓▓▓▓▓ and Turbo Pascal User ░░▓▓▓▓▓▓▓▓▓
- ▓▓▓▓▓▓▓▓│ │░░▓▓▓▓▓▓▓▓▓
- ▓▓▓▓▓▓▓▓·── ──·░░▓▓▓▓▓▓▓▓▓
- ▓▓▓▓▓▓▓▓▓▓░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░▓▓▓▓▓▓▓▓▓
- ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
- ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
- ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
- ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
- }
- {$I-}
- unit eco_door;
- interface
- uses
- dos,
- eco_asyn, eco_ansi,
- unit_fil, unit_cmd, unit_str
-
- ;
-
-
- const
- user_ansi_possible_ : boolean = true;
- ansi_possible_ : boolean = true;
- user_online_ : boolean = false;
-
-
- type
- sysinforec_ = record
- callcount : longint;
- lastcaller : string[35];
- extraspace : array[1..128] of byte;
- end;
-
- timelogrec_ = record
- startdate : string[8];
- busyperhour : array [0..23] of integer;
- busyperday : array [0..6] of integer;
- end;
-
- flagtype_ = array [1..4] of byte;
-
- gosubdatatype_ = array [1..20] of string[8];
-
- string80_ = string[80];
- userrec_ = record
- name_ : string[35];
- city_ : string[25];
- pwd_ : string[15];
- dataphone_,
- homephone_ : string[12];
- lasttime_ : string[5];
- lastdate_ : string[8];
- attrib_ : byte;
- flags_ : flagtype_;
- credit_,
- pending_,
- timesposted_,
- highmsgread_,
- seclvl_,
- times_,
- ups_,
- downs_,
- upk_,
- downk_,
- todayk_,
- elapsed_,
- len_ : integer;
- combinedptr_ : word;
- age_ : byte;
- extraspace_ : array [1..5] of byte;
- end;
-
- eventrec_ = record
- status_ : byte;
- runtime_ : string[5];
- errorlevel_ : byte;
- days_ : byte;
- forced_ : boolean;
- lasttimerun_ : string[8];
- end;
-
- exitrec_ = record
- baudrate_ : integer;
- sysinfo_ : sysinforec_;
- timeloginfo_ : timelogrec_;
- userinfo_ : userrec_;
- eventinfo_ : eventrec_;
- netmailentered_ : boolean;
- echomailentered_ : boolean;
- logintime_ : string[5];
- logindate_ : string[8];
- tmlimit_ : integer;
- loginsec_ : longint;
- credit_ : longint;
- userrecnum_ : integer;
- readthru_ : integer;
- pagetimes_ : integer;
- downlimit_ : integer;
- wantchat_ : boolean;
- gosublevel_ : gosubdatatype_;
- menu_ : string[8];
- end;
-
-
-
- var
- ansi_ : boolean;
- baudstring_ : string[6];
- baud_ : word;
- parity_ : char;
- databits_ : byte;
- stopbits_ : byte;
- extendedchars_ : boolean;
- hotkeyon_ : boolean;
- hotkeypressed_ : boolean;
- inactiveval_ : word;
- local_ : boolean;
- portnum_ : byte;
- snoop_ : boolean;
- sysopfirst_ : string80_;
- sysoplast_ : string80_;
- sysopname_ : string80_;
- systemname_ : string80_;
- timeremaining_ : word;
- usercitystate_ : string80_;
- userfirst_ : string80_;
- userlast_ : string80_;
- username_ : string80_;
- usersecurity_ : word;
-
-
- dorinfofile_ : text;
- dorinfo_ : string;
- cmdtoken : _cmdtoken;
- cmdtext, cmdvalue : string;
- retoption, error : word;
- comm_port_ : byte;
-
-
-
- function homeclreol_: ansi_seq_;
- procedure delline_;
- procedure backspace_;
- function carrier_: boolean;
- procedure write_ (st: string);
- procedure writeln_(st: string);
- procedure showfile_(fl: string);
-
-
-
- implementation
- var
- receivedch_ : char;
- st : string;
- i : integer;
- succes : boolean;
-
-
-
- function homeclreol_: ansi_seq_;
- begin
- homeclreol_ := left_cursor_(80) + clreol_;
- end;
-
-
- procedure delline_;
- begin
- if ansi_possible_ then write(output,homeclreol_);
- if user_online_ and user_ansi_possible_ then begin
- comwrite_(comm_port_,homeclreol_);
- end else if user_online_ then comwrite_(comm_port_,replicate(80,#12));
- end;
-
-
-
- procedure backspace_;
- begin
- if ansi_possible_ then begin
- write(output,left_cursor_(1)); write(' '); write(output,left_cursor_(1));
- end;
- if user_online_ and user_ansi_possible_ then begin
- comwrite_(comm_port_,left_cursor_(1) + ' ' + left_cursor_(1));
- end else if user_online_ then comwrite_(comm_port_,#12);
- end;
-
-
-
- function carrier_: boolean;
- begin
- carrier_ := dcdstat_(comm_port_);
- end;
-
-
-
- procedure write_(st: string);
- begin
- write(output,st);
- if user_online_ then comwrite_(comm_port_,st);
- end;
-
-
- procedure writeln_(st: string);
- begin
- writeln(output,st);
- if user_online_ then comwrite_(comm_port_,st+#10+#13);
- end;
-
-
- procedure showfile_(fl: string);
- var showf: text;
- st: string;
- begin
- if __existfil(fexpand(fl)) then begin
- assign(showf, fexpand(fl)); reset(showf);
- while not(eof(showf)) do begin
- readln(showf,st); writeln_(st);
- end;
- close(showf);
- end else begin write_(#7); write_('■ Error 2; File not found.'); end;
- end;
-
-
-
- var
- tm: integer;
-
- begin
- write_(clrscr_);
- if paramstr(1)='/?' then begin
- writeln('■ This program has been compiled using FastDoor');
- writeln(' FastDoor has a fixed commandline readout, use a CFG file');
- writeln(' to control other options you want to include, besides the');
- writeln(' following overrides (one letter is enough, so /P n works) :');
- writeln;
- writeln(' /PORT n');
- writeln(' /BAUD n');
- writeln(' /DATABITS n');
- writeln(' /STOPBITS n');
- writeln(' /WORDPARITY x');
- writeln(' /USERINFO file (override from DORINFO1.DEF)');
- writeln(' /OVERRIDEANSI [T{RUE}|F{ALSE}]');
- writeln('___________________________________________________');
- end;
- { by using ECO_ansi, all input/output is done using std i/o }
- comm_port_ := 3; (* default com port *)
- dorinfo_ := fexpand('DORINFO1.DEF'); (* dorinfo file, may be overridden *)
-
- if __existfil(dorinfo_) then begin
- assign(dorinfofile_, dorinfo_); reset(dorinfofile_);
- readln(dorinfofile_, systemname_);
- readln(dorinfofile_, sysopfirst_);
- readln(dorinfofile_, sysoplast_);
- readln(dorinfofile_, st);
- portnum_ := str_to_int(st[4]);
- readln(dorinfofile_,st);
- i := 1; while st[i]<>' ' do inc(i);
- baud_ := str_to_int(copy(st,1,i-1));
- while st[i]<>',' do inc(i);
- parity_ := st[i+1];
- databits_ := str_to_int(st[i+3]);
- stopbits_ := str_to_int(st[i+5]);
- readln(dorinfofile_, st);
- readln(dorinfofile_, userfirst_);
- readln(dorinfofile_, userlast_);
- readln(dorinfofile_, usercitystate_);
- readln(dorinfofile_, st);
- if st[1]='0' then user_ansi_possible_ := false;
- readln(dorinfofile_, st);
- usersecurity_ := str_to_int(st);
- readln(dorinfofile_, st);
- timeremaining_ := str_to_int(st);
- close(dorinfofile_);
- end else begin
- writeln('■ Error 2 reading file ',fexpand(dorinfo_));
- halt(2);
- end;
-
-
- { get overriding parameters }
- initcmd;
- __parsecmd(_commandline, _cmdreset, 0, cmdtoken, cmdtext,
- @cmdvalue, retoption, error);
- repeat
- __parsecmd(_commandline, _cmdnext, 0, cmdtoken, cmdtext,
- @cmdvalue, retoption, error);
- if error=0 then
- case cmdtoken._cmdindex of
- 1: begin writeln(cmdvalue); comm_port_ := str_to_int(cmdvalue) end;
- 2: baud_ := str_to_int(cmdvalue);
- 3: databits_ := str_to_int(cmdvalue);
- 4: stopbits_ := str_to_int(cmdvalue);
- 5: parity_ := cmdvalue[1];
- 6: dorinfo_ := cmdvalue;
- 7: if upcase(cmdvalue[1])='T' then user_ansi_possible_ := true else
- user_ansi_possible_ := false;
- end else if error <> _complete_cmd then begin
- writeln('■ Error 153; Bad command line option: ',cmdtext); halt(153)
- end;
- until error = _complete_cmd; __zapwdcmd; { no heap neaded for cmds }
-
- writeln('■ User info succesfully read. FastDoor set up.');
- writeln('■ Installing internal COMport handler. accesses the hardware directly.');
- writeln('■ FastPort will be set to H/W-port (0=COM1) ',comm_port_-1,
- ' with the following parameters:');
- writeln(' COM',comm_port_,', at ',baud_,' baud, with ',databits_,
- ' Databits, ',stopbits_,' Stopbits and Parity = ',parity_);
-
- if dcdstat_(comm_port_) then user_online_ := true else begin
- sound(500); delay(100); nosound;
- write_(colormode_(reverse_, f_black_, b_white_));
- write_('■ No user online! ');
- write_(colormode_(normal_, f_white_, b_black_));
- write_(''); writeln_('');
- end;
-
- if not reopencom_(comm_port_,2400,2400) then begin
- writeln('■ Error 162: Hardware failure. Modem COM params could not be set.');
- closecom_(comm_port_); halt(162);
- end else begin
- writeln('■ Re-opened, setting params now..');
- {comparams_(comm_port_, baud_, databits_, parity_, stopbits_)
- tijdelijk uit, is niet nodig??}
- end;
-
- clearcom_(comm_port_, 'B');
- if dsrstat_(comm_port_) then writeln('■ Data Set Ready.') else
- writeln('■ Data Set Not Ready');
-
- end.
-