what are the various alternatives to including a group of imports statements
in every module ?
imports <namespace1.cla ss1>
imports <namespace2.cla ss1>
imports <namespace2.cla ss2>
etc. 8 1115
* "John A Grandy" <johnagrandy-at-yahoo-dot-com> scripsit: what are the various alternatives to including a group of imports statements in every module ?
imports <namespace1.cla ss1> imports <namespace2.cla ss1> imports <namespace2.cla ss2> etc.
A project import. Go to the project properties window -> "General
Properties" -> "Imports" and add your imports there. But why do you
want to import classes?
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Hi Herfried,
Can be useful, I did it to the System.Convert class once, when a code file
had excessive need to use the shared methods within.
--
HTH,
-- Tom Spink, Über Geek
Woe be the day VBC.EXE says, "OrElse what?"
Please respond to the newsgroup,
so all can benefit
"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:ON******** ******@TK2MSFTN GP12.phx.gbl... * "John A Grandy" <johnagrandy-at-yahoo-dot-com> scripsit: what are the various alternatives to including a group of imports
statements in every module ?
imports <namespace1.cla ss1> imports <namespace2.cla ss1> imports <namespace2.cla ss2> etc.
A project import. Go to the project properties window -> "General Properties" -> "Imports" and add your imports there. But why do you want to import classes?
-- Herfried K. Wagner [MVP] <http://www.mvps.org/dotnet>
* "Tom Spink" <thomasdotspink at@ntlworlddotc om> scripsit: Can be useful, I did it to the System.Convert class once, when a code file had excessive need to use the shared methods within.
Right -- I use it too for shared methods of "uitility" classes.
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
why limit it to shared methods of .net framework classes?
i do imports of all sorts of custom classes i write. as long as you
carefully choose your method names to be (1) distinct from anything .net
offers, and (2) properly indicative of what the method actually does, then
you save a lot of typing and characters on the page. also, less lines
extending off the page (or need to break the lines with line-continuation
characters). it all adds up to more readable code.
anything that can reduce code-bloat is good, in my opinion
"John A Grandy" <johnagrandy-at-yahoo-dot-com> schrieb why limit it to shared methods of .net framework classes?
i do imports of all sorts of custom classes i write. as long as you carefully choose your method names to be (1) distinct from anything .net offers, and (2) properly indicative of what the method actually does, then you save a lot of typing and characters on the page. also, less lines extending off the page (or need to break the lines with line-continuation characters). it all adds up to more readable code.
anything that can reduce code-bloat is good, in my opinion
I don't agree. Classes are there /not/ to be forced to find "globally"
unique names, and you get a better structured code. If you put it all in one
pot again would put this concept upside down (IMO) (and as usual there are
exceptions from the rule).
--
Armin
How to quote and why: http://www.plig.net/nnq/nquote.html http://www.netmeister.org/news/learn2quote.html
what kind of classes?
let's generalize and say that, practically speaking, there are two kinds of
classes:
1. classes that hold data
2. classes that don't
so, instances of cat 1 classes differentiate themselves based on specific
data values held
for cat 2 classes, if instantiation is a mere formality, why bother with it?
you can extend this generalization to include in cat 2 those classes with
only a few initialization parameters. (they don't truly hold data, at least
not db io data)
"Armin Zingler" <az*******@free net.de> wrote in message
news:%2******** **********@tk2m sftngp13.phx.gb l... "John A Grandy" <johnagrandy-at-yahoo-dot-com> schrieb why limit it to shared methods of .net framework classes?
i do imports of all sorts of custom classes i write. as long as you carefully choose your method names to be (1) distinct from anything .net offers, and (2) properly indicative of what the method actually does, then you save a lot of typing and characters on the page. also, less lines extending off the page (or need to break the lines with line-continuation characters). it all adds up to more readable code.
anything that can reduce code-bloat is good, in my opinion I don't agree. Classes are there /not/ to be forced to find "globally" unique names, and you get a better structured code. If you put it all in
one pot again would put this concept upside down (IMO) (and as usual there are exceptions from the rule).
-- Armin
How to quote and why: http://www.plig.net/nnq/nquote.html http://www.netmeister.org/news/learn2quote.html
"John A Grandy" <johnagrandy-at-yahoo.com> schrieb what kind of classes?
let's generalize and say that, practically speaking, there are two kinds of classes: 1. classes that hold data 2. classes that don't
so, instances of cat 1 classes differentiate themselves based on specific data values held
for cat 2 classes, if instantiation is a mere formality, why bother with it?
you can extend this generalization to include in cat 2 those classes with only a few initialization parameters. (they don't truly hold data, at least not db io data)
I was not talking about instantiation and initialization, so I don't see the
point.
--
Armin
How to quote and why: http://www.plig.net/nnq/nquote.html http://www.netmeister.org/news/learn2quote.html This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: David Lozzi |
last post by:
I'm trying to do this:
<%@ Page Language="VB" %>
<script runat="server">
Imports System.Data
Imports System.Data.SqlClient
But i get this error on line 4:
|
by: |
last post by:
I'm picking up an 'IMPORTS' error for a simple database insert based on two
input entry boxes in my form?
It says an 'Imports' statement must preceede any declarations....... is this
perahps the '@' symbol??
Any help appreciated!
Thanks
Jason
|
by: Chad Beckner |
last post by:
I am starting to translate some code from ASP to ASP.NET (VB). I was able
to query ADS to get a users groups that they belong to, and also query a
group and get a list of users. However, I can't seem to get this to work in
VB.Net. Here's what I have:
OLD ASP Code:
Function Get_ADS_Users_For_Group(ADS_Path)
Dim Group_Information
Dim Error_Number
|
by: david |
last post by:
When I declared the imports statements as follows
Imports System.Runtime.Remoting
Imports System.Runtime.Remoting.Channels
Imports System.Runtime.Remoting.Channels.Tcp
Imports System.Runtime.Remoting.Channels.Http
the last two can not be found.
What is wrong with it?
|
by: Tiraman |
last post by:
Hi ,
I have an assembly that hold few class and few imports which are not used in
all of the class's .
so my question is when to use the "Imports XXX"
And when to use this kind of statement
Dim X as New System.XXX ....
| |
by: Howard Kaikow |
last post by:
I was doing some testing of the effect of Option Strict on particular Word
VBA statements.
So I created a Form, the events of which called Subs in separate Modules.
Each Module is in a separate file so I can have a different Option Strict in
each.
I then noticed that I had to include an identical Imports statement in each
of the 3 files.
|
by: pcnerd |
last post by:
In Java I can use, for example, " Imports java.util.* ". Can I use, for
example, " Imports System.* " instead of several different "Imports"
statements? Thank you. David
|
by: Mike |
last post by:
I am trying to create a small admin toolset using visual studio 2005 (vb).
I want to be able to supply a domain username and have it add to the local
workstation Remote desktop user's group. This is the code I have so far.
Dim LCL As New DirectoryEntry
Dim DOM As New DirectoryEntry
Dim DOMUSR As DirectoryEntry
Dim LCLGRP As DirectoryEntry
LCL = "WinNT://" & "PCNAME" & ",computer"
|
by: kimiraikkonen |
last post by:
Hello,
I want to ask about "imports" statement. Some projects must be
inserted with "imports xxxx" statements before beginning coding. But
how do i know when to use or do i have to use "imports" statement?
How will i know which "imports" will my project need? From books or
how can i guess?
Thanks...
|
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...
|
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...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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...
|
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();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |