146 CHAPTER 5 STORING AND RETRIEVING APPLICATION (Web hosting isp)
146 CHAPTER 5 STORING AND RETRIEVING APPLICATION DATA The following statement demonstrates how to work with string manipulation functions. Dim strSampleMsg As String = ” A long time ago in a galaxy far, far away ” MsgBox(Replace(strSampleMsg, “galaxy”, “universe”)) MsgBox(Uppercase(strSampleMsg)) MsgBox(Trim(strSampleMsg) + ” where no one boldly dared go before!”) Note In the section Supplying Application Code, where you ll supply the program code required to create the RBCalculator application, you have the opportunity to use both the Mid and InStr functions. The first statement declares a variable name strSampleMsg and assigns it a text string. The second statement uses the Replace function to replace the first occurrence of the string galaxy with the string universe, found in strSampleMsg before displaying the resulting value of the string in a pop-up dialog. The third statement uses the Uppercase function to convert the value stored in strSampleMsg to all uppercase characters before displaying the resulting string in a pop-up dialog. The last statement uses the Trim function to remove any leading and trailing blank spaces from the value stored in strSamplemsg before appending the variable s value to another string. Note When used with two strings, the + character adds together or concatenates the strings to create a new string. Visual Basic programmers should note that, in REALbasic, the + character is used instead of the & character to perform concatenation. Storing Data in Arrays The more variables your REALbasic applications have to manage, the more complicated your code becomes. In many cases, data managed by your applications may be closely related. For example, an application might need to collect customer names or IDs. In these cases, you can simplify things by storing data in an array. An array is an indexed collection of data that can be processed as a unit. Individual pieces of data stored in an array are referred to as elements. The first element in an array is assigned an index number of zero. As each additional piece of data is added to an array, it is assigned an incremental index number. Once loaded, you can reference any piece of data in the array by specifying its index number. Tip When creating an array name, try to find a name that describes the array s purpose or contents. For example, an array whose purpose is to hold user names might be named strNamesArray. Note, in this example, a three-letter prefix was added to the beginning of the array name to identify the type of data stored. Also, note, the word Array was added to the end of the array name to identify it as an array.
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check mysql web server services.