Announcement

Collapse
No announcement yet.

Array scan on dynamic strings

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

  • Array scan on dynamic strings

    We use an array with dynamic strings.
    The first 4 bytes are used for index purposes.
    If the string is empty, will PB recognize this and skip this item on scan?

    (Using from 1 to 4)

    ??


    ------------------
    [email protected]
    hellobasic

  • #2
    If you specify the byte range in the ARRAY SCAN statement (FROM..TO), then empty (nul) strings will not match the given search expression so they are effectively passed over.
    Code:
    ARRAY SCAN A(iStart&) FOR iCount&, FROM 5 TO 8, = "TEST", TO iResult&

    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]

    Comment


    • #3
      Thanks,

      I was a bit worried this could lead to a crash or so, therefore..


      ------------------
      [email protected]
      hellobasic

      Comment

      Working...
      X