Automating Variable Naming in C64 BASIC

BASIC Variables Made Easier 📔 I use the VS64 extension in VSCODE for my C64 BASIC development, and I really like the auto numbering and labeling, but variables are still no fun to keep track of. Each time I come up with a new system, I forget what they mean and still end up switching files to figure out what them out. So I decided to create a step in the build process for auto assigning variable names. Similar to labels, I define a name on the first definition using an alias, and then that along with all the other references get updated in the build. I haven't fully settled on the exact implementation yet, but so far it works great. So it works like this: First the variable is assigned using an alias like this:  @screenRegister=1024 Then it's used as normal, without the @, anywhere in the code like this:  POKE screenRegister, 81 When the code is built it gets converted to this:  A1=1023  POKE A1, 81 It uses names from A1 to ZZ, so single character ones that I commonly use are not affected, such as i, x, and y. It will also make sure the name doesn't exist first and will just go to the next name if it does. #commodore46 #basicprogramming

  • graphical user interface

To view or add a comment, sign in

Explore content categories