Thanks Stirling - I was away yesterday, running the railway, and also thinking about it, and realised that I had not written the code correctly with while and wend, and if and end if and I wondered if that was where the fault lay. I telephoned my daughter who was also working on the same prog, and she sorted it - it works OK now.
Yes - Vis Basic is completely new - my last major brush with code was Pascal (some years ago) and recently some Microchip PIC chip programming for a signalling system.
The trouble is you are always playing catch-up. Still - Mach3 is first class, and has - and will - make a big difference to my engineering.
Jim