Announcement

Collapse
No announcement yet.

Assigning a double word ptr to string data

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Jim Seekamp
    replied
    Thanks Michael -
    That's exactly what I was looking for!

    Leave a comment:


  • Michael Mattias
    replied
    REDIM bc???(1 TO LEN(W$)\4 - (LEN(W$) MOD 4 <> 0 ) AT STRPTR (W$)

    Does not create a copy: Changes to W$ automatically change the values of the elements of bc???() (which just might be the behavior you are after?)

    Changes to length of W$ of course require REDIM, but that's true even when you DO copy the string bytes to the integer array.

    MCM

    Leave a comment:


  • Paul Dixon
    replied
    Jim,
    Code:
    ptbc=ptw
    just assigns the value of the pointer itself. You need to us @ to assign the thing being pointed to by the pointer.
    Paul.

    Leave a comment:


  • Jim Seekamp
    started a topic Assigning a double word ptr to string data

    Assigning a double word ptr to string data

    I'm attempting to assign a string's bytes to a double word array. Here's what I tried that doesn't work:

    Code:
               dim bc???(1 to lnw???)
    
               dim ptbc as dword ptr
               dim ptw as string ptr
    
               ptbc=varptr(bc???(1))
               ptw=strptr(w$)
    
               ptbc=ptw
    I know there is a way to do this, just can't remember how!
    Any ideas?
Working...
X