If your channel is kicking back to the main screen, that means that some value is not what is expected in your code. You can check if the value is the correct type or is invalid before doing a comparison or using a variable, for example if you are expecting an roXMLElement you can check first:
if myvar <> invalid and lcase(type(myvar))="roxmlelement" then
doSomeProcess(myvar)
else
handleTheError(myvar)
end if
otherwise, your channel will probably crash when the value is not what is expected, and in a published channel, a crash takes you back to the main screen.
- Joel