Personal Computer News


RENUMbering Your Camputers Lynx Programs

Categories: Letter

 
Author: M. S. Fowkes
Published in Personal Computer News #046

Renumbering Your Camputers Lynx Programs

The Lynx's RENUM command can be useful but its use is sometimes restrictive if only certain parts of the program need RENUMbering.

By altering the contents of &61FA, which points to the start of the Basic program (usually &694D), it is possible to use RENUM on only part of the program.

To RENUMber from any line in the program to the end simply:

DPOKE &61FA,LCTN(X)-7

where 'X' is the line number you wish to begin from. Now simply RENUMber as required and then return the pointer to its original position using:

DPOKE &61FA,&694D

If only a section of the program needs RENUMbering, i.e. lines A to B inclusive, change the starting pointer as before:

DPOKE &61FA,LCTN(A)-7

Make note of the original value of your 'B' end value:

PEEK (LCTN(B)-7+PEEK(LCTN(B)-2))

Poke into this position &80 (standard end delimiter) as follows:

POKE LCTN(B)-7+PEEK(LCTN(B)-2),&80

RENUMber the program as appropriate.

Before listing the whole program you must return original pointers. The starting pointer is:

DPOKE &61FA,&6941

The end pointer must be reset to the new line number of 'B':

POKE LCTN(B)-7+PEEK(LCTN(B)-2),X

where 'X' is the value originally at 'B'.

M. S. Fowkes
Bearpark, Durham

M. S. Fowkes