Please post scripts in between [CODE] tags and use the .KIX extension for scripts instead of the .TXT extension. This is explained in the FAQ Forum and the KiXtart Manual.

The '$' signs need to be doubled up unless you are using SETOPTION('NoVarsInStrings','on') at the beginning of your code.

You should ratehr put the Addresswarning into it's own function and include the fnction at the end of your script. This is explained in the FAQ forum under How to use UDFs and How to write a UDF

Use DEBUG ON in the first line of your code to step through the code for debugging purposes. Alos, please be aware that in a SELECT-CASE-ENDSELECT statement only the first true statement will be triggered.

Otherwise, the code fragmentlooks okay but you might beomitting other important parts of your code. Please use DEBUG ON before reporting back.
_________________________
There are two types of vessels, submarines and targets.