Basic .NET questions non-language specific

  • Thread starter Thread starter Robert Meek
  • Start date Start date
R

Robert Meek

I'm using VS 2005 with the Chrome add-on to write NET applications in
Object Pascal. But my questions are very basic and no language specific so
I'm hopeful someone here can help me.

1. I'm not sure I understand the relation of the References section of
the Solution Explorer. I thought that any Namespaces added here were then
automatically used by all units in the project, but if this is true, then
why do they also have a project option allowing you to set default
Namespaces, and why are many of the Namespaces in the References section
shown redundantly in each unit's uses section?

2. When I create a new windows form and VS creates the file and adds it
to my project, I am assuning that an instance of this Windows Form is NOT
automatically
created when the app is first started. Now if I wish to access and/or
create a new instance of this new form from a button click event on the
MainForm, shouldn't I need to add the new Form's pas file to my uses section
of the MainForm? I tried but could not do so. What I was able to do
however, is add a variable to my MainForm's public section: Var MyNewForm :
MyNewForm; and then I was able to test in my Mainform's button click to see
if it had been assigned yet. If not I create it, and if so I just Show it.
But what if I also want to access this new Form from another Form
altogether? I shouldn't have to create a new var instance. I just may wish
to access something on the New Form after it was created and shown from my
MainForm. How do I add it to my 3rd form's uses section so that it is
accessible from there?

3. In Delphi, which I used to program in, we had the TIniFile class which
allowed you to read and write text-based IniFiles in which application
configuration data could be written and read. So for example if I wanted to
store the last position and size the user left a particular Form in when he
closed the application I could write that info into my Inifile as integer
values, and then upon the next startup I could read these integers and set
the Form back to the same position and size again. With NET what namespace
do in use, what kind of document, and what class to read/write such info? I
would need to be able to work with Strings, Booleans, DateTimes, Integers,
and a few other types.

4. Finally, in the project options there is a setting for the creation of
xml Documentation. I believe this is supposed to create an xml file of all
comments I add to my code, but so far I have not been able to find any such
file. What do I need to do to create and work with this xml file?

I've looked and looked in the help but I've come up empty on these
things, so i would greatly appreciate any help you can give!
 
1. Adding a reference to an assembly to your project does not automatically
import a namespace into file scope (which simply means you don't necessarily
have to fully qualify the namespace).

2. I assuming creating a new form in pascal automatically adds the .pas file
to the project and you don't need to do anything special to use it. I should
automatically add it to the default namespace so you would not have to a uses
section. I don't remember how to instantiate a class in Pascal; but that
should all you need to do...

3. I don't think there's inherent support for .ini files in .NET. Usually
you use .config files (which are XML-based) via the System.Configuration
namespace.

4. The compiler generates the xml documentation file. If the pascal
compiler doesn't support XML doc comments/tags it won't generate that file.
 
Thanx much for the quick reply. But about adding the pas file to the
Namespace IF I wanted to instead of adding it to the default namespace
options, everytime I try to do so I get an error that there's no instance of
it. Does it go in the uses section of the interface section or after the
program name namespace?
 
Back
Top