DateTimes, LLongs and other 8-byte fields.

Ed Kleban Ed at Kleban.com
Thu Nov 17 17:37:27 CST 2005




On 11/17/05 5:12 PM, "Ruslan Zasukhin" <sunshine at public.kherson.ua> wrote:
 
> 
> In terms of C++
> 
>     GetString for integer executes   itoa()
> 

That is most unfortunate, at least for my interests.  So then, we're back to
where we started, name the point where I stood up on a soapbox and
proclaimed:

"I use Valentina to do a super fast lookup of my data to get it into a
current Table record or into a Cursor, but then I have to convert a binary
value to a string which I then have to chop up with string operations and
convert back to a binary value to use?
Yuck! ... or am I missing something here?"

So if I understand this correctly to get read an integer value from a Vshort
I have to write code that looks like:

    dim anInt as Integer
    dim valueToStore as Integer = 5423

    anInt = val( aVShortField.getString( ))
    aVShortField.setString( str( valueToStore ) )

I got that right?
All I can say is... Yuck!

Oh well... at least I know how to do it.

Ah, but wait! There may yet be hope.

I see that there is a Value property.  Thus I can presumably say:

    anInt = aVShortField.value
    aVShortField.value = valueToStore

This was what I was missing.  I was looking for a function instead of a
property.

So presumably I can also use:

    anInt = aVULongFile.value

and end up with the low 32-bit word of the ULong field, although as Ruslan
ponits out, if the high-order bit is set the value of anInt will be negative
and require some bit twiddling; probably just a single subtraction or
boolean operation.

And if I want the high order word I can indeed use GetString() or wait until
the REALfolk provide UInt64 and friends.

Ok, I'm back on target and happy.  I guess Ruslan wasn't brain dead after
all when designing this part of the interface.  We'll have to look elsewhere
I guess if we want to try and find someplace where he was  ;-)

Thanks for putting up with my wild goose chase.   I need to start coding and
stop emailing to get some experience.

Later!
--Ed




More information about the Valentina mailing list