DateTimes, LLongs and other 8-byte fields.

Ed Kleban Ed at Kleban.com
Thu Nov 17 11:53:34 CST 2005




On 11/17/05 11:20 AM, "Charles Yeomans" <yeomans at desuetude.com> wrote:
  
> 
>> Yuck! ... or am I missing something here?
> 
> I think you're working too hard.  Valentina is extremely fast, so
> perhaps you might first write simpler code and Valentina supply the
> speed.

No, the problem is I'm not working at all.  Or rather I'm not writing the
code that does this yet, I'm merely thinking about it during the design
stage while reading and learning about Valentina.  The concerns expressed in
my email lack the benefit of grounding in real application usage.  I
appreciate the words of wisdom coming from your "voice of experience"
suggesting that my concern is basically a non-issue.  That's a good thing!

>> 
>> 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.

Ah!  So the string returned by GetString is a binary string. Doh!  Of course
it is. I was thinking it would be a printable numeric for some stupid
reason. That's the problem with having at least 5 overloaded uses for the
term "string".
 
Ok, this is the clue I was missing, and the exact MemoryBlock usage details
I knew had to exist but wasn't too clueful about.  Thanks Charles!
 
> 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.
> 

Naw, only thing I care about in this particular case is speed.  Also, I
predict it won't be long before the REALfolk implement Int64 and UInt64
which will offer another solution that hopefully is fast.  Presumably a cast
of  Integer = UInt64 would truncate the high-order word, and shifting the
bits right 32 position via a divide for example for a UInt64 would provide
the high-order word.  But the MemoryBlock solution is all I need for now.

Thanks!

BTW, I use and love your ArraySorter.

> --------------
> Charles Yeomans
> 
 




More information about the Valentina mailing list