how ro use return from a child script

I use return <value> to return a value from inside an else condition in child script to parent script and i am getting the following error.What is this sourced script? Can I return value to a different script using return statement.

return: can only `return' from a function or sourced script

You can if you 'source' the script instead of executing it.

source a script:
. /path/to/script.sh

execute the same script:
/path/to/script.sh

Check the man page for return