New topic: Help! Four bugs
<http://forums.realsoftware.com/viewtopic.php?t=29683> Page 1 of 1 [ 1 post ] Previous topic | Next topic Author Message Stevekir Post subject: Help! Four bugsPosted: Fri Aug 21, 2009 4:20 pm Joined: Wed Apr 29, 2009 11:04 am Posts: 14 Location: UK 4 bugs! As a beginner, I have been working through the Quickstart Guide for RB 5.5 (but I am running RB 2009 Release 3). The project is to create a simple HTML editor, all well-known stuff. It consists of a main window Named "HtmlWindow" which has a large TextField Named "HTMLField". There are Menu Items for New, Open, Save Save As... I was hoping that I could repair any bugs due to the change in the two RB releases (I know about the change from "EditField" to "TextField"). I have checked avery line of code many times and consulted the RB 2009 Lang. Ref. and the Guide. THE PROJECT ~~~~~~~~~~~~~~~~ The FileTypes1 (Add Common File Type) is: Display Name: text Object Name: Text MacType:TEXT Extensions: Lots, including .txt ~~~~~~~~~~~~~~~ Document is a Property in the main window "HTMLWindow" ~~~~~~~~~~~~~~~ Could someone please help me to cure five bugs: ------------------- 1. I have a Menu Handler in the main window: ""FileSave" Its code is: SaveFile Title, False //BUG "You must use the value returned by this function" ------------------- 2. I have a similar Menu Handler in the main window: FileSaveAs" Its code is: SaveFile Title, True // BUG (as above) ------------------- 3. I have a Menu Handler in the App: "FileOpen" Its code is: Dim fi As FolderItem Dim hwin As HtmlWindow fi=GetOpenFolderItem ("text") If fi<> Nil Then hWin=New HtmlWindow fi.OpenStyledTextField hwin.HtmlField //BUG "Method or Property does not exist" hWin.Document=fi hWin.title=fi.name End If Return True ---------------- 4. Save File. I have Method "SaveFile", in the main window, with one param: FileName As String. Its code is: Dim fi As FolderItem, HtmlFileName As String //Document is a Property as FolderItem. //If the doc. has not been saved... If Document=Nil Or DisplaySaveDialog Then// "BUG Meth. or Prop does not exist" //then give it an html extension and save it.. If Mid(FileName,Len(FileName)-4,5)=".html" Then HtmlFileName=FileName Else HtmlFileName=FileName+".html" End If fi=GetSaveFolderItem("text",HtmlFileName) If fi <> Nil Then title=fi.name Document=fi End If End If //If the document exists... If Document <> Nil Then //then just save it. HtmlField is theTextField (in a Window) //into which the user types his html code.) Document.saveStyledTextField HtmlField //BUG "Method or Property does not exist" TextHasChanged=False End If (The RB 5.5 version in my Quicksart RB for Mac actually has ...StyledEditField...) -------------------- Thanks _________________ G5 Power PC, OS 10.5.7, 1 GB RAM, RB 2009 Release 3 Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 1 post ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
