UserGuide

About Xojo Programming Language

From Xojo Documentation

Xojo is an integrated development tool, but it is also a programming language for Windows, macOS, Linux, iOS, web and Raspberry Pi. Xojo builds on languages such as Visual Basic and Java to provide the fastest and easiest way for you to create the apps you need for the platforms you use. Xojo uses safe programming patterns (strong data typing, for example), is object-oriented and has modern programming features such as introspection, extension methods and delegates. Programming with Xojo is fast, easy and most importantly, fun!

Although maybe you haven't heard of it before, Xojo has been around for many years. Since 1998, in fact. Xojo was originally called REALbasic and then Real Studio, but the programming language remains largely the same. Xojo was one of the first languages to use Automatic Reference Counting (ARC), something that other languages such as Swift and Objective-C now use. Although Xojo is easy to learn and use, it also has advanced features needed by professional developers such as namespaces, extension methods, exception handling, introspection, delegates and more.

And Xojo is always being modernized. Xojo uses the LLVM compiler tools to compile your apps for the best possible performance. LLVM are the same compiler tools used by Apple with Swift and Objective-C. The framework is being updated to API 2.0 for a more modern design, standardized API calls and improved use of new technologies. Xojo is ready for development needs now and for the next 20 years of software development.

Xojo feels familiar to programmers who have used other languages such as Visual Basic, Java and C# because it uses a similar object-oriented programming model, with similar data types and constructs. Using Xojo, you'll be able to create apps even faster than you ever thought possible.

Xojo is also friendly to new programmers. A big problem with most programming languages is that they are overcomplicated and overwhelm those new to them. Xojo has a powerful, integrated code editor with auto-complete that makes it easy to learn the language. The Xojo IDE is also incredibly easy to use, making experimentation (one of the best ways to learn) fast and fun.

Xojo is a great programming language for creating all types of apps, from simple "hello, world" to powerful enterprise software. With Xojo you'll create your apps in less time than before at less cost, making it a great investment for you or your company. It is a wonderful way to create apps for Windows, macOS, Linux, iOS, web and Raspberry Pi and continues to evolve with new features and capabilities added on a regular basis (quarterly, in fact). Our goals with Xojo have always been to make programming simpler. We can't wait to see what you create with it!

Writing Code

In the Welcome to this User Guide, you created a simple app with a button that displayed a message. Odds are you want your apps to do a bit more than that, so you're going to have to write some code. You do this using the Xojo Programming Language. This language is an easy-to-read, object-oriented programming language that makes it simple to create apps. The Xojo programming commands that you write are referred to as code.

To write code you use the Code Editor, which is essentially a text editor specifically designed for writing and editing Xojo code. Your code consists of a series of lines, with each line containing Xojo language commands. Like with any text editor, the text you write in the Code Editor does not "wrap" when you reach the end of the line. Instead the Code Editor scrolls. You create new lines by pressing Return.

The Xojo language consists of the series of commands that you write. With Xojo you generally have one command per line of code.

Where Does the Code Go?

Xojo does not provide a big blank text editor for you to write your code. Code belongs to a project item method or a control on a layout. If you recall from the simple example at the beginning, the code was placed in the Action event handler for a button. Event Handlers are a common place to put your code, but you can also create your own methods to contain code.

You can add Event Handlers to any control in your layout by selecting the control and choosing "Event Handler" from the Add button on the Layout Editor toolbar, the Insert button on the main toolbar or the Insert menu.

You can add your own methods (which can be called by other code in your app) by choosing "Method" from the Add or Insert options. A method is a container for your code. Event Handlers are a special type of method.

I Am a Beginner Programmer

To work through this section, you should visit the topics in this order:

Alternatively, if you are completely new to programming, you might want to first start with the Introduction to Programming with Xojo book.

I Already Know How to Program

If you already know how to program, you will likely only need to skim the materials in this section to get an understanding of the Xojo commands that are available. You can also refer to the Language Reference.