+hloberg Posted August 17, 2019 Share Posted August 17, 2019 I have this Atari BASIC program written by someone else I converting to TI-BASIC (MS BASIC derivative). In the program we have DIM PILE(1,1) the programmer refers to the array as PILE(PLAYER,0) & PILE(PLAYER) omitting the 2nd array element. the program works so I'm assuming if the 2nd element is omitted it it defaults to 0? so PILE(PLAYER,0) is the same as PILE(PLAYER) ? Am I right? Quote Link to comment Share on other sites More sharing options...
+hloberg Posted August 17, 2019 Author Share Posted August 17, 2019 ran some test, that seems to be the way it works. I haven't found any conformation in documentation yet. Quote Link to comment Share on other sites More sharing options...
thorfdbg Posted August 18, 2019 Share Posted August 18, 2019 2 hours ago, hloberg said: I have this Atari BASIC program written by someone else I converting to TI-BASIC (MS BASIC derivative). In the program we have DIM PILE(1,1) the programmer refers to the array as PILE(PLAYER,0) & PILE(PLAYER) omitting the 2nd array element. the program works so I'm assuming if the 2nd element is omitted it it defaults to 0? so PILE(PLAYER,0) is the same as PILE(PLAYER) ? Am I right? You are right, though this is just (another) defect of Atari Basic where a check for the dimensionality of the original array is missing on its use. Similarly, one can also access 1-dimensional arrays with two indices giventhat the second index is zero. 1 Quote Link to comment Share on other sites More sharing options...
+hloberg Posted August 18, 2019 Author Share Posted August 18, 2019 thank you, that makes sense now. the guy who wrote this little game in Atari BASIC (millebournes) I'm translating to TI XBASIC seemed to relish in the little idiosyncrasies of Atari BASIC. I was talking on the ti99 forum how he used NOT PLAYER throughout the program. NOT in Atari BASIC gives a logical NOT ie : NOT 0=1 and NOT 1 (or anything else)=0. In MSBASIC derivatives like TI BASIC NOT is binary; so NOT 0=-1 & NOT 1=-2 etc... Quote Link to comment Share on other sites More sharing options...
Rybags Posted August 18, 2019 Share Posted August 18, 2019 This came up recently elsewhere I believe. In practice you'd probably get a little speed and size advantage by omitting the 2nd dimension when referencing. But it can have compatibility problems with other variants of Basic on the Atari which need both dimensions always. Yes - the boolean functions in most old Basics used -1 as true, Atari uses 1. And when testing any nonzero result should also give "true". e.g. IF A THEN B=100 Should execute on any nonzero value of A. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.