473,836 Members | 1,560 Online
Bytes | Software Development & Data Engineering Community
+ 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 17084
Hi,

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

Ken
--------------------
"bill salkin" <an*******@disc ussions.microso ft.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*******@disc ussions.microso ft.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*******@disc ussions.microso ft.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*******@disc ussions.microso ft.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
5142
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 relative NOT to the immediate script that is including it, but is relative to the top-level calling script. In practice, this means that you have to constantly worry and adjust paths in includes, based on the startup scripts that call these...
2
2943
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 driven. The regex would include if/then/else type logic, and would like my script to conditionally execute the logic. -- http://www.dbForumz.com/ This article was posted by author's request
5
6098
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 slightly to adjust path names and also take into account I am working with a case-sensitive OS. My program is below. The sticky point is that adding (#include "util.h") seems to negate the (#include <string>) statement somehow. How can I get...
7
3557
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 way to do this in 3 steps: 1. Add in main_file.cpp
7
5554
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
2513
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. But this doesn't work! If I try this:
3
2715
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 directories contain a file named "cppfile1.h". In my main project I #include "cppfile1.h". I rely on the order of paths in additional include directories list to get file cppfile1.h from ProjectA and
3
5163
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': G:\Projects\Datastructure\Queue\main.cpp:16: undefined reference to `Queue<char>::Queue()' G:\Projects\Datastructure\Queue\Debug\main.o(.text+0x394): In function `Z10do_commandcR5QueueIcE':
12
2418
by: Steve Pope | last post by:
Compiling the following works on my system: file main.cpp: #include <iostream> namespace space { int foo; }
0
9671
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10846
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10551
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10594
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9376
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6979
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5828
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4458
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 we have to send another system
2
4020
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.