Tips: Convert a Module to Class and Notations for class

I have a module that contains methods, constants and properties. (Everything is Global)
One of the Members of the Module’s properties includes a class of a type array.
I wanted to convert the Module to Class and have ran into all sorts of problems.
Everything from Dim’ing the class instance to the referring to it’s methods.
I went looking for anything that might help in the forum and the DevCenter, but the information isn’t concentrated in any one page.
I have several basic questions:

How do I instantiate a class like this?
How do I refer to a class method with the various levels of scope?
Do I have to instantiate a property of type array of the class?
Is there a book or something that discusses this?

I would start here:

http://developer.xojo.com/userguide/classes

You always instantiate a class using New:

Dim c As New MyClass

Scope values (Global, Protected, Private) are a bit different with classes as compared to modules. See here:

http://developer.xojo.com/userguide/properties-methods-and-events$scope-of-items

A property of array works like any other array. You can give it a defined size and set its elements or do not specify a size and use append to add elements.

Lastly, Shared Methods on a class can be called without having a class instance. These would be most equivalent to a protected module method.

http://developer.xojo.com/userguide/properties-methods-and-events$shared-methods

Thanks Paul.
I think this is where my confusion lies. Another way of stating the problem of notation is I still have to refer to
App.(property or method). Another instance of Notation is if I refer to window’s property’s method outside the window, I have to use Window.method.

I had a Module named YPrf and copied to everything to a Class called YPrefClass. I also leave All of the dot notations for everything
I put at the first line of the App.Open event

Dim YPrf As New YPrfClass

I now get errors all over the place without changing any notations. For these 2 errors I knew I could change the analyzer’s response by removing “YPrf.” but I don’t understand why because that is the instance Name of the class. Another way of putting it is I want to prevent overloading. Before I could be certain I was calling the method I wanted.

[quote]App.Close, line 11
This item does not exist
YPrf.SavPractWrdFiles(False)[/quote] A Method that is global.

[quote]App.Close, line 7
This item does not exist
If YPrf.PFSUbnd > -1 Then [/quote] This is a computed global property that is actually a shorthand for Ubound.PractFSets which is an array of a type class.

Sorry, to not have more questions, but I now have to get rid of YPrf. stuff.

[quote=373874:@Arthur Gabhart]I had a Module named YPrf and copied to everything to a Class called YPrefClass. I also leave All of the dot notations for everything
I put at the first line of the App.Open event

Dim YPrf As New YPrfClass
I now get errors all over the place without changing any notations. For these 2 errors I knew I could change the analyzer’s response by removing “YPrf.” but I don’t understand why because that is the instance Name of the class.[/quote]
Since you only did a Dim of YPrf in the Open event then that instance variable can only be used in the Open event. You could instead make it a property of App and refer to it like this in Open:

YPrf = New YPfrClass

Then elsewhere in your project you’d refer to it like this:

App.YPrf.PFSUbnd

Aah. I hadn’t thought about it that way. I’ll let you know If I have other problems.

Okay. The App.YPrf works.

How else could I structure this?