On Apr 1, 2006, at 4:40 AM, Robert Carroll wrote:

I am running into a situation where integer values are being returned (from variants) as doubles.

I have been revising my scheme for storing preferences towards a dictionary/xml structure, instead of the current flat file. Most of the values that need to be stored are integers, however there is a mix of string values and booleans as well. These are now loaded into variant arrays, then written to disk as a plist file.

The integers are either stored in integer variables, or are extracted from text from editfields then loaded as integers.

When I parse the stored xml file, vartype(myvariant) returns a mix of integers and doubles for these numbers.

Before moving to variant based storage, I would always get only integer values back from the file.

What could be causing this?

thanks

Rob

I would guess that if you set your array values to WhateverVariant.IntegerValue that you would duplicate the previous behavior. As to what is causing it, two possibilities come to mind: perhaps your variants are used in an expression involving doubles before parsing and convert themselves to doubles, or, the values assigned as variants may exceed the integer range in which case vartype() in 5.5 will return 5 for double.

Best,

Jack
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to