[fpc-devel] Object upgrades (new)
wkitty42 at windstream.net
wkitty42 at windstream.net
Mon Jun 17 19:56:19 CEST 2019
On 6/17/19 12:49 PM, Sven Barth via fpc-devel wrote:
> <wkitty42 at windstream.net> schrieb am Mo., 17. Juni 2019, 14:15:
>
> On 6/17/19 1:54 AM, Sven Barth via fpc-devel wrote:
> > <wkitty42 at windstream.net> schrieb am Mo., 17. Juni 2019, 02:07:
> >
> > what always confused me these days is that records and objects were
> one thing
> > back in the (TP6) day but today they are something quite different...
> i had to
> > be very careful when i wrote my satellite TLE management tool because
> of these
> > differences...
> >
> >
> > Ehm... TP style objects were already quite different to records back in
> TP days.
>
> yes... what i'm saying is that today's are different and that's what
> confuses me...
>
> You are talking about classes, aren't you?
maybe... that's part of the confusion... i'm self taught from TP2... never took
any classes for anything computer at all... started with B.A.S.I.C. and a friend
showed me asm and pascal... i dropped basic like a hot potato and went all out
with asm and pascal... had a nice library of routines in asm but as each new TP
came out, fewer and fewer of my homegrown asm routines were needed... eventually
i was doing asm blocks in my pascal sources instead of compiling .obj files and
linking them in...
> in the day that i speak of, records were simple static blocks that contained
> data in a certain defined order... today's records have methods, too, which are
> more like objects back then... i forget the difference between yesterday's
> objects and today's...
>
>
> But back in the days the objects were already different from records.
right... i wrote my own objects when they were introduced and later extensively
used message base objects from Mark May when writing BBS message base tools...
some objects had (traditional) records* within them...
mksm106.zip 215k
MK Source for Msg Access v1.06 - Mark May's
Pascal OOP source code to access Squish,
Jam, Hudson, *.Msg, and Ezycom message
bases. Great for developing BBS utilities.
(FW)
ftp://sestar.synchro.net/main/PROG/mksm106.zip
i started, some time back, to convert the code to FPC but RL and other shite got
in the way...
> And yes, both are again different from classes.
yeah, i'll have to see if i can figure out what classes are and if they are one
of the old-school objects or records... yeah, i'm getting old and rarely dabble
in pascal code any more but i still read the mailing lists :)
*this is an example of a traditional record and a traditional object as i think
of them...
Type JamHdrType = Record
Signature: Array[1..4] of Char;
Created: LongInt;
ModCounter: LongInt;
ActiveMsgs: LongInt;
PwdCRC: LongInt;
BaseMsgNum: LongInt;
Extra: Array[1..1000] of Char;
End;
Const JamSubBufSize = 4000;
Type JamSubBuffer = Array[1..JamSubBufSize] of Char;
Type HdrType = Record
JamHdr: JamMsgHdrType;
SubBuf: JamSubBuffer;
End;
Type JamMsgObj = Object (AbsMsgObj)
JM: ^JamMsgType;
MsgHdr: ^HdrType;
JamIdx: ^JamIdxArrayType;
TxtBuf: ^JamTxtBufType;
Error: Longint;
Constructor Init; {Initialize}
Destructor Done; Virtual; {Done}
Procedure SetMsgPath(St: String); Virtual; {Set netmail path}
Function GetHighMsgNum: LongInt; Virtual; {Get highest netmail msg number in
area}
Function LockMsgBase: Boolean; Virtual; {Lock the message base}
Function UnLockMsgBase: Boolean; Virtual; {Unlock the message base}
Function WriteMailIdx(FN: String; MsgPos: Word): Word; Virtual; {Write
Netmail or EchoMail.jam}
Procedure SetDest(Var Addr: AddrType); Virtual; {Set Zone/Net/Node/Point for
Dest}
Procedure SetOrig(Var Addr: AddrType); Virtual; {Set Zone/Net/Node/Point for
Orig}
Procedure SetFrom(Name: String); Virtual; {Set message from}
Procedure SetTo(Name: String); Virtual; {Set message to}
Procedure SetSubj(Str: String); Virtual; {Set message subject}
Procedure SetCost(SCost: Word); Virtual; {Set message cost}
Procedure SetRefer(SRefer: LongInt); Virtual; {Set message reference}
Procedure SetSeeAlso(SAlso: LongInt); Virtual; {Set message see also}
Function GetNextSeeAlso: LongInt; Virtual;
Procedure SetNextSeeAlso(SAlso: LongInt); Virtual;
Procedure SetDate(SDate: String); Virtual; {Set message date}
Procedure SetTime(STime: String); Virtual; {Set message time}
Procedure SetLocal(LS: Boolean); Virtual; {Set local status}
Procedure SetRcvd(RS: Boolean); Virtual; {Set received status}
Procedure SetPriv(PS: Boolean); Virtual; {Set priveledge vs public status}
Procedure SetCrash(SS: Boolean); Virtual; {Set crash netmail status}
Procedure SetKillSent(SS: Boolean); Virtual; {Set kill/sent netmail status}
Procedure SetSent(SS: Boolean); Virtual; {Set sent netmail status}
Procedure SetFAttach(SS: Boolean); Virtual; {Set file attach status}
Procedure SetReqRct(SS: Boolean); Virtual; {Set request receipt status}
Procedure SetReqAud(SS: Boolean); Virtual; {Set request audit status}
Procedure SetRetRct(SS: Boolean); Virtual; {Set return receipt status}
Procedure SetFileReq(SS: Boolean); Virtual; {Set file request status}
Procedure DoString(Str: String); Virtual; {Add string to message text}
Procedure DoChar(Ch: Char); Virtual; {Add character to message text}
Procedure DoStringLn(Str: String); Virtual; {Add string and newline to msg text}
Procedure DoKludgeLn(Str: String); Virtual; {Add ^AKludge line to msg}
Function WriteMsg: Word; Virtual;
Function GetChar: Char; Virtual;
Procedure AddTxtSub(St: String);
Procedure MsgStartUp; Virtual; {set up msg for reading}
Function EOM: Boolean; Virtual; {No more msg text}
Function GetString(MaxLen: Word): ShortString; Virtual; {Get wordwrapped string}
Function WasWrap: Boolean; Virtual; {Last line was soft wrapped no CR}
Procedure SeekFirst(MsgNum: LongInt); Virtual; {Seek msg number}
Procedure SeekNext; Virtual; {Find next matching msg}
Procedure SeekPrior; Virtual; {Seek prior matching msg}
Function GetFrom: String; Virtual; {Get from name on current msg}
Function GetTo: String; Virtual; {Get to name on current msg}
Function GetSubj: String; Virtual; {Get subject on current msg}
Function GetCost: Word; Virtual; {Get cost of current msg}
Function GetDate: String; Virtual; {Get date of current msg}
Function GetTime: String; Virtual; {Get time of current msg}
Function GetRefer: LongInt; Virtual; {Get reply to of current msg}
Function GetSeeAlso: LongInt; Virtual; {Get see also of current msg}
Function GetMsgNum: LongInt; Virtual; {Get message number}
Procedure GetOrig(Var Addr: AddrType); Virtual; {Get origin address}
Procedure GetDest(Var Addr: AddrType); Virtual; {Get destination address}
Function IsLocal: Boolean; Virtual; {Is current msg local}
Function IsCrash: Boolean; Virtual; {Is current msg crash}
Function IsKillSent: Boolean; Virtual; {Is current msg kill sent}
Function IsSent: Boolean; Virtual; {Is current msg sent}
Function IsFAttach: Boolean; Virtual; {Is current msg file attach}
Function IsReqRct: Boolean; Virtual; {Is current msg request receipt}
Function IsReqAud: Boolean; Virtual; {Is current msg request audit}
Function IsRetRct: Boolean; Virtual; {Is current msg a return receipt}
Function IsFileReq: Boolean; Virtual; {Is current msg a file request}
Function IsRcvd: Boolean; Virtual; {Is current msg received}
Function IsPriv: Boolean; Virtual; {Is current msg priviledged/private}
Function IsDeleted: Boolean; Virtual; {Is current msg deleted}
Function IsEchoed: Boolean; Virtual; {Msg should be echoed}
Function GetMsgLoc: LongInt; Virtual; {Msg location}
Procedure SetMsgLoc(ML: LongInt); Virtual; {Msg location}
Procedure YoursFirst(Name: String; Handle: String); Virtual; {Seek your mail}
Procedure YoursNext; Virtual; {Seek next your mail}
Function YoursFound: Boolean; Virtual; {Message found}
Procedure StartNewMsg; Virtual;
Function OpenMsgBase: Word; Virtual;
Function CloseMsgBase: Word; Virtual;
Function MsgBaseExists: Boolean; Virtual; {Does msg base exist}
Function CreateMsgBase(MaxMsg: Word; MaxDays: Word): Word; Virtual;
Function SeekFound: Boolean; Virtual;
Procedure SetMailType(MT: MsgMailType); Virtual; {Set message base type}
Function GetSubArea: Word; Virtual; {Get sub area number}
Procedure ReWriteHdr; Virtual; {Rewrite msg header after changes}
Procedure DeleteMsg; Virtual; {Delete current message}
Function NumberOfMsgs: LongInt; Virtual; {Number of messages}
Function GetLastRead(UNum, UCRC: LongInt): LongInt; Virtual; {Get last read
for user num}
Procedure SetLastRead(UNum: LongInt; LR, UCRC: LongInt); Virtual; {Set last read}
Procedure MsgTxtStartUp; Virtual; {Do message text start up tasks}
Function GetTxtPos: LongInt; Virtual; {Get indicator of msg text position}
Procedure SetTxtPos(TP: LongInt); Virtual; {Set text position}
Procedure SetAttr1(Mask: LongInt; St: Boolean); {Set attribute 1}
Function ReadIdx: NumReadType;
Function WriteIdx: NumReadType;
Procedure AddSubField(id: SmallWord; Data: String);
Function FindLastRead(Var LastFile: pFileOBj; UNum, UCRC: LongInt): LongInt;
Function ReReadIdx(Var IdxLoc : LongInt) : Word;
Function IsNetMail: Boolean; virtual;
Procedure SetNetMail(SN: Boolean); virtual;
procedure ClearMsgText; virtual;
procedure UpdateMsgText(var WriteError: Word); virtual;
procedure SetDateTime;
{$IFNDEF MSDOS}
function GetMsgBuffer: AnsiString; virtual;
{$ENDIF}
End;
--
NOTE: No off-list assistance is given without prior approval.
*Please keep mailing list traffic on the list unless*
*a signed and pre-paid contract is in effect with us.*
More information about the fpc-devel
mailing list