Home All Groups Group Topic Archive Search About

Shortening my source.

Author
7 Jun 2006 3:57 AM
Kardon Coupé
Dear All,

I've been advised by a friend of mind that in VB you can shorten your source
(he doesn't know how to do it, it said someone told him), for example I
could have 'Microsoft.DirectX.Direct3D' in my source alot, but he said I
could, at the beginning on my source, define a short handle, like 'dx3d' to
equal that. So instead of typing the whole line, I can just use dx3d, and it
will know what I'm talking about.

I can't for the life of me find how to do this, I hope this doesn't come
across as a stupid question.

Regards.
Paul.

Author
7 Jun 2006 6:16 AM
Cor Ligthert [MVP]
Kardon,

Put in top of your programs

Imports Microsoft.DirectX.Direc3D
or put this in your project properties in the tab for that.

I hope this helps,

Cor

Show quoteHide quote
"Kardon Coupé" <prefer.to@readon.newsgroups> schreef in bericht
news:exkV6ZeiGHA.2208@TK2MSFTNGP05.phx.gbl...
> Dear All,
>
> I've been advised by a friend of mind that in VB you can shorten your
> source (he doesn't know how to do it, it said someone told him), for
> example I could have 'Microsoft.DirectX.Direct3D' in my source alot, but
> he said I could, at the beginning on my source, define a short handle,
> like 'dx3d' to equal that. So instead of typing the whole line, I can just
> use dx3d, and it will know what I'm talking about.
>
> I can't for the life of me find how to do this, I hope this doesn't come
> across as a stupid question.
>
> Regards.
> Paul.
>
Author
7 Jun 2006 6:21 AM
Simon
At the top of your file you can add

Imports dx3d=Microsoft.DirectX.Direct3D

Volia :-)


Kardon Coupé wrote:
Show quoteHide quote
> Dear All,
>
> I've been advised by a friend of mind that in VB you can shorten your source
> (he doesn't know how to do it, it said someone told him), for example I
> could have 'Microsoft.DirectX.Direct3D' in my source alot, but he said I
> could, at the beginning on my source, define a short handle, like 'dx3d' to
> equal that. So instead of typing the whole line, I can just use dx3d, and it
> will know what I'm talking about.
>
> I can't for the life of me find how to do this, I hope this doesn't come
> across as a stupid question.
>
> Regards.
> Paul.
Author
8 Jun 2006 3:19 AM
GhostInAK
Hello Simon,

This is actually a terrible construct and I pray to any diety that will listen
that MSFT takes this out of the next release. 

So you do Imports x=Microsoft.DirectX at the top of your file.. now 900 lines
later you write a function that references x.SomeClass... YIKES!  Just import
the namespace and dont try to 'simplify' things by using namespace aliases.

It's all about readability and maintainability.

-Boo

Show quoteHide quote
> At the top of your file you can add
>
> Imports dx3d=Microsoft.DirectX.Direct3D
>
> Volia :-)
>
> Kardon Coupé wrote:
>
>> Dear All,
>>
>> I've been advised by a friend of mind that in VB you can shorten your
>> sou
>>
> rce
>
>> (he doesn't know how to do it, it said someone told him), for example
>> I could have 'Microsoft.DirectX.Direct3D' in my source alot, but he
>> said I could, at the beginning on my source, define a short handle,
>> like 'dx3d'
>>
> to
>
>> equal that. So instead of typing the whole line, I can just use dx3d,
>> and
>>
> it
>> will know what I'm talking about.
>>
>> I can't for the life of me find how to do this, I hope this doesn't
>> come across as a stupid question.
>>
>> Regards.
>> Paul.
Author
7 Jun 2006 9:50 AM
Herfried K. Wagner [MVP]
"Kardon Coupé" <prefer.to@readon.newsgroups> schrieb:
> I've been advised by a friend of mind that in VB you can shorten your
> source (he doesn't know how to do it, it said someone told him), for
> example I could have 'Microsoft.DirectX.Direct3D' in my source alot, but
> he said I could, at the beginning on my source, define a short handle,
> like 'dx3d' to equal that. So instead of typing the whole line, I can just
> use dx3d, and it will know what I'm talking about.

'Imports' + F1.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>