On 14-Sep-06, at 5:48 PM, Walter Purvis wrote:

 -----Original Message----- (Daniel Stenning)

 - now wouldn't it be nice if we could just do:

 dim m as new MemoryBlock(800)
   for i as integer = 0 to 100
     m.Double[I] = 666.666
   Next

You can do exactly that if you really want to, with a bit of overhead. m.Double is a function, so just subclass memoryblock and write your own function that does what you want.

 Asn well as

   for i as integer = 0 to 100
     p.Double[I] = 666.666
   Next

Yes, it would be nice - that's why I suggested more robust pointers. It would be great if we could do something like "Pointer p As Double" instead of "Dim p As Ptr", and modify it directly "p(i) = 666.666" (does that make sense? or am I nuts?)

I don't see why you couldn't just do:

  dim m as new MemoryBlock(800)
  dim p as ptr = m.Ptr(0)
    for i as integer = 0 to 99 step 8
    p.Double(i) = 666.666
  Next

When you're touching values in sequence that certainly makes a lot of sense but I can understand Daniel's furstrations when you need random access.

Frank.
<http://developer.chaoticbox.com/>


_______________________________________________
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