Howdy, PB techies!
Ok, question to all (pardon my ignorance of this stuff, in advance):
I need to learn the concept of something, and require some help.
I have zero experience with translating structures written for many other
languages, such as Turbo-C, C++ and TPascal, to write PB 3.x source.
For example, my BBS (QuickBBS) has a typical structure which looks like
this, in the docs from the author for a file called MSGCFG.DAT (and
QuickBBS is Turbo Pascal...)
---------------------------- start here ------------------------------------
{ Configuration Information **********************************************
BoardRecord = record (* MSGCFG.DAT *)
Name : String[40];
Typ : TypeMsgs;
Kinds : KindMsgs;
Combined : Boolean;
Aliases : AskType;
Aka : Byte;
OriginLine : String[58];
AllowDelete : Boolean;
KeepCnt, (* Max # of Msgs to keep *)
KillRcvd, (* Kill received msgs after this
an
KillOld : Word; (* Kill msgs after this many days
)
ReadSec : SecurityRecord;
WriteSec : SecurityRecord;
TemplateSec : SecurityRecord;
SysopSec : SecurityRecord;
FileArea : Integer; (* for Fmail *)
Group : Byte;
Spare : Array[4..12] of Byte;
end;
-------------------------------- cut here ---------------------------------
Ok, since I am really new to file management such as random files and
records and so forth with PB, I was looking through the onscreen help
in the IDE and saw all the open commands, record lengths, etc., but
also noticed the MAP commands! But how do I use them properly with
the structures above? Ya see what I mean? ;-)
I saw no examples of HOW to logically approach making some code, using
the structures to create code which matches the structure, in PB talk!
Ya know, so that when I open the file, it properly reads the right
number of bytes, and records, and positions, etc., so the MAP data
acts as a template of sorts. Yes, that's the word... template. Or is it??!
I would be most grateful if any of you could supply me with a few VERY BRIEF
examples, some ideas on how to approach this. I plan to write some
utilities for the BBS, but alas - I need to know how to translate those
structures to PB source. See?? Apologies if I have not made myself clear.
Please, just some insights and tech tips - I'm not looking for anyone to
supply lengthy code but I would enjoy seeing a brief example maybe using
the first few structure lines only, to get my started.
I can't get the CONCEPT of how to create code, with MAP statements, or
whatever. Once I understand the concept, I'll take it from there.
Note of interest: I went to Borders, which has an extensive computer books
section, and NOTHING on PB was there! Jeeeeze! ;-)
-james
--- QuickBBS 2.80 GoldBase (Zeta-1)
---------------
* Origin: AD Message BBS/10th Year Online! (703)998-2958 (1:109/611@FIDONET)
|