Peter Jakobsson: > Out of interest, what advantages does this give you over using a global ? The > advantage of a global to me is that it preserves state throughout the life of > the form without any coding. (For example you don’t need to keep using Object > get Pointer(“myPopUp”) all over the place to re-create the state). Also, > using globals lets you do a lot of type-based debugging at compile time.
All true, but with globals you can have hard to find side effects. E.g. i have a lot of buttons and other variables on a lot of forms use "standard" global variables (bOK, bCancel, bSave, bPrint, bWhetever) so that I don´t have to define new globals for each form. Now and then it happened, that one form changed one of those variables that was also used by another form. Good luck with finding those bugs because they only happen now and then and are seldom reproducable. Using only dynamic variables in my forms saves me from those headaches. Also you don´t have a huge variable-table for each new process because 4D creates that table for every global variable in every process. You have a point about using Object get Pointer to get access to the variables, but most of the time that is only necessary in the form method, since I handle almost everything in that method. > If we take this to its logical conclusion won’t we just end up with Delphi, > .NET or Python instead of 4D ? (i.e. a low level environment that’s extremely > versatile but far less productive). I don´t know those languages, but I can see nothing low level about 4Ds approach. Quite the opposite in fact. Just my two Eurocent. Greetings from Germany, Bernd Fröhlich ********************************************************************** 4D Internet Users Group (4D iNUG) Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:[email protected] **********************************************************************

