Sharp PC-1211/TRS-80 PC-1 program tapes from Radio Shack
|
08-09-2021, 04:51 AM
(This post was last modified: 08-09-2021 03:53 PM by Valentin Albillo.)
Post: #19
|
|||
|
|||
RE: Sharp PC-1211/TRS-80 PC-1 program tapes from Radio Shack
(08-08-2021 09:43 PM)Bill (Smithville NJ) Wrote: I wonder what I’ll run into next in trying to create a universal Basic listing that will run on several pocket computers. This document might be useful. A major problem is that the BASIC version of the SHARP PC-1211 only admits one array variable, single-dimension A(), which doesn't require dimensioning, and further its first 26 elements are overlapped with scalar variables A to Z, so that A(1) is the same as A and A(26) is the same as Z, and the same goes for the string versions, A$(), A$, Z$, which also overlap the numeric variables. This often requires applying some sort of offset to array elements so that they don't collide with scalar variables. For instance, A(I+26) would ensure non-collision with A-Z for I=1,2,3,... Also, dealing with 2-dimensional arrays requires yet another offset to access rows and columns as elements of the 1-dimensional array A(). On the other hand, the PC-1350 BASIC version does allow 1- or 2-dimensional numeric arrays, with indexes from 0 to 255, and there's no overlap with scalar variables due to the fact that you can have more than one array, say A(10,10), H(30), etc. and can have many more distinct names because names aren't limited to a single character. You can also have 1-dimensional string arrays and even specify the maximum number of characters for their elements, say DIM S$(30)*50 would allocate 31 string elements of up to 50 characters each, unlike the fixed 7-chars elements of the PC-1211's A$() array. Finally, you must explicitly dimension arrays using the DIM statement. As you can see, this is vastly different from what the PC-1211 allows, so converting a PC-1211 program to run on a PC-1350, say, can be cumbersome and error prone if dealing with arrays, but likely possible. The reverse conversion from PC-1350 to PC-1211 might be extremely difficult, if not outright impossible. Regards. V. All My Articles & other Materials here: Valentin Albillo's HP Collection |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)