What is the upper bound for arrays in PB/Win 8.04, when dimensioned simply as follows:
DIM a(20) AS LONG
DIM s(20) AS STRING
I thought that the indexes for these arrays would range from 0 to 19. However, I'm finding a range of 0 to 20 in the following example:
Sincerely,
John Harvill
DIM a(20) AS LONG
DIM s(20) AS STRING
I thought that the indexes for these arrays would range from 0 to 19. However, I'm finding a range of 0 to 20 in the following example:
Code:
#COMPILE EXE #DIM ALL FUNCTION PBMAIN () AS LONG DIM a(20) AS LONG DIM s(20) AS STRING OPEN "output_TestArray.txt" FOR OUTPUT AS #17 PRINT #17, "ubound_a = "; UBOUND( a(1) ) PRINT #17, "lbound_a = "; LBOUND( a(1) ) PRINT #17, "ubound_s = "; UBOUND( s(1) ) PRINT #17, "lbound_s = "; LBOUND( s(1) ) CLOSE #17 END FUNCTION
John Harvill
Comment