On 2007-04-24, at 19:21, Charles Yeomans wrote: >> >> >> if prefs.WordWrap" then >> Dim TextWindow as TextWnoScroll >> else >> Dim TextWindow as TextWHscroll >> end if >> >> >> That is not hard to do at all, but it just not works.. > > > How does it not work? It looks like valid code to me. > > Charles Yeomans > _______________________________________________
1 - That was an example to declare TextWindow as global, so the compiler not shows error and stop (because TextWindow do not exist) So I wrote I wanted something like this: if prefs.Wordwrap = true then dim global TextWindow as TextWnoScroll else dim global TextWindow as TextWHScroll end if And this is impossible to do as "global", the compiler would always stop, because all declarations must be done before the app is opened And in this case it would not be global, because it is in the app open event.. 2 - Then I found this code using inside a method if prefs.Wordwrap = true then dim global TextWindow as TextWnoScroll TextWindow = new TextWnoScroll else dim global TextWindow as TextWHScroll TextWindow = new TextWHscroll end if TextWindow.Title = "text.txt" TextWindow.Document = f TextWindow.EditField1.text = "Hello" And this do not work, because the declarations is inside a block.. It have to be like this: if prefs.Wordwrap = true then dim global TextWindow as TextWnoScroll TextWindow = new TextWnoScroll TextWindow.Title = "text.txt" TextWindow.Document = f TextWindow.EditField1.text = "Hello" else dim global TextWindow as TextWHScroll TextWindow = new TextWHscroll TextWindow.Title = "text.txt" TextWindow.Document = f TextWindow.EditField1.text = "Hello" end if The code have to be rewritten twice.. Sven E ----------------------- REALbasic 2007R1 OS X 10.4.8 Intel and 10.4.6 PPC SEEdit Maxi THE XHTML EDITOR FOR MACINTOSH http://www.seedit.info _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives: <http://support.realsoftware.com/listarchives/lists.html>
