Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
Show only
|
Search instead for
Did you mean:
This page has been translated for your convenience with an automatic translation service. This is not an official translation and may contain errors and inaccurate translations. Autodesk does not warrant, either expressly or implied, the accuracy, reliability or completeness of the information translated by the machine translation service and will not be liable for damages or losses caused by the trust placed in the translation service.Translate
Hi All, I have a large application with many dozens of separate functions - DrawBuilding containing DrawLine/Circle etc. What is the best technique for scope of the database "db as New Database(False, True)"? It seems like a lot of duplication and overhead to create/save/dispose a database in each function, but I'm adverse to making Global. I am wondering about passing it as a parameter to each routine. The samples don't seem to show this type of structure, but I am sure my situation is very common. Thanks. Dale.
The architects of .NET were also adverse
to 'Global' variables, which is why there is no such thing as 'global' variables
in .NET.
Perhaps your confusion stems from the fact that VB.NET modules
are implicitly classes, and that any variables that are declared at the module
level (e.g., outside of a sub/function) are members of the class, rather than
variables having global scope.
It seems that you might need to get a
better undertstanding of variable scope.
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD
2009 Supporting AutoCAD 2000 through
2009 http://www.acadxtabs.com
<dbartlett>
wrote in message news:6088727@discussion.autodesk.com... Hi All, I have a
large application with many dozens of separate functions - DrawBuilding
containing DrawLine/Circle etc. What is the best technique for scope of the
database "db as New Database(False, True)"? It seems like a lot of duplication
and overhead to create/save/dispose a database in each function, but I'm adverse
to making Global. I am wondering about passing it as a parameter to each
routine. The samples don't seem to show this type of structure, but I am sure my
situation is very common. Thanks. Dale.
Hi, Firstly I am using RealDWG to create a new database/dwg, so the "New" etc is all ok. Secondly re variable scope: yes my terminology is wrong. I have several classes which all handle different parts of the construction of the single dwg result, so my database needs to be passed between these classes. Thanks, Dale