Subject RE: [firebird-support] Pseudo-Boolean woes
Author Clay Shannon
Using .AsBoolean caused my run-time error.

But I solved it by creating a new "Logical" domain (as suggested by
Salvatore), adding new columns, copying data over from the existing
pseudo-booleans (0 where 'F', 1 otherwise), and then dropping the old
string/Boolean cols.

Clay Shannon,
Dimension 4 Software

-----Original Message-----
From: Pavel Menshchikov [mailto:mpn2001@...]
Sent: Monday, February 21, 2005 12:50 PM
To: Clay Shannon
Subject: Re: [firebird-support] Pseudo-Boolean woes


Hello Clay,

CS> I created a pseudo-Boolean domain (VarChar(1) with default 'F' value)
CS> However, at run time, I get "Invalid data conversion" when I attempt to
CS> access the field thus:
CS> qry.FldByName['LATEXALLERGY'].AsString;
CS> If I change the code to:
CS> qry.FldByName['LATEXALLERGY'].AsString;
CS> I get the following error at compile-time:
CS> "Incompatible Types: boolean and string"
CS> What can I do to access this string/boolean value?
CS> (Delphi 7, Firebird 1.5.2, FIB 6.1.0)
FIB+ treats your BOOLEAN domain as Delphi boolean field by default, so
either disable that feature of FIB+, or refer to the field value as
qry.FldByName['LATEXALLERGY'].AsBoolean.


HTH
--
Best regards,
Pavel Menshchikov
http://www.ls-software.com




Yahoo! Groups Links