Announcement

Collapse
No announcement yet.

Fixed string pointer

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

  • Dale Yarker
    replied
    Thanks. Went back into Help (8.03):

    "Help | Data Types | Pointer Data Types |Pointers to ASCIIZ and fixed-length strings"

    and found that syntax in examples for ASCIIZ only. Like I said, brain lock prevented making connection to fixed length (though obvious now).

    Cheers,

    Leave a comment:


  • Bob Zale
    replied
    The correct syntax is:

    LOCAL pMyStr as STRING POINTER * 16


    Best regards,

    Bob Zale
    PowerBASIC Inc.

    Leave a comment:


  • Dale Yarker
    started a topic Fixed string pointer

    Fixed string pointer

    Maybe just having case of brain lock this morning, but having trouble
    dim'ing a pointer to a fixed length string.
    Code:
    #compile exe
    #dim all
    
    function pbmain () as long
      local TargStr as string * 16
      local MyStr as string * 16
      'un-comment one of next three lines
      'local pMyStr as MyStr pointer '<-- Undefined TYPE at "MyStr" during compile
      'local pMyStr as string * 16 pointer '<-- End of statement expected during compile
      'local pMyStr as string pointer '<-- GPF during run ... duh
      MyStr = "1234"
      pMyStr = varptr(MyStr)
      msgbox str$(pMyStr)
      TargStr = @pMyStr
      msgbox TargStr
    end function
    ???

    TIA,
Working...
X