Sharp PC-1262
|
02-17-2022, 07:42 PM
(This post was last modified: 03-03-2022 03:44 PM by robve.)
Post: #23
|
|||
|
|||
RE: Sharp PC-1262
(02-17-2022 07:04 PM)Dan C Wrote:(02-16-2022 08:08 PM)robve Wrote: It really helps to read the 300 page manual... The English PC-1260/PC-1261 PDF scan is almost done. I've created a jig to speed this up a bit, but it is still time consuming (and to make time for this.) The PC-1262 has no filesystem or filesystem commands. Some PC have "hidden" (undocumented) filesystem commands (PC-1403/EL-5500III for example) that work with the external disk drive CE-140F. Some unsolicited advice when coming from Casio BASIC. It might be easy to overlook the Sharp BASIC features that are particularly handy, such as: - commands and functions may be abbreviated, e.g. P. is PRINT, I. is INPUT, A. is AREAD etc. - the AREAD command is useful to read the "argument" to a DEF key: 10 "A" AREAD X: PRINT X^2: END Type e.g. 2/3 DEF-A will show the result of (2/3)^2, then press any operator key or DEF key to continue calculations with the value displayed. - GOTO, GOSUB, RUN, RESTORE all take expressions aka GOTOs are "computed gotos" and also take strings to refer to labelled lines. (That is why IF...THEN must use IF...THEN LET to assign a variable, because the interpreter sees IF THEN A=1 as a jump, like IF...GOTO A=1. Use the shorter IF...LET A=1 instead to conditionally assign variables.) - DATA statements are expressions, not just literals. A toy example: 10 "C" AREAD C$:INPUT X:RESTORE C$:READ Y:PRINT Y:END 20 "F" DATA X^2 30 "G" DATA SQR X - INPUT does not change the variable queried when pressing ENTER. But note that this continues execution at the next line, not the statements after INPUT. This can be handy in certain cases to accept default values and jump immediately to a program part. - When INPUT is executed, a DEF key can be pressed to jump to another part in the program. For example, when entering a list of data, DEF-C can be programmed to go back and correct values. - Use WAIT to pause each PRINT, until ENTER is pressed to continue execution. Or you can press a DEF key to jump to another part in the program. WAIT n waits n/59 seconds then continues execution. WAIT without n is the default. The PAUSE command is similar to PRINT with WAIT 50. - The A() array is sort of an "automatic" array that can be dynamically extended, unless arrays are DIMed. This A() array also maps to variables A-Z, similar to Casio BASIC. A(27) is the first variable after Z. - A form of meta-programming is possible with computed gotos/gosubs. Figure out what this program does: 10 RESTORE:A=26:WAIT 0 20 READ C$:GOSUB C$:GOTO 20 30 "FORTH" DATA "#",9,"DUP","*",".","GOTO","FORTH" 40 "#" A=A+1:READ A(A):RETURN 50 "DUP" A=A+1:A(A)=A(A-1):RETURN 60 "*" A=A-1:A(A)=A(A)*A(A+1):RETURN 70 "." PRINT A(A):A=A-1:RETURN 80 "GOTO" READ C$:RESTORE C$:RETURN The above example is not published anywhere as far as I know. It's just something you can do with the flexibility of Sharp's S-BASIC. - Rob PS. (edit) to make the last example a bit more interesting, let's extend the syntax to store "STO","X" and recall "RCL","X" variables A to Z, where A() serves two purposes to function as a stack and to map to variables A~Z: 90 "STO" READ C$:A(ASC C$-64)=A(A):A=A-1:RETURN 95 "RCL" READ C$:A=A+1:A(A)=A(ASC C$-64):RETURN Just a bit of fun with programming basics (pun intended). "I count on old friends" -- HP 71B,Prime|Ti VOY200,Nspire CXII CAS|Casio fx-CG50...|Sharp PC-G850,E500,2500,1500,14xx,13xx,12xx... |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Sharp PC-1262 - Dan C - 02-09-2022, 06:30 PM
RE: Sharp PC-1262 - Dave Britten - 02-09-2022, 06:47 PM
RE: Sharp PC-1262 - robve - 02-09-2022, 08:48 PM
RE: Sharp PC-1262 - Maximilian Hohmann - 02-09-2022, 07:10 PM
RE: Sharp PC-1262 - Dave Britten - 02-09-2022, 07:41 PM
RE: Sharp PC-1262 - Dan C - 02-13-2022, 10:11 AM
RE: Sharp PC-1262 - toml_12953 - 02-13-2022, 10:46 AM
RE: Sharp PC-1262 - robve - 02-13-2022, 04:31 PM
RE: Sharp PC-1262 - Dave Britten - 02-13-2022, 08:56 PM
RE: Sharp PC-1262 - Dan C - 02-14-2022, 06:20 PM
RE: Sharp PC-1262 - robve - 02-14-2022, 08:36 PM
RE: Sharp PC-1262 - Dave Britten - 02-15-2022, 01:27 PM
RE: Sharp PC-1262 - Dan C - 02-15-2022, 05:36 PM
RE: Sharp PC-1262 - Dan C - 02-16-2022, 07:22 PM
RE: Sharp PC-1262 - Dave Britten - 02-16-2022, 07:51 PM
RE: Sharp PC-1262 - Maximilian Hohmann - 02-16-2022, 08:11 PM
RE: Sharp PC-1262 - Dan C - 02-17-2022, 07:00 PM
RE: Sharp PC-1262 - Dave Britten - 02-17-2022, 07:24 PM
RE: Sharp PC-1262 - robve - 02-19-2022, 09:20 PM
RE: Sharp PC-1262 - rprosperi - 02-19-2022, 11:27 PM
RE: Sharp PC-1262 - Valentin Albillo - 02-20-2022, 04:48 AM
RE: Sharp PC-1262 - robve - 02-20-2022, 10:19 PM
RE: Sharp PC-1262 - robve - 02-16-2022, 08:08 PM
RE: Sharp PC-1262 - Dave Britten - 02-16-2022, 08:35 PM
RE: Sharp PC-1262 - robve - 02-16-2022, 09:13 PM
RE: Sharp PC-1262 - Dan C - 02-17-2022, 07:04 PM
RE: Sharp PC-1262 - robve - 02-17-2022 07:42 PM
RE: Sharp PC-1262 - Dave Britten - 02-19-2022, 09:53 PM
RE: Sharp PC-1262 - Dave Britten - 02-20-2022, 01:18 PM
RE: Sharp PC-1262 - robve - 02-20-2022, 02:22 PM
RE: Sharp PC-1262 - Dan C - 03-10-2022, 07:30 PM
|
User(s) browsing this thread: 1 Guest(s)