4 ms·
Technically it does support functions. They are just extremely limited.
by tssva 6y ago
Technically it does support functions. They are just extremely limited.
- hnlmorg 6y ago"Extremely limited" is fair. They were just one line formulas so pretty useless most of the time. Of course you also had sub-routines via GOSUB (which was defined in the very first BASIC specification in the 60s) but those didn't support parameters passing and GOSUB is only slightly less ugly than GOTO. Sadly "Commodore BASIC" didn't support multi-line user defined functions like BBC BASIC: REM Squaring a number using FN A=4 B=FN_Square(A) PRINT A;" squared is ";B END DEF FN_Square(Num) =Num^2 (Source: http://www.bbcbasic.co.uk/bbcwin/tutorial/chapter17.html http://www.bbcbasic.co.uk/bbcwin/tutorial/chapter17.html) I'll grant you that even with BBC BASIC the syntax isn't pretty with the = token taking the place of a RETURN statement. BASIC definitely had its quirks. I think Applesoft BASIC (also a Microsoft BASIC) supported multi-line FN blocks. Can't find anything conclusive online to confirm this though - perhaps someone on here remembers?
- tssva 6y agoApplesoft BASIC also only supported numeric single line functions. The first BASIC I used was Tandy TRS-80 Level II BASIC which shipped on all but the earliest of the TRS-80 Model I's. Microsoft wrote this BASIC also and it didn't support any type of user defined functions. Microsoft created a Level III BASIC for the TRS-80 which was their first consumer product. This did support single line functions and I think but am not absolutely sure that it supported string as well as numeric functions.