Re: RE : [fpc-pascal] ftGuid displaytext output

2011-08-14 Thread Reinier Olislagers
On 13-8-2011 13:04, Ludo Brands wrote:
 TGuidField stores guid in the string format (GuidToString).
 EF.Field.AsString should give you the correct string value.
 
 Ludo
Thanks, Ludo.

I think I was using AsString at first.

I'll have a further look; maybe I'm putting in rubbish; I'll probably
have to assign the value to the field with something like GUIDToString...

Thanks,
Reinier
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] ftGuid displaytext output

2011-08-13 Thread Reinier Olislagers
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
{---C000-0046}

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
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


RE : [fpc-pascal] ftGuid displaytext output

2011-08-13 Thread Ludo Brands
 While trying to export dataset data to XML, I use this for 
 ftGUID fields:
 
 FNode := 
 Foutputdoc.CreateTextNode(Utf8decode(GUIDToString(TGuid(EF.Fie
 ld.Value;
 
 This works on Windows 32 and shows a hex representation of 
 the GUID, like {---C000-0046}
 
 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

TGuidField stores guid in the string format (GuidToString).
EF.Field.AsString should give you the correct string value.

Ludo

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal