I think that the problem is that this code was adapted to v6.90 with the variables typing.
You can find the same code that will work with your version under the samples folder.
It is located under c:\program files\anywhere software\basic4ppc desktop\samples