DateTimes, LLongs and other 8-byte fields.

Ed Kleban Ed at Kleban.com
Thu Nov 17 01:28:31 CST 2005


I see that there are casting functions for the VCursor class, which I
understand are for moving values between a Cursor and a Table's Vfields.

But what I don't find are any functions to assist with getting 8-byte values
into and out of RB variables.

For example, How do I get the high vs low four bytes of an LLong or ULong
field?  The only mechanism I see for this is GetString an SetString, which
is a bit perplexing.  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?

How about some numeric accessor methods for VFields in general, or at least
the 8-byte fields specifically:

 rbIntVar = aVULongField.highLong
 rbIntVar = aVULongField.lowLong
 rbIntVar = aVLongField.hightLong
 rbIntVar = aVLongField.lowLong

Admittedly, most or all of these will be moving an unsigned 32-bit value
into what RB would treat as a signed integer, but at least we could rapidly
read and then "do the math" on binary values without having to go through
strings.

And who knows...  considering all the database announcements coming out of
REALsoftware, someday they might eventually implement size and
representation specific variables such as Int8, Int16, Int32, UInt8, UInt16,
and UInt32, and Byte;  then you wouldn't even have to do messy math.

Heck, they may even implement Int64 and UInt64 someday in which case you
could read, use, compare, and write the whole sucker directly.

Also, for dates and times:

 rbDateVar = aVDateTimeField.rbDateValue
 aVDateTimeField.setFromRbDateValue( rbDateValue )

By the way... If it should happen that in some distant year in the future
that the REALfolk did indeed implement variables such as Int8, Int16, Int32,
UInt8, UInt16, and UInt32, Byte, Int64 and UInt64 in the language, what
other advantages could Valentina make of such an addition?


 




More information about the Valentina mailing list