

Note the ending addresses in the two cases. If you want to see how much space you have saved, you can use the show tokenized program command on the transformed and untransformed code. This has to be done separately using the renumber lines command. Make sure you review and repair all variable name collisions before applying this transformation.Īs of this writing, minify does not include renumbering lines. This produces a new document, leaving the existing one unchanged. Strips unnecessary separators and unquotes.reduction can be less if hidden tokens would be introduced.Reduces variable and function names to the first two characters.This performs the following transformations on your code: The extension provides a minify command to reduce the memory used by your Applesoft program. As a result, errors such as NEXT WITHOUT FOR, REDIM'D ARRAY, etc., are not detected. Also as of this writing, the extension does not try to follow the program's flow. This is why, e.g., undimensioned array references trigger a warning rather than an error (the array might be dimensioned in another file). Multi-File Programs and Program FlowĪs of this writing, the extension analyzes each file in isolation. Using goto definition on a line number reference will find the line. Using goto definition on a function will find the function definition. Using goto definition on a non-array variable will find all the places in the file where it is assigned or read from an input source. Using goto declaration on an array reference will find all the places in the file where it is dimensioned. The DIM statement is the only item we recognize as a declaration. Variables and functions only appear in the symbol outline where they are assigned, defined, or dimensioned.
#BASIC IN APPLEWIN CODE#
You must include any desired suffix ( $ or %) in the replacement text, even though VS Code may offer a default without this. You can use rename symbol to quickly change the names of variables or functions. The assumption here is that colliding variable names are bugs or potential bugs. In every other respect, the extension will treat colliding variable names as distinct, e.g., using goto references on CUTE will not find references to CUBE. By default, the extension will underline colliding variable names with a warning squiggle. Managing VariablesĪpplesoft variables and function names have the property that only the first two characters are significant, e.g., CUTE and CUBE are the same variable. Instead, use the renumber lines command if you want to renumber. On the other hand, rename symbol cannot be used with line numbers. The text of any comment on or before the line will be used in the document outline and in line reference hovers. For example, if GOSUB 100 is found in the document, right-clicking on any reference to line 100 allows you to apply symbol manipulations such as goto references and goto definition.

You can treat these line numbers just as if they were, say, function names in a modern language. The extension will treat line numbers as document symbols if they are branch destinations.

Latest update: smarter completions, better ampersand handling Language support for Applesoft BASIC in Visual Studio Code.
