DateTimes, LLongs and other 8-byte fields.

Charles Yeomans yeomans at desuetude.com
Thu Nov 17 12:20:52 CST 2005


On Nov 17, 2005, at 4:17 AM, Ed Kleban wrote:

>
>
>
> On 11/17/05 2:26 AM, "Ruslan Zasukhin" <sunshine at public.kherson.ua> 
> wrote:
>
>> On 11/17/05 9:28 AM, "Ed Kleban" <Ed at Kleban.com> wrote:
>>
>> Hi Ed,
>>
>>> 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.
>>
>> Mmmmm actually this is to write one line of code instead of 2
>>
>>     fldLong = curs.Longfield( I )
>>
>> vs
>>
>>     fld = curs.field( I )
>>     fldLong = Vlong( fld )
>>
>
> Ah. Makes sense.  I hadn't thought it through but presumed it was for
> something like that.  This would be a good statement to add to the 
> manual.
>
>>> But what I don't find are any functions to assist with getting 
>>> 8-byte values
>>> into and out of RB variables.
>>
>> Moment. FYI.
>>
>> REALbasic send/get to plugin always int = 4 bytes
>>
>> IF you put this into Valentina's Vbyte field, then on disk will be 
>> use ONE
>> byte only
>>
>
> Yes, exactly what I expected.  That's fine.
>
>>> 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
>>
>> Not agree.
>>
>> We give you 8 bytes, which we have extract from Table.
>>
>> You self can get any bit as you want using YOUR language.
>> If REALbasic is not able do this, I think exists plugins which can.
>>
>> IT is not Valentina task split to bits
>>
>
> Fair enough, especially since I expect there's some simple way to do 
> this
> that's not apparent to me.  Possibly by mapping a Memory block pointer 
> to
> the VField or something.  I'll run this by Thomas Templeton or the NUG 
> list
> on RB.  Or I see Charles Yeoman is on this list.  He'll likely know.

It's not hard to get the four-byte pieces. Take the string returned 
from a LLong or ULLong field, stick it into an eight-byte MemoryBlock, 
then read out the pieces using MemoryBlock.Long.  For MacOS, it would 
be simple enough to write U64 and S64 classes that use the OS support 
for 64-bit integers, and make them work with Valentina.  I have some 
classes half-written already. This wouldn't be a fast solution, but it 
would work.


--------------
Charles Yeomans



More information about the Valentina mailing list