slviajero / tinybasic

A BASIC interpreter for Arduino, ESP, RP2040, STM32, Infineon XMC and POSIX with IoT and microcontroller features.
GNU General Public License v3.0
203 stars 31 forks source link

TAB reversal - documentation note #18

Closed EncomLab closed 2 years ago

EncomLab commented 2 years ago

This is a long standing issue with BASIC syntax. The Apple and "Standard BASIC" TAB use PRINT in opposite relationship: The Apple TAB = TAB 20 : PRINT "Hello World!" The ECMA and ANSI TAB = PRINT TAB(10); "Hello World!"

I would not change the implementation as you have it as it is correct for the Apple 1 version of BASIC, but it may be worth documenting.

slviajero commented 2 years ago

Thank you! TAB is a strange animal. In Apple Integer BASIC it simply ejects n spaces and is a statement. In MS BASIC it is a function in PRINT which is really weird from the point of view of grammar. Also, it seems to be a tabulator function, so PRINT „Hello“; TAB(20); „World“ prints World at position 20. I will write a note in the documentation.

Am 20.06.2022 um 16:03 schrieb Encom Lab @.***>:

This is a long standing issue with BASIC syntax. The Apple and "Standard BASIC" TAB use PRINT in opposite relationship: The Apple TAB = TAB 20 : PRINT "Hello World!" The ECMA and ANSI TAB = PRINT TAB(10); "Hello World!"

I would not change the implementation as you have it as it is correct for the Apple 1 version of BASIC, but it may be worth documenting.

— Reply to this email directly, view it on GitHub https://github.com/slviajero/tinybasic/issues/18, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACSY56CU4WCC24U3NT2H7YLVQB23PANCNFSM5ZJBM7DQ. You are receiving this because you are subscribed to this thread.

slviajero commented 2 years ago

Corrected in the two documentation pages.