Talk:Sinclair BASIC

message: I'm not 110% sure, so I'll just go ahead and ask: are Sinclair BASIC's GO TO and GO SUB totally exhangeable with the more common (in other BASIC dialects) GOTO and GOSUB? --Wernher 06:54, 17 Feb 2005 (UTC)
replies: text: I'm not entirely sure what you mean by "exchangable".  They work the same way if that's what you mean.  Note that on the ZX81, it was GOTO and GOSUB.  On the ZX Spectrum it was GO TO and GO SUB. On neither computer did you actually have to type the letters G, O, ..., because all commands were bound to single keypresses ('G' and 'H' in this instance). Richard W.M. Jones 10:10, 17 Feb 2005 (UTC)
replies: text: I just meant that, say, on the Spectrum, will both GO TO and GOTO work as expected? Another detail: will entering GO TO (GOTO) at edit time lead to GOTO (GO TO) being displayed when listing the program? --Wernher 11:21, 17 Feb 2005 (UTC)
replies: text: No.  Both machines had a strange modal entry system.  When the cursor indicated "command mode" (cursor was a flashing K), pressing G or H on the keyboard would enter the keyword "GO TO" or "GO SUB" respectively.  (On the ZX81 you'd see "GOTO" and "GOSUB" respectively).  Unlike other BASIC interpreters, even of the time, the Sinclair machines had no lexing stage, so there was never an instance where the individual letters G, O, ..., could be entered and understood as one of the commands.  Richard W.M. Jones 20:39, 17 Feb 2005 (UTC)
replies: text:  These machines must have a lexing stage, otherwise they wouldn't be able to accept string literals, numeric literals of more than one digit or variable names with more than one character.  They just don't tokenise keywords the way most BASICs do.  A keyword is just a single-character token, just like most symbols that have meaning in Sinclair BASIC. — Smjg (talk) 20:41, 18 May 2020 (UTC)
thread_title: GO TO vs GOTO

message: How about the BASIC +2 and BASIC +3 versions of Sinclair BASIC? IIRC these were written/extended by Locomotive Software (who previously wrote Locomotive BASIC for the Amstrad CPC series). We should have some info (separate sections) on those versions. --Wernher 03:30, 10 Apr 2005 (UTC)
thread_title: Different versions (+2, +3)

message: Could somebody please cite a source showing that the TS2048 either does or does not have the DELETE command? The TC2048 ROM (note the difference there) definitely does not include the DELETE command. AIUI, the TS2048 was never commercially released. --Pak21 13:43, 14 November 2005 (UTC)
thread_title:  Timex extensions 

message: Please see the  to help determine how to tag this image correctly and whether its usage over here is fair use. --BACbKA 12:34, 20 January 2006 (UTC)
thread_title:  The editor screenshot with the 3DMAZE program 

message: "Returns the value of pi to seven decimal places (3.1415927)"
I've just checked, and it doesn't return it to seven decimal places at all.  It appears that whoever wrote this is/was unaware of the way computers work in binary, saw that if you execute PRINT PI then it outputs it to seven decimal places, and assumed this is the precision to which PI returns it.  If the claim is taken from the cited source, then one is made to doubt the credibility of the source.
By my experiments, it seems PI returns the value of π at full machine precision.  When Sinclair BASIC formats a floating-point number for output, it formats it to eight significant figures (minus any trailing zeros right of the decimal point), giving the mentioned 3.1415927.
Code              	Output
PRINT PI-3.1415927	-4.6566129E-8
PRINT (ACS 0)*2-PI	0
Further tests show that machine epsilon (by definition [b] there) is 2^{-31} \approx 4.6566 \times 10^{-10}.  The impact of this is that the value is correct to nine decimal places. — Smjg (talk) 22:46, 18 May 2020 (UTC)
thread_title:  Precision of PI