10

I’ve encountered a bug on the Commodore 64. When I write out the full TAB command, i.e., TAB(…), everything works as expected. However, when I use the abbreviated form, tA, an extra parenthesis is added when I list the program. I’m wondering if anyone can suggest a workaround for this issue.

example :

10 print tA(10)"x"

list :

10 print tab((10)"x"

run

syntax error in 10

1 Answer 1

10

I wouldn't call it a bug and the solution is kind of obvious: Don't type in the opening parenthesis for tokens that include that already (tab( and spc(), if you abbreviate the function. I.e.:

10 print tA10)"x"
4
  • He misled me tA, thank you . Commented Nov 9, 2023 at 19:51
  • 2
    Yeah, that old issue of (MS-)BASIC functions where the opening parenthesis is part of the token:))
    – Raffzahn
    Commented Nov 9, 2023 at 21:28
  • 4
    @Raffzahn: I don't think actual functions work that way, but spc() and tab() aren't really functions. Functions in BASIC are dispatched via common mechanism, and including code in the dispatcher to gobble the open paren takes less ROM space than including a "(" within the name of every function in the token table. The "SPC(" and "TAB(" pseudo-functions, however, are dispatched separately, and code to gobble the parens would be bigger than the two bytes needed to add "(" characters to their names.
    – supercat
    Commented Nov 9, 2023 at 21:56
  • 5
    This is by design: Appending D of the manual explicitly mentions that T-shift-A is a shortcut for TAB(, not for TAB.
    – Heinzi
    Commented Nov 10, 2023 at 13:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .