NextThingInView


Returns the thing in view that has the next lowest thing number. FirstThingInView() must run before NTIV() to set the FOV and mask settings. If FTIV() was not run first, NTIV() will return -1. NTIV() will also return -1 when the last thing returned was the thing with the lowest thing number that was visible - at that point, there are no more valid things to return. Syntax:

thing=NextThingInView();

Cog stores the number of the last thing that FTIV() or NTIV() returned. So that the next time NTIV() runs, it knows to find the thing with a thing number lower than the last thing returned. When the cog runs an FTIV() command, the thing number is set back to the highest-numbered thing visible.