473,487 Members | 2,461 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

VB.NET ""Include" statement missing?

I have several lengthly VB.NET Enums that I'd like to
store in seperate files (not in the body of my main
routine.) I hoped that VB.NET had an "Include" statement
(like C) who presence indicates the content of a file is
inserted at this point in the code. But I couldn't find a
VB.NET "Include". Can I do what I want in VB.NET?

TIA,

Bill

Nov 20 '05 #1
4 17051
Hi,

Compile your files into a dll. Add a reference to the dll.

Ken
--------------------
"bill salkin" <an*******@discussions.microsoft.com> wrote in message
news:04****************************@phx.gbl...
I have several lengthly VB.NET Enums that I'd like to
store in seperate files (not in the body of my main
routine.) I hoped that VB.NET had an "Include" statement
(like C) who presence indicates the content of a file is
inserted at this point in the code. But I couldn't find a
VB.NET "Include". Can I do what I want in VB.NET?

TIA,

Bill

Nov 20 '05 #2
"bill salkin" <an*******@discussions.microsoft.com> schrieb
I have several lengthly VB.NET Enums that I'd like to
store in seperate files (not in the body of my main
routine.) I hoped that VB.NET had an "Include" statement
(like C) who presence indicates the content of a file is
inserted at this point in the code. But I couldn't find a
VB.NET "Include". Can I do what I want in VB.NET?


Including is not a good idea because copies of the code will be part of each
project.

Create a library and set a reference to the library from any project that
needs it.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #3
* "bill salkin" <an*******@discussions.microsoft.com> scripsit:
I have several lengthly VB.NET Enums that I'd like to
store in seperate files (not in the body of my main
routine.) I hoped that VB.NET had an "Include" statement
(like C) who presence indicates the content of a file is
inserted at this point in the code. But I couldn't find a
VB.NET "Include". Can I do what I want in VB.NET?


You don't need an 'include' (it doesn't even exist in VB.NET). Just
declare the enum, for example, as 'Public', and you can use it in other
places in the project.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #4
Bill,
In addition to the other comments. You can add a new "code file" to your
project, such as "myenums.vb" and add all your enums to this "code file".

Creating a class library (.dll) with the above "code file" will allow you to
share the enum between projects. If you only have a single project using a
code file may be easier. Note you can use "Link file" to create a link to a
single file from multiple projects, which avoid the class library (.dll)
altogether.

In VS.NET 2003:
- To add a "code file" use "Project - Add New Item - Code File".
- To link to a file, use "Project - Add Existing Item - Link File" (Link
file is on the drop down next to the Open button).

Hope this helps
Jay
"bill salkin" <an*******@discussions.microsoft.com> wrote in message
news:04****************************@phx.gbl...
I have several lengthly VB.NET Enums that I'd like to
store in seperate files (not in the body of my main
routine.) I hoped that VB.NET had an "Include" statement
(like C) who presence indicates the content of a file is
inserted at this point in the code. But I couldn't find a
VB.NET "Include". Can I do what I want in VB.NET?

TIA,

Bill

Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

43
5038
by: steve | last post by:
I am quite frustrated with php’s include, as I have spent a ton of time on it already... anyone can tell me why it was designed like this (or something I don’t get)? The path in include is...
2
2909
by: steve | last post by:
Hi, I need to do conditional script "include", but like to pull the code from db instead of a file. How do I do that? Reason: I like to implement some complex regex logic, and make it table...
5
6077
by: Danny Anderson | last post by:
Hola! I am working on a program where I am including a library that came with my numerical methods textbook. The "util.h" simply includes a large number of files. I had to change the util.h...
7
3531
by: mescaline | last post by:
Hi, Suppose a_file.cpp contains a function a_function() Now to include it in main_file.cpp I just do #include "a_file.cpp" and I'm all set. i recently came across this seemingly roundabout...
7
5519
by: j. smith | last post by:
Hi, I need your help! Why does Borland Builder says E2293 ) expected at line 210 when using the fellowing line: virtual void Parse(const TCHAR* szValue) = 0;
13
2462
by: Hans | last post by:
Hello, Thanks for all your response on my question about signed/unsigned chars. The problem is this: I want to use the char array for a ArrayLookup, so I need to convert char to unsigned int....
3
2689
by: Arpi Jakab | last post by:
I have a main project that depends on projects A and B. The main project's additional include directories list is: ...\ProjectA\Dist\Include ...\ProjectB\Dist\Include Each of the include...
3
5132
by: Kceiw | last post by:
Dear all, When I use #include "queue.h", I can't link it. The error message follows: Linking... G:\Projects\Datastructure\Queue\Debug\main.o(.text+0x136): In function `main':...
12
2388
by: Steve Pope | last post by:
Compiling the following works on my system: file main.cpp: #include <iostream> namespace space { int foo; }
0
6967
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7142
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6847
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5445
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4875
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3071
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1383
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
618
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
272
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.