Cannot return value from function

Thanks for your reply. I updated the code as indicated above, but still get an error.