On Apr 6, 2007, at 6:26 AM, Eric Pousse wrote: > Is there a big advantage to put "Dim declares" into the code instead > of before the code? > I ask this because I have old codes and only if advantage is big, I > will change place of "Dim declares". > Which kind of advantages can there be?
Convenience and scope. Prior to Rb 5.x, Dim statements had to be put prior to all other code. When 5.x was released, one had the ability to place them anywhere except within conditionals. With Rb 200x, you can place the Dim statement just about anywhere as long as it precedes the use of the variable. In 200x, If you place a Dim statement inside an If statement, its scope is limited to that If statement, not the entire method. Therefore, that variable can be Dimmed afterward. As far as old code reuse is concerned, it won't matter if you leave them where they are. See the User's Guide for a more detailed description. Terry _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives: <http://support.realsoftware.com/listarchives/lists.html>
