(08-08-2021 09:43 PM)Bill (Smithville NJ) Wrote: [ -> ]I’ve been looking at what it would take to modify the programs so that they would run on more Pocket Computers. At present, the programs will run without modifications on the Sharp PC-1211 (Trs-80 PC-1) and the Sharp PC-125x (TRS-80 PC-3) I think it would be nice if they could also be run on the Sharp PC-126x and PC-1350/1360 series.

It's not too difficult to generalize PC-1211 and PC-125x BASIC to run on 12xx, PC-13xx and PC-14xx series of pocket computers with some guidance (see below). Not so to the PC-1500/1600 and the E and G series that offer different BASIC interpreters, see the diagram at

https://sharppocketcomputers.com/#basic
For help and a more in-depth comparison of BASIC across brands and types of pocket computers, see

http://basic.hopto.org/basic/manual/basic-compare.pdf (the site appears down today, attached is the PDF for your convenience).

These series of earlier PC support the special A() array that grows dynamically in size (and can hold 7-char strings), and support the ? and √ symbols, etc. By contrast, it is nearly impossible to port later series PC with new commands to the earlier series PC that lack these commands and functions such as SQU, CUB, CUR, REC, POL, HSN, HCS, HTN, TEN. Though these can be replaced with expressions.

Very good point in your post about implicit multiplication, which is something to watch out for (and not elaborated in the PDF), to replace with * or / as needed and by using parenthesis, e.g. X^2Y becomes X^(2*Y) and 1/XY becomes 1/(X*Y) or 1/X/Y and functions w/o parenthesis such as SQR XY becomes SQR(X*Y).

Even SHARP's Application books made mistakes when translating older Application books to the newer non-implicit-multiplication BASIC versions. For example, in "Computing the Sciences - Applications for the PC-14xx" (and EL-55xx) the T-test program has an implicit multiplication bug, here copied verbatim from the Computing the Sciences for EL-5520 (PC-1450) and EL-5500III (PC-1403) books I own:

\[ t = \frac{\bar x-\mu_0}{s/\sqrt n} = \frac{\frac{\sum x}{n}-\mu_0}{\sqrt{\frac{\sum x^2-n(\sum x/n)^2}{n(n-1)}}} = \frac{Y/Z-A}{(X-Z(Y/Z)^2)/Z(Z-1)} \]

Program:
10 PAUSE "T-TEST"

20 INPUT "POP.MEAN=";A

30 T=(Y/Z-A)/√((X-Z*SQU(Y/Z))/Z*(Z-1))

40 USING "##.###^"

50 PRINT "T=";T
The writers made a mistake to replace implicit multiplication with a * instead of a /. It is rare that SHARP made this error. I have not seen any other obvious math issues in their books and materials.

- Rob