#include equilvelant [英] #include equilvelant

查看:95
本文介绍了#include equilvelant的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,我在.net中做的代码现在看起来相当复杂,

最初是一个小项目已经发展壮大

及其时间为我的代码保留一些房子


我试图实现一个.h(c ++)文件以使用更好的单词


所有我想要做的是有一个文件,其中包含我所有的主要定义




而在c ++我会做#include我在vb中做什么.net?


即我想要

dim x as string =" abcdefg"

dim y as stirng =" hijklmno"


但是我希望能够在我制作的任何其他课程中包含x和y


我试过并试图这样做在vb中只是不能

问候

迈克研究员

解决方案

Hello Mike

我不确定但Imports namespace.element可能会有效。


亲切的问候

Jorge Cavalh eiro

-----原始消息-----
好吧,我在.net中做的代码现在开始看起来是
相当复杂,最初只是一个小项目已经成长和发展
和它的时间来保持我的代码

我试图实现.h(c ++)文件使用一个
更好的词
所有我想做的是有一个文件,其中包含我所有的
主要定义初始

而在c ++我会做#include什么我在
vb.net做什么?
ie我想要

dim x as string =" abcdefg"
dim y as stirng =" hijklmno"

但我希望能够包含x和我在任何其他的
课程中我已经尝试过并试图在vb中做到这一点而只是不能

问候

Mike Fellows



Mike,


您指的是内联包含的文件吗?如果是这样,VB.net不支持
支持这个。


替代品包括以下内容:


1)定义模块中常用的常量和方法,然后将

模块添加到项目中。你不可能用这种方式定义代码片段 - 只需要常用的方法,常量和变量。将

文件添加到项目中时,将创建该文件的副本。


2)将代码段拖到visual studio中的工具箱中并重命名它。当您想要插入它时,只需拖放即可。


3)与(1)一样,除了设计它以便它可以放入类库自己然后引用类库。

HTH,


Trev。




" Mike Fellows" < MI *************** @ equityhouse.co.uk>在消息中写道

news:vq ************* @ newsfep3-gui.server.ntli.net ...

ok my我在.net中执行的代码现在开始看起来相当复杂,开始时作为一个小项目已经发展壮大
和它的时间来保持我的代码

我想要做的就是有一个文件,其中包含我所有的主要定义


而在c ++我会做#include我在vb.net做什么?

即我想要

dim x as string =" abcdefg"
dim y as stirng =" hijklmno"

但我希望能够在我制作的任何其他课程中加入x和y

我试过并尝试在vb中做到这一点,只是不能

问候

Mike Fellows



< blockquote>" Mike Fellows" < MI *************** @ equityhouse.co.uk> schrieb

好吧,我在.net中做的代码现在开始看起来相当复杂,最初是作为一个小项目开始增长和成长的时间保持我的代码

我试图实现一个.h(c ++)文件,以便使用更好的单词

我想做的就是拥有一个包含所有文件的文件我的主要定义是什么

而在c ++我会做#include我在vb.net做什么?

即我想要

dim x as string =" abcdefg"
dim y as stirng =" hijklmno"

但我希望能够在任何其他类中包含x和y


我尝试过尝试在vb中执行此操作并且只是不能




编写类库以获取可重用的代码。

-

Armin


如何报价及原因:
http://www.plig.net/nnq/nqu ote.html
http://www.netmeister .org / news / learn2quote.html


ok my code that im doing in .net is now starting to look fairly complicated,
what started out as a small project has grown and grown
and its time for some house keeping of my code

im trying to implement a .h (c++) file for use of a better word

all i want to do is have one file which has all of my major definations in
it

whereas in c++ i would do #include what do i do in vb.net?

i.e. i want
dim x as string = "abcdefg"
dim y as stirng = "hijklmno"

but i want to be able to include x and y in any other classes i make

ive tried and tried to do this in vb and just cant
Regards
Mike Fellows

解决方案

Hello Mike

I''am not sure but Imports namespace.element might work.

Kind Regards
Jorge Cavalheiro

-----Original Message-----
ok my code that im doing in .net is now starting to look fairly complicated,what started out as a small project has grown and grown
and its time for some house keeping of my code

im trying to implement a .h (c++) file for use of a better word
all i want to do is have one file which has all of my major definations init

whereas in c++ i would do #include what do i do in vb.net?
i.e. i want
dim x as string = "abcdefg"
dim y as stirng = "hijklmno"

but i want to be able to include x and y in any other classes i make
ive tried and tried to do this in vb and just cant
Regards
Mike Fellows
.



Mike,

Are you referring to inline including of files? If so, VB.net doesn''t
support this.

Alternatives include the following:

1) Define Commonly used constants and methods in a module and then add the
module to your project. You won''t be able to define code snippets in this
way - just commonly used methods, constants and variables. A copy of the
file will be created when you add it to your project.

2) Drag a code snippet to the toolbox in visual studio and rename it. When
you want to insert it, simply drag and drop.

3) As with (1), except design it so it can be put into a class library of
its own and then reference the class library.
HTH,

Trev.



"Mike Fellows" <mi***************@equityhouse.co.uk> wrote in message
news:vq*************@newsfep3-gui.server.ntli.net...

ok my code that im doing in .net is now starting to look fairly complicated, what started out as a small project has grown and grown
and its time for some house keeping of my code

im trying to implement a .h (c++) file for use of a better word

all i want to do is have one file which has all of my major definations in
it

whereas in c++ i would do #include what do i do in vb.net?

i.e. i want
dim x as string = "abcdefg"
dim y as stirng = "hijklmno"

but i want to be able to include x and y in any other classes i make

ive tried and tried to do this in vb and just cant
Regards
Mike Fellows



"Mike Fellows" <mi***************@equityhouse.co.uk> schrieb

ok my code that im doing in .net is now starting to look fairly
complicated, what started out as a small project has grown and
grown and its time for some house keeping of my code

im trying to implement a .h (c++) file for use of a better word

all i want to do is have one file which has all of my major
definations in it

whereas in c++ i would do #include what do i do in vb.net?

i.e. i want
dim x as string = "abcdefg"
dim y as stirng = "hijklmno"

but i want to be able to include x and y in any other classes i
make

ive tried and tried to do this in vb and just cant



Write class libraries to get reusable code.
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html


这篇关于#include equilvelant的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆