Submit web site - 132 CHAPTER 4 WORKING WITH REALBASIC MENUS
132 CHAPTER 4 WORKING WITH REALBASIC MENUS When executed, this statement tells REALbasic to clear out any currently displayed text in the application EditField control. Next, click the Add Menu Handler button again to add a new menu handler. Select the entry for the FileOpen menu item from the drop-down list for the MenuItem Name field and enter the following program statements. Dim f as FolderItem Dim TextInput as TextInputStream Window1.EditField1.Text= “” f = GetOpenFolderItem(”Application/Text”) If f <> nil Then TextInput = f.OpenAsTextFile Window1.EditField1.Text = TextInput.ReadAll End If Note To learn more about the basic file operations implemented in the RBQuickNote applications, see Chapter 9. These statements are responsible for creating a new empty file the user can use to create a new note. Next, click the Add Menu Handler button again to add another new menu handler. This time, select the entry for the FileSave menu item from the drop-down list for the MenuItem Name field and enter the following program statements. Dim f as FolderItem Dim TextStream As TextOutputStream f=GetSaveFolderItem(”Application/text”,”TextFile”) If f <> nil Then TextStream=f.CreateTextFile TextStream.WriteLine Window1.EditField1.Text TextStream.Close End If These statements are responsible for saving the note created by the user as a text file in whatever folder the user chooses to save them. Finally, click the Add Menu Handler button to add one last new menu handler. This time, select the entry for the HelpAbout menu item from the drop-down list for the MenuItem Name field and enter the following program statements. MsgBox”RBQuickNote Version 1.0 - 2006″
From our experience, we are can tell you that you can find a reliable and cheap webhost service at Java Web Hosting services.