[quote=492344:@Greg O’Lone]Jim, what the others are saying is true. You cannot create a class in Xojo code. The only place that the Class…End Class pattern works is inside the XojoScript plugin.
Also, If you could point out on that page where you found that bit of text, Ill get it corrected as I was unable to locate it in a quick search.[/quote]
Greg, thanks for jumping in and confirming that we can’t create classes for our project using code. That is very sad, as I’m sure that everyone knows it is much faster to type out class definitions than to use the IDE with multiple mouse point-and-clicks. This is especially true if the classes have no Xojo superclass.
May I suggest a change to your class documentation that you explicitly state that “classes cannot be created using code. They must be created using the IDE.” That would have saved me many hours of research, watching videos, trial-and-error, and of course posting here, wasting other people’s time.
As @Alberto DePoo pointed out, the code creating classes that I quoted came from the XojoScript Language From Xojo Documentation. While I have since learned that you cannot use XojoScript to create classes (or other entities) for direct use in your project, you will note that on that page nowhere does it state that. When I discovered that page I was elated, thinking here is how to create classes via code – but no, that is wrong.
Here’s a quote from the top of that page:
[quote]
IDE Scripting
This topic describes the language operators, data types, keywords and commands that can be used with XojoScript and IDE Scripting.
Note: You cannot use any built-in Xojo classes within XojoScript.
. . .
Classes
You can create a class using the Class…End Class commands. A new class can have properties, methods, and events. Here is an example of how you can define a class:[/quote]
I hope you, and everyone, can see that for someone new to Xojo, that page clearly implies that we can create classes using code.
Having said all that, it does appear that maybe classes for use in the project could be created from code using IDE Scripting. However, there are no examples of doing so given on that page. If it is possible to do so, could I ask you (or someone at Xojo) to provide an example project showing how to use IDE Scripting to create classes?
Thanks.