![]() Documentation that is far easier for Xojo to maintain because it’s designed to be used with version control.Starting with Xojo 2022r1, documentation for each version of Xojo will be available online.Pages that automatically adjust to smaller screens.Class pages have been redesigned to have a top-down view (basic information at the top and more detailed information below), making them easier to use and review.A table of contents is always available on every page, making it easy to navigate. ![]() A single help window that includes all pages of the documentation rather than just the Language Reference.With this Xojo Documentation site you’ll find: This Xojo Documentation uses a completely new engine, offers improved searching and more to help you, and us, use it more effectively. With that in mind, we have been working on updating Xojo’s documentation for a while now. The Scope of an item determines its accessibility to other items in the project.We are always looking for ways to help you be more successful using Xojo and the documentation is a critical component to your success. The Scope is also indicated in the Navigator. When you add an item to a module, you need to set its Scope using the Scope property in the Inspector. For more about Using, see Namespaces below. Think of a Note as a giant comment.Īdds a Structure, which is an advanced data type typically used with Declares.Īdds a Using statement that is applied to the entire module. Use a Note to add comments, description or any other text to the module that is not part of the code. You can also add other items to a module, including: Enumerations, External Method, Note, Structure, Using Clause.Īn Enumeration is a data type consisting of a set of named values.Īdd a reference to an external method (also called a Declare), which can be a method on a DLL (on Windows), a dylib (on macOS) or a shared library (on Linux).Ī Note is essentially a text field that is added to a project item. For more about this, refer to the Localization topic. A dynamic constant can have values that are specific to an OS or language and is referred to as a Localized String. For the Default Value, Constants can be assigned only a literal value, another constant value or the result of a constant expression.Ĭonstants of type String or Text can also be set to Dynamic. You can set the Constant Name, Default Value, Type (Number, String, Boolean, Color, Text) and Scope using the Inspector. Keyboard shortcut (Option-Command-C on MacOS or Ctrl+Shift+C on Windows and Linux).There are several ways to add a constant to a module, which all display the Constant Editor: Properties are variables that belong to the entire module rather than a single method. Modules primarily contain properties, methods and constants so those are covered first. Modules are identified by a "globe" icon in the Navigator. You edit modules with the Code Editor: simply click the module’s name in the Navigator. For example, if the module contains financial functions, you might name it Financial. You can use the Inspector to rename the module to something more appropriate. The new module appears in the Navigator with a default name (the first module you add will be named Module1, for example). You can add a new module to your project by clicking the Insert button on the toolbar and selecting Module (or by using the menu Insert ↠ Module or the contextual menu). If you want information to remain specific to a session, use the Session object. In Web projects, module properties and methods are global across all sessions. Modules are covered here first since they are easier to use and learn and transition nicely to classes (which are covered in other topics). Global properties, but these should be minimal to avoid tightly-coupled "spaghetti code".Global constants, particularly for localization.With that said, here are some common (and valid) uses for modules: In most cases, you will probably be better served by a class. In general, modules should be used sparingly in an object-oriented language such as Xojo. In fact, modules can pretty much contain anything except layouts such as Windows, Web Pages, Views and Container Controls. But a module can also contain other project items such as classes or even other modules. 4.1 Creating and Using an Extension MethodĪ module is a collection of project items, usually methods, properties and constants.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |