Public Not Being Recognized.

I’m beginning to think there is something wrong with my copy of XOJO (or more likely my copy of me). I define a method or property as Public and I still get compile errors telling me the method or property is not recognized. I have the following program structure
App
Window1 (main form)
Mz_vb6 (the only module)
+4 forms
I’m porting my vb6 chess program into xojo (yes, I know even the compiled xojo app won’t be anywhere near as fast as a c, c++ program - I just want to play around with neural nets on a program I know). The original VB6 program was not Object oriented at all plus I’m not very familiar with objects so that’s probably what is wrong, I just can’t understand why a public object is not recognized. I’m writing the xojo version as if I can pretend methods work the same as functions and subs (I’m VERY new to XOJO). Can anyone steer me in the right direction? There is nothing confidential in it so I can zip up the entire code if that will help.

Not recognized where? What is the code that is giving your trouble?

I’m assuming you have a method in your module that you’re trying to call. Something like

  • Mz_vb6
    |------ TakeTheRook()

and you want to call it like TakeTheRook().

In a module, Global means you can just use the method name: TakeTheRook(). Public means you can call the method, but you must prefix it with the module name: Mz_vb6.TakeTheRook(). Private means you cannot call the method at all from outside the module.

Thanks for the quick replies! I’ve been trying to cut the code down to something I can post as text and your answer solves that problem.

Another issue: Possible bug?
While doing the cut-down I made a global replace to add “app.” to the front of some constants. I did not notice that I’d already changed a few of them. This left me with some constants named App.app.(something). The problem was that the program won’t let me change them back using global find and replace - I had to use ctrl-z. Perhaps that is a bug, it’s more likely that I still don’t have a good handle on how xojo works and that that behavior has a reason.

You use “app.” in your code, not in the constant’s name. App acts in a manner similar to a module, except you cannot make anything Global, just Public.

Thanks ALL! I just finished getting my chess app ported from VB6 to XOJO last night. It doesn’t do any thing yet but at least XOJO runs without hitting any obvious errors. Now comes the fun part, tracking down all the not so obvious errors.