Renumber window

BASin

Renumber window

The Renumber window is available from the Tools menu.

The Renumber window.

This tool is very handy for any BASIC, such as Sinclair BASIC, which uses line numbers. Whilst writing a program, you may find that you need to insert lines between existing lines, and that after a while the numbering is so tight that there is no more room.

This tool alleviates this problem. It will take each line number, and replace it with the numbers you choose, which can (assuming that you set a sane Step value) increase the number of available new lines.

You can, using the first option, elect to either renumber the whole program, or just a portion. If you decide to renumber just a portion (the "Whole Program" checkbox is un-checked) then the following options must be set:

  • From Start

    The line number that begins the block of code you wish to renumber.

  • To End

    The line number that lies at the end of the block of code you wish to renumber.

Note: Both options must be in numerical order - the end value cannot be smaller than the start value.

From hereon, you can set the parameters for the renumbering itself. You can use the options:

  • Starting At…

    This option specifies what line number the renumber should use as the first line.

  • Increment in steps of…

    Each new line that is renumbered will be the previous line's number, plus this amount. Setting to 10 is probably best, as it gives a nice amount of space between the lines. Setting this to 1 will renumber sequentially as 1, 2, 3, … 10, 11, 12 etc, but will prevent you from inserting any new lines into the program.

Note: A note of warning - if a block renumber operation needs to overwrite any existing lines then they will be overwritten regardless of the settings in the Options Window. A log entry will be made to inform you of the fact.

Only lines that contain an absolute reference to another line number will be renumbered. Any statements, such as GO TO, GO SUB, RESTORE etc that reference a line by a calculation, i.e.

GO TO A*10

Will not be renumbered, and again a log entry warning you of the fact will be made. If any log entries are made, then the log window will be shown after the renumber is complete.