home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
High Voltage Shareware
/
high1.zip
/
high1
/
DIR2
/
CNAMES10.ZIP
/
CNAMES.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-11-25
|
12KB
|
346 lines
{ CNAMES.TPU - Beta Copy - Rev 11/25/93 Version 1.0 }
{ CNAMES UNIT by Steve Horrighs, Copyright (C)1993 }
{ All rights reserved }
{ If you use this unit in your own programming, I ask }
{ only that you give me credit in your documentation. }
{ I do ask however, if you modify the Code please let }
{ me know so i can improve my methods as well :) }
{ Some portions where provided by Clark Development Company }
Unit Cnames;
InterFace
Const CNamesVersion = 'CNames Unit v. 1.0';
Type PCBCnamesRec = Record
Name : Array [1..14] of Char;
PublicConf : Boolean;
AutoReJoin : Boolean;
ViewMembers : Boolean;
PrivUplds : Boolean;
PrivMsgs : Boolean;
EchoMail : Boolean;
ReqSecLevel : Word;
AddSec : Word;
AddTime : Word;
MsgBlocks : Char;
MsgFile : Array [1..32] of Char;
UserMenu : Array [1..32] of Char;
SysopMenu : Array [1..32] of Char;
NewsFile : Array [1..32] of Char;
PubUpldSort : Char;
UpldDir : Array [1..29] of Char;
PubUpldLoc : Array [1..26] of Char;
PrvUpldSort : Char;
PrivDir : Array [1..29] of Char;
PrvUpldLoc : Array [1..26] of Char;
DrsMenu : Array [1..29] of Char;
DrsFile : Array [1..33] of Char;
BltMenu : Array [1..29] of Char;
BltNameLoc : Array [1..33] of Char;
ScrMenu : Array [1..29] of Char;
ScrNameLoc : Array [1..33] of Char;
DirMenu : Array [1..29] of Char;
DirNameLoc : Array [1..33] of Char;
PthNameLoc : Array [1..33] of Char;
end;
PCBCnamesRecStr = Record
Name : String [14];
PublicConf : Boolean;
AutoReJoin : Boolean;
ViewMembers : Boolean;
PrivUplds : Boolean;
PrivMsgs : Boolean;
EchoMail : Boolean;
ReqSecLevel : Word;
AddSec : Word;
AddTime : Word;
MsgBlocks : Byte;
MsgFile : String [32];
UserMenu : String [32];
SysopMenu : String [32];
NewsFile : String [32];
PubUpldSort : Byte;
UpldDir : String [29];
PubUpldLoc : String [26];
PrvUpldSort : Byte;
PrivDir : String [29];
PrvUpldLoc : String [26];
DrsMenu : String [29];
DrsFile : String [33];
BltMenu : String [29];
BltNameLoc : String [33];
ScrMenu : String [29];
ScrNameLoc : String [33];
DirMenu : String [29];
DirNameLoc : String [33];
PthNameLoc : String [33];
end;
Str32 = String [32];
Procedure GetCnamesRec(CnamesPath: Str32; RecNum: Longint;Var Rec:PCBCnamesRec);
Procedure GetCnamesRecStr(CnamesPath: Str32;RecNum:Longint;Var Rec:PCBCnamesRecStr);
Procedure ClearCnamesRecStr(Var Rec:PCBCnamesRecStr);
Procedure ClearCnamesRec(Var Rec:PCBCnamesRec);
implementation
Uses totMISC,Crt;
Procedure GetCnamesRec(CnamesPath: Str32;RecNum:Longint;Var Rec:PCBCnamesRec);
Var CnamesFile : File;
Sizeof : Word;
Jumpto : Longint;
Begin
Sizeof:= 0;
assign(CnamesFile,CnamesPath); FileMode:=0;
Reset(CnamesFile,1); FileMode:=2;
BlockRead(CnamesFile,Sizeof,2);
Jumpto:= RecNum * Sizeof;
Seek(CnamesFile,(Jumpto)+2);
Blockread(CnamesFile,Rec,Sizeof);
close(CnamesFile);
end;
Procedure GetCnamesRecStr(CnamesPath: Str32;RecNum:Longint;Var Rec:PCBCnamesRecStr);
Var CnamesFile : File;
Sizeof : Word;
Jumpto : Longint;
RecF : PCBCnamesRec;
Temp : String;
Begin
Sizeof:= 0;
ClearCnamesRecStr(Rec);
ClearCnamesRec(RecF);
assign(CnamesFile,CnamesPath); FileMode:=0;
Reset(CnamesFile,1); FileMode:=2;
BlockRead(CnamesFile,Sizeof,2);
Jumpto:= RecNum * Sizeof;
Seek(CnamesFile,(Jumpto)+2);
Blockread(CnamesFile,RecF,Sizeof);
close(CnamesFile);
For Jumpto := 1 to 14 do
begin
if RecF.Name[Jumpto] = #00 then
begin
Rec.Name[0] := chr(Jumpto-1);
Jumpto := 14;
end;
Rec.Name[JumpTo] := RecF.Name[Jumpto];
end;
For Jumpto := 1 to 32 do
begin
if RecF.Msgfile[Jumpto] = #00 then
begin
Rec.MsgFile[0] := chr(Jumpto-1);
Jumpto := 32;
end;
Rec.MsgFile[JumpTo] := RecF.MsgFile[Jumpto];
end;
For Jumpto := 1 to 32 do
begin
if RecF.UserMenu[Jumpto] = #00 then
begin
Rec.UserMenu[0] := chr(Jumpto-1);
Jumpto := 32;
end;
Rec.UserMenu[JumpTo] := RecF.UserMenu[Jumpto];
end;
For Jumpto := 1 to 32 do
begin
if RecF.SysopMenu[Jumpto] = #00 then
begin
Rec.SysopMenu[0] := chr(Jumpto-1);
Jumpto := 32;
end;
Rec.SysopMenu[JumpTo] := RecF.SysopMenu[Jumpto];
end;
For Jumpto := 1 to 32 do
begin
if RecF.NewsFile[Jumpto] = #00 then
begin
Rec.NewsFile[0] := chr(Jumpto-1);
Jumpto := 32;
end;
Rec.NewsFile[JumpTo] := RecF.NewsFile[Jumpto];
end;
if RecF.PubUpldSort = #0 then Rec.PubUpldSort := 0;
if RecF.PubUpldSort = #1 then Rec.PubUpldSort := 1;
if RecF.PubUpldSort = #2 then Rec.PubUpldSort := 2;
if RecF.PubUpldSort = #3 then Rec.PubUpldSort := 3;
if RecF.PubUpldSort = #4 then Rec.PubUpldSort := 4;
if RecF.MsgBlocks = #0 then Rec.MsgBlocks := 0;
if RecF.MsgBlocks = #1 then Rec.MsgBlocks := 1;
if RecF.MsgBlocks = #2 then Rec.MsgBlocks := 2;
if RecF.MsgBlocks = #3 then Rec.MsgBlocks := 3;
if RecF.MsgBlocks = #4 then Rec.MsgBlocks := 4;
For Jumpto := 1 to 29 do
begin
if RecF.UpldDir[Jumpto] = #00 then
begin
Rec.UpldDir[0] := chr(Jumpto-1);
Jumpto := 29;
end;
Rec.UpldDir[JumpTo] := RecF.UpldDir[Jumpto];
end;
For Jumpto := 1 to 26 do
begin
if RecF.PubUpldLoc[Jumpto] = #00 then
begin
Rec.PubUpldLoc[0] := chr(Jumpto-1);
Jumpto := 26;
end;
Rec.PubUpldLoc[JumpTo] := RecF.PubUpldLoc[Jumpto];
end;
if RecF.PrvUpldSort = #0 then Rec.PrvUpldSort := 0;
if RecF.PrvUpldSort = #1 then Rec.PrvUpldSort := 1;
if RecF.PrvUpldSort = #2 then Rec.PrvUpldSort := 2;
if RecF.PrvUpldSort = #3 then Rec.PrvUpldSort := 3;
if RecF.PrvUpldSort = #4 then Rec.PrvUpldSort := 4;
For Jumpto := 1 to 29 do
begin
if RecF.PrivDir[Jumpto] = #00 then
begin
Rec.PrivDir[0] := chr(Jumpto-1);
Jumpto := 29;
end;
Rec.PrivDir[JumpTo] := RecF.PrivDir[Jumpto];
end;
For Jumpto := 1 to 26 do
begin
if RecF.PrvUpldLoc[Jumpto] = #00 then
begin
Rec.PrvUpldLoc[0] := chr(Jumpto-1);
Jumpto := 26;
end;
Rec.PrvUpldLoc[JumpTo] := RecF.PrvUpldLoc[Jumpto];
end;
For Jumpto := 1 to 29 do
begin
if RecF.DrsMenu[Jumpto] = #00 then
begin
Rec.DrsMenu[0] := chr(Jumpto-1);
Jumpto := 29;
end;
Rec.DrsMenu[JumpTo] := RecF.DrsMenu[Jumpto];
end;
For Jumpto := 1 to 33 do
begin
if RecF.DrsFile[Jumpto] = #00 then
begin
Rec.DrsFile[0] := chr(Jumpto-1);
Jumpto := 33;
end;
Rec.DrsFile[JumpTo] := RecF.DrsFile[Jumpto];
end;
For Jumpto := 1 to 29 do
begin
if RecF.BltMenu[Jumpto] = #00 then
begin
Rec.BltMenu[0] := chr(Jumpto-1);
Jumpto := 29;
end;
Rec.BltMenu[JumpTo] := RecF.BltMenu[Jumpto];
end;
For Jumpto := 1 to 33 do
begin
if RecF.BltNameLoc[Jumpto] = #00 then
begin
Rec.BltNameLoc[0] := chr(Jumpto-1);
Jumpto := 33;
end;
Rec.BltNameLoc[JumpTo] := RecF.BltNameLoc[Jumpto];
end;
For Jumpto := 1 to 29 do
begin
if RecF.ScrMenu[Jumpto] = #00 then
begin
Rec.ScrMenu[0] := chr(Jumpto-1);
Jumpto := 29;
end;
Rec.ScrMenu[JumpTo] := RecF.ScrMenu[Jumpto];
end;
For Jumpto := 1 to 33 do
begin
if RecF.ScrNameLoc[Jumpto] = #00 then
begin
Rec.ScrNameLoc[0] := chr(Jumpto-1);
Jumpto := 33;
end;
Rec.ScrNameLoc[JumpTo] := RecF.ScrNameLoc[Jumpto];
end;
For Jumpto := 1 to 29 do
begin
if RecF.DirMenu[Jumpto] = #00 then
begin
Rec.DirMenu[0] := chr(Jumpto-1);
Jumpto := 29;
end;
Rec.DirMenu[JumpTo] := RecF.DirMenu[Jumpto];
end;
For Jumpto := 1 to 33 do
begin
if RecF.DirNameLoc[Jumpto] = #00 then
begin
Rec.DirNameLoc[0] := chr(Jumpto-1);
Jumpto := 33;
end;
Rec.DirNameLoc[JumpTo] := RecF.DirNameLoc[Jumpto];
end;
For Jumpto := 1 to 33 do
begin
if RecF.PthNameLoc[Jumpto] = #00 then
begin
Rec.PthNameLoc[0] := chr(Jumpto-1);
Jumpto := 33;
end;
Rec.PthNameLoc[JumpTo] := RecF.PthNameLoc[Jumpto];
end;
end;
Procedure ClearCnamesRecStr(Var Rec:PCBCnamesRecStr);
Begin
with Rec do
begin
Name:='';PublicConf:=FALSE;AutoReJoin:=FALSE;ViewMembers:=FALSE;DrsFile:='';
PrivUplds:=FALSE;PrivMsgs:=FALSE;EchoMail:=FALSE;ReqSecLevel:=0;BltMenu:='';
AddSec:=0;AddTime:=0;MsgBlocks:=0;MsgFile:='';UserMenu:='';SysopMenu:='';
NewsFile:='';PubUpldSort:=0;UpldDir:='';PubUpldLoc:='';PrvUpldSort:=0;
PrivDir:='';PrvUpldLoc:='';DrsMenu:='';BltNameLoc:='';ScrMenu:='';
ScrNameLoc:='';DirMenu:='';DirNameLoc:='';PthNameLoc:='';
end;
end;
Procedure ClearCnamesRec(Var Rec:PCBCnamesRec);
Var X : byte;
Begin
with Rec do
begin
PublicConf:=FALSE;AutoReJoin:=FALSE;ViewMembers:=FALSE;PrivUplds:=FALSE;
PrivMsgs:=FALSE;EchoMail:=FALSE;ReqSecLevel:=0;AddSec:=0;AddTime:=0;
MsgBlocks:=#0;PubUpldSort:=#0;PrvUpldSort:=#0;
For x := 1 to 14 do name[x] := #0;
For x := 1 to 32 do MsgFile[x] := #0;
For x := 1 to 32 do UserMenu[x] := #0;
For x := 1 to 32 do SysopMenu[x] := #0;
For x := 1 to 32 do NewsFile[x] := #0;
For x := 1 to 29 do UpldDir[x] := #0;
For x := 1 to 26 do PubUpldLoc[x] := #0;
For x := 1 to 29 do PrivDir[x] := #0;
For x := 1 to 26 do PrvUpldLoc[x] := #0;
For x := 1 to 29 do DrsMenu[x] := #0;
For x := 1 to 33 do DrsFile[x] := #0;
For x := 1 to 29 do BltMenu[x] := #0;
For x := 1 to 33 do BltNameLoc[x] := #0;
For x := 1 to 29 do ScrMenu[x] := #0;
For x := 1 to 33 do ScrNameLoc[x] := #0;
For x := 1 to 29 do DirMenu[x] := #0;
For x := 1 to 33 do DirNameLoc[x] := #0;
For x := 1 to 33 do PthNameLoc[x] := #0;
end;
end;
Begin
end.