PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → Variant data type
Variant data type
Débuté par John Marrone, 14 juil. 2004 16:19 - 2 réponses
Posté le 14 juillet 2004 - 16:19
I read data from an ascii file into variants, since I do not know the data type
before hand. I am trying to compare number values that are held in a variant
datatype. I can not get true comparrisons. I want to know if aArr[i,3] is = to 10.
aArr is a multi deminsion array of type variants. I have tried ConvertVariant()
but I can not get honest results. Any help out there would be great.

Thanks
John
Posté le 15 juillet 2004 - 13:47
Hi John,
I wouldn't ever use a variant when reading an ascii file. If you really don't know the data type, use string for all and decide later by analyzing the retrieved string. I think, the variant type was invented for a different scenario. It's good for communicating with the windows api and it could be used when reading an unknown file from a database e.g. making a reporting tool for any given data file.
Just my 2 cents
Guenter

I read data from an ascii file into variants, since I do not know the data type
before hand. I am trying to compare number values that are held in a variant
datatype. I can not get true comparrisons. I want to know if aArr[i,3] is = to 10.
aArr is a multi deminsion array of type variants. I have tried ConvertVariant()
but I can not get honest results. Any help out there would be great.

Thanks
John
Posté le 15 juillet 2004 - 15:32
Thanks for your 2 cents. I will give it a try.
John

Hi John,
I wouldn't ever use a variant when reading an ascii file. If you really don't know the data type, use string for all and decide later by analyzing the retrieved string. I think, the variant type was invented for a different scenario. It's good for communicating with the windows api and it could be used when reading an unknown file from a database e.g. making a reporting tool for any given data file.
Just my 2 cents
Guenter

I read data from an ascii file into variants, since I do not know the data type
before hand. I am trying to compare number values that are held in a variant
datatype. I can not get true comparrisons. I want to know if aArr[i,3] is = to 10.
aArr is a multi deminsion array of type variants. I have tried ConvertVariant()
but I can not get honest results. Any help out there would be great.

Thanks
John