http://www.realsoftware.com/feedback/viewreport.php?reportid=forgezvx

When dealing with declares or ptr, currently the only way of accessing a C
array via a PTR variable is by using a byte offset. It would be much more
readable and helpful if one could also access C array elements in a manner
similar to C - 

one solution might be to use [index] as opposed to (index)

so we could write:

dim myCInt64ArrayPointer as Ptr = getMyPointer()
dim myElement as Int64 = Ptr.Int64[8]

note that whereas dim myElement as Int64 = Ptr.Int64(8) returns the second
element as an offset of 8 gives us the second Int64 in the array
dim myElement as Int64 = Ptr.Int64[8] would return the 8th element - ie
using 
an offset from Ptr of 8X8 bytes.
Sign on here if this is of use to you:

http://www.realsoftware.com/feedback/viewreport.php?reportid=forgezvx


this would apply naturally to pointers to arrays of structs - so we could
write:
dim myElement as myStruct = Ptr. myStruct[8] would again return the 8th
element.

this saves a lot of tedious offset calculations and makes such code
potentially faster and readable.


_______________________________________________
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