[fpc-pascal] ftGuid displaytext & output

Reinier Olislagers reinierolislagers at gmail.com
Sat Aug 13 09:36:07 CEST 2011


While trying to export dataset data to XML, I use this for ftGUID fields:

        FNode :=
Foutputdoc.CreateTextNode(Utf8decode(GUIDToString(TGuid(EF.Field.Value))));

This works on Windows 32 and shows a hex representation of the GUID, like
{00000000-0000-0000-C000-000000000046}

On Linux x64, I get: "Illegal type conversion: "Variant" to "TGuid""

I then tried something like:
        FNode :=
Foutputdoc.CreateTextNode(Utf8decode(EF.Field.DisplayText));
However, this just output the GUID as a number (e.g. 42)

1. Is the conversion error I got due to the use of a 64 bit compiler?
How can I fix it? (e.g. use EF.Field.AsLargeint - but that has 64 bits,
not the the 128 bits present in a GUID)

2. Is the behaviour of .DisplayText correct for ftGUID variables -
shouldn't it use GUIDToString to output the hex value?

Thanks,
Reinier



More information about the fpc-pascal mailing list