home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.pascal
- Path: sparky!uunet!das.wang.com!wang!news
- From: s2861785@techunix.technion.ac.il (Alon Ziv)
- Subject: Apparent bug in TurboVision TInputLine
- Organization: /u1/023/s2861785/.organization
- Date: Fri, 14 Aug 1992 10:24:43 GMT
- Message-ID: <S2861785.92Aug14102443@techunix.technion.ac.il>
- Sender: news@wang.com
- Lines: 32
-
- While writing some TVision code, I came up with some rather weird
- behaviour in TInputLine's methods. It would seem that TInputLine uses
- DataSize in some unexpected ways, so, for instance, if you overload it
- to provide (say) LongInt data, and your SetData looks like
-
- procedure TInputLong.SetData(var Rec);
- {-Set data in a TInputLong (**BUGGY**) }
-
- var
- RecAsLongInt: LongInt
- absolute Rec;
- S: String;
-
- begin {SetData}
- Str(RecAsLongInt: MaxLen, S);
- TInputLine.SetData(S);
- end; {TInputLong.SetData}
-
- (Yes, I know this is a little silly to do... Actually, what I had was
- a 'grandchild' of TInputLine using its parent's method, which used
- TInputLine's... )
-
- The above code won't work, because TInputLong.DataSize returns
- 4=SizeOf(LongInt) and causes TInputLine.SetData to copy just 4 bytes
- from S (which probably won't be right...)
-
- -az
- --
- Internet: s2861785@tx.technion.ac.il . __
- I'M A STUDENT: When I'm wrong, it's my teacher's fault _| /
- (when I'm right, the credit is all mine!) / | /_
- Alon Ziv
-