Announcement

Collapse

Maintenance

The forum could be offline for 30-60 minutes in the very near future for maintenance (said 3pm Pacific). I was behind on getting this notice. I do apologize.
See more
See less

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