You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
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:
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
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Leave a comment: