On 2007-04-24, at 16:55, Norman Palardy wrote: > > On 24-Apr-07, at 8:37 AM, Sven E Olsson wrote: > >> >> Just a note you can't even do this inside a function >> >> >> if prefs.Wordwrap = true then >> dim w as TextWndNoscroll >> w = new TextWndNoScroll >> else >> dim w as TextWndHscroll >> w = new TextWndHscroll >> end if >> >> w.title = "index.html" >> w.document = f >> w.EditFiled1.text = "hello" >> ------------------------ >> >> You have to write the code twice, because the dim statement is inside >> a block. > > Do TextWndNoscroll and TextWndHscroll share a common root class ?
Nope, there is no classes. The code above with the dim statement inside a block, is a small issue (just make the block bigger and write some code twice).. The problem is that my app (As an XHTML Tools) insert text, grab text, using regex find and replace, checking css classes, checking text encodings in the file and set proprties to the window.... And today it is doing this like this: TextWindow(window (i)).DoSomethingOrSetSomething .... And then I need to: if Prefs.WordWrap = true then TextWNoscroll(window(i)).DoSomethingOrSetSomething .... else TextWHscroll(window(i)).DoSomethingOrSetSomething .... end if Or write getters and setters in a module, but I think the code would be the about the same, I only get one place (module) to muck with it.. I just do a test for fun, and change the name of my TextWindow ... more than 800 errors > > if so you could declare the global to be that common root class once > and then use it as needed > > 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>
