My space web page - CHAPTER 5 STORING AND RETRIEVING APPLICATION DATA
CHAPTER 5 STORING AND RETRIEVING APPLICATION DATA REALbasic supports single dimensional and multidimensional arrays. A single dimensional array is a single list of data, such as a list of grocery items you might write down before visiting the supermarket. A multidimensional array is like a table made up of rows and columns that can be likened to an Excel spreadsheet. Just like variables, you use the Dim keyword to declare arrays. The syntax for declaring an array is outlined in the following. Dim ArrayName(dimensions) As DataType ArrayName represents the name of the array. Dimensions is a comma-separated list of numbers that specifies the number of dimensions the array has and the highest-defined element in the array. DataType tells REALbasic what type of data will be stored in the array. For example, the following statement declares a single dimension array that can hold ten elements. Dim strNamesArray(9) As String Because the first element in a REALbasic array has an index of 0, the previous examples can store elements using index numbers 0 through 9. The following statement demonstrates how to declare a two-dimensional array. Dim strNamesArray(4,9) As String In this example, an array named strNamesArray, which is made up of five rows (0 through 4) and ten columns (0 through 9), was defined. Tip REALbasic also provides a built-in function called Array, which you can use to quickly set up small arrays. The Array function takes a list of comma-separated values and turns them into an array. For example, the following statements are all that is necessary to define an array named strNamesArray and populate it with five elements. Dim strNamesArray() As String strNamesArray = Array(”Molly”, “William”, “Alexander”, “Jerry”, “Mary”) Loading Data into Arrays Once an array is defined, you can load data into it. To do so, you specify the index location for each element assigned to the array, as shown here. Dim strNamesArray(4) As String strNamesArray(0) = “Molly” strNamesArray(1) = “William” strNamesArray(2) = “Alexander” strNamesArray(3) = “Jerry” strNamesArray(4) = “Mary”
You want to have a cheap webhost for your apache application, then check apache web hosting services.