[AccessD] Treat string as array

Arthur Fuller fuller.artful at gmail.com
Sat Mar 22 18:02:25 CDT 2008


In C this would be a cinch, but in Access we're way higher than that. But
let me think on this for a bit. I'm sure there's a way to cut through the
high-level giftwrap and do what you want. Back soon on this.

A.

On 3/22/08, jwcolby <jwcolby at colbyconsulting.com> wrote:
>
> A for next iterator.
>
> Dim varChar as variant
> For each varChar in arrSomeStr
>         Do something with varChar
> Next varChar
>
> Much cleaner than
>
> Dim IntPtr
> Dim varChar as variant
>         for intPtr <=len(strSomeStr)
>                 varChar = mid(strsomestr,intprt,1)
>                 So something with VarChar
>         next intprt
>
> They both work but...
>
> Strings are just pointers to an memory location on the heap.  Turning a
> string into an array of characters SHOULD be a function call, optimized in
> assembler to be blindingly fast.
>
>



More information about the AccessD mailing list