I have been fighting with this and can\'t seem to get this to work. It doesn\'t pass the new cursor value back to the main function.
I cobbled this together off a co