The goto command is a throwback command from earlier basic languages.
It can cause problems with making your code harder to trace as your project grows unless you are taking extra special care with the problems layout by tracking it via a note pad or something.
The command
object exist() is listed in the command index, it basically allows you to detect if an object has already been loaded or is currently active.
the if statement followed by the endif statement can be applied to this command with the delete object command
the foo variable represents your objects number
foo = 5
if object exist(foo) = 1
delete object foo
endif
REM IF THE OBJECT 5 (foo) IS LOADED THEN DELETE IT
you can also apply another command to step through many models using a
for/next statement
for foo = 1 to 10
if object exist(foo) = 1
delete object foo
endif
next foo
REM IF OBJECTS 1 to 10 IS LOADED THEN DELETE THEM