At 07:56 PM 2/5/2007, you wrote:

What about just using a string?  and midB?

Again, I wasn't looking for a workaround - I want to use Byte Arrays AS a workaround for something else.

I have lots of VB code I want to simply paste into RB, and that uses lots of buffers, ALWAYS using byte arrays. In VB, byte arrays are very fast used with memcpy-type functions to move things around and into other byte arrays.

It's simply the syntax and the pain to hand-edit lots of code to switch them to memoryblocks that I'm trying to avoid. Right now I have wrapper functions that do the trick of blasting bytes, but they use loops and it's likely much slower then a pointer/copy fucntion that I'm checking in List-Land (soon to be Forum-Land, sniff) to see if there's a pointer function to the inhouse RB arrays.

> >Actualy sounds to me like you might want to consider using a
> >memoryblock instead.
>
> That's sort of the backdoor. I'm trying to use lots of VB code pasted
> to RB, which uses byte arrays, and trying to avoid changing them to
> memory blocks. I'm completely used to using Byte Arrays as buffers.
>
> VB has a way of obtaining the pointer from a byte array; in fact, you
> just pass the first (or whatever) element to RtlMoveMemory in the C
> runtime, the Declare in VB interprets that as a pointer. Pointers in
> VB can be used, you just can't do anything directly to them. You
> receive a pointer to pass it. I'm just looking for it in the first place.
>
> So presently there is no way of getting a pointer to an element in a
> Byte Array in RB?
>
> >Also a simple benchmark might give you the answer.
>
> True, but I already know the outcome (could be wrong though).
>
> >I'd be interested to know if memoryblocks and memcpy beats simply
> >looping round the byte array in the normal fashion.
>
> I'll try, at least.
>
> >You cannot get pointers to an RB array. They are reference based only.
>
> RB knows them, so somehow they could be exposed?
>
> >If you want to play with pointers you have to be dealing with
> memoryblocks
> >and/or ptrs  derived from Declares.
>
> See above.


* * * * * * * * * * * * * * * * * * * * * * * * * * *
| Garth Hjelte                                      |
| Customer Service Representative, President        |
| Chicken Systems, Inc, Rubber Chicken Software Co. |
| 714 5th Street SE                                 |
| Willmar, MN 56201 USA                             |
|                                                   |
| 800-8-PRO-EPS    Toll Free Order Line (US Only)   |
| 320-235-9798     Tech Support, Sampler Questions  |
|                  International Line               |
| 360-838-7689     Fax                              |
| Product Sales:   [EMAIL PROTECTED]             |
| Product Support: [EMAIL PROTECTED]           |
| Sampler Q+A:     [EMAIL PROTECTED]                |
| Web Page:        www.chickensys.com               |
* * * * * * * * * * * * * * * * * * * * * * * * * * *

_______________________________________________
Unsubscribe:
<[EMAIL PROTECTED]>

REAL Software has decided to consolidate this mailing list with the online Forums.  
On Monday, February 12, 2007, this mailing list will no longer be active.  We 
encourage you to continue your REALbasic and REAL SQL Server discussions on the 
Forums.  If you are not presently a member of the forum, please sign up today at 
<http://forums.realsoftware.com>.

Reply via email to