Shortening my source.

  • Thread starter Thread starter Kardon Coupé
  • Start date Start date
K

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.
 
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
 
Kardon Coupé said:
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.
 
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
 
Back
Top