

- #Xojo access array of arrays how to#
- #Xojo access array of arrays mod#
- #Xojo access array of arrays code#
If I wanted to solve the preceding expression on a piece of paper, I would write it out like this: See the section titled "Strings" later on in this chapter for more information.) (In these examples, all the literals I am using are numbers, but you can use characters, too, as long as you use quotes around them. In this case, the literal value for the integer is 2. There are two ways represent the operands of an expression in REALbasic.
#Xojo access array of arrays mod#
There are two others, mod and integer division (\), which I will discuss shortly. You will likely be familiar with most of them already, including +, -, *, /, and ^ for addition, subtraction, multiplication, division, and power, respectively. The REALbasic programming language has a variety of operators.
#Xojo access array of arrays how to#
The operators are the rules that tell the computer how to calculate the new value based on the input given. Like a function, you can think of the operands that make up an expression as the inputs to a function. The number 4 is the value returned by this particular expression.

You should be able to see that the answer to this equation is 4. In this example, the operator is the plus sign (+) and the operands are both 2. An expression is a combination of one or more operands, plus one or more operators that are used to calculate a new value. In computer programming, the definitions of both functions and operators are a little more squishy, but it helps to understand their mathematical heritage. The technical definition of a function is that it takes an input and returns an output according to a set of rules. In fact, in mathematics an operator is a kind of function. Operators and functions are related to each other.
#Xojo access array of arrays code#
This will help you (or someone else in the future) understand what your code is doing. When writing any kind of program, it's a good idea to make liberal use of comments throughout your code. 'A line starting with an apostrophe is a comment // As is a line starting with two forward slashes A comment in REALbasic can take on one of two forms: A comment is some text included by the programmer that is ignored by the program and intended to document a portion of code. One thing you will see quite often are comments that I include in the sample code to explain what's happening at a particular point or to let you know what the value of a particular variable should be. Throughout this section I will use snippets of code to serve as examples. These serve as the building blocks for functions and subroutines, and this is where we will start in our review of the REALbasic programming language. Statements and Declarations and CommentsĪ method is made up of a series of declarations, expressions, and statements that make up your application's programming code.


In this section, I will start with the language elements of REALbasic that are more procedural and will defer until the next chapter a discussion of REALbasic's object-oriented features. REALbasic is an object-oriented programming language, but as I said earlier, REALbasic takes a practical approach to object-oriented programming and retains procedural programming elements.
