Announcement

Collapse
No announcement yet.

I've lost the plot 2...accessing strings using byte ptrs

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

  • I've lost the plot 2...accessing strings using byte ptrs

    Here's my little test and I'm not sure...why ? @p is giving me 85 and not 97.
    Any help much appreciated.

    cls
    dim p as byte ptr
    s$ = "abc"
    p = strptr(s$)
    ? @p
    ? asc(left$(s$,1))
    if input$(1) = "x" then end

    'output
    '85
    '97

    As an aside...I just read that in pb35 you can have 200 levels of ptr indirection i.e. @@@@@....@p? WOWWWW!!!!
    Did that go away in the windows versions or is it still there?

  • #2
    ok solved with strptr32 rather than strptr
    found here...
    https://forum.powerbasic.com/forum/u...inters-strings
    I had the same problem with asciiz strings and used varptr32
    courtesy of Lance and Paul in another thread.
    Last edited by Dean Gwilliam; 17 Jul 2017, 03:42 AM.

    Comment

    Working...
    X