PBWIN 8.03
The following code has a serious error
As stated in the manual the second time the loop encounters the DIM statement it will ignore it without an error. The PARSE statement however does not even require a pre dimensioned array but it is “advantageous”. On the second pass through the FOR loop the PARSE does not increase the size to fit the number of parsed strings nor does it give an error 9 in the debugger.
The following code has a serious error
Code:
SUB Whatever() LOCAL Split() AS STRING LOCAL InText(1) AS STRING LOCAL PCnt AS LONG LOCAL x AS LONG Intext(0) = "a,b,c" Intext(1) = "a,b,c,d,e,f" FOR x = 0 TO UBOUND(Intext) PCnt = PARSECOUNT InText(x) DIM Split(PCnt - 1) PARSE InText(x), Split() NEXT END SUB
Comment