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.
It's just traditional. Many things in the Basic language set originate with the base of 1 rather than zero.
For example, reading the first character from a string would be done with the reference of 1 (ie, MID$(A$,1,n)); Binary files (by default) have a base equal to 1; etc...
It's just traditional. Many things in the Basic language set originate with the base of 1 rather than zero.
For example, reading the first character from a string would be done with the reference of 1 (ie, MID$(A$,1,n)); Binary files (by default) have a base equal to 1; etc...
Binary files in PB *for WINDOWS* originate at one; binary files in PB/DOS used zero as the default. Microsoft BASICs use zero by default.
PB's main "indexed" tool, the array, uses zero; of course, I don't think I've ever seen a BASIC with 1-based default arrays.
I don't think it's traditional: it's more or less that both PB and Microsoft had to pick "something" for listbox indexes, and just happened to choose differently.
Michael, you are correct in that the default base for binary files is zero in PB/DOS, but this is not really pertinent given that the question centers around the DDT LISTBOX control in the PowerBASIC for Windows forum...
Besides, there are still other items use a "base" of 1, such as DATACOUNT, READ$(), PARSECOUNT, PARSE$(), LEN(), SIZEOF(), etc.
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.
Comment