Shortening my source.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Kardon Coupé

    #1

    Shortening my source.

    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.Dire ctX.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.


  • Cor Ligthert [MVP]

    #2
    Re: Shortening my source.

    Kardon,

    Put in top of your programs

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

    I hope this helps,

    Cor

    "Kardon Coupé" <prefer.to@read on.newsgroups> schreef in bericht
    news:exkV6ZeiGH A.2208@TK2MSFTN GP05.phx.gbl...[color=blue]
    > 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.Dire ctX.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.
    >[/color]


    Comment

    • Simon

      #3
      Re: Shortening my source.

      At the top of your file you can add

      Imports dx3d=Microsoft. DirectX.Direct3 D

      Volia :-)


      Kardon Coupé wrote:[color=blue]
      > 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.Dire ctX.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, andit
      > 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.[/color]

      Comment

      • Herfried K. Wagner [MVP]

        #4
        Re: Shortening my source.

        "Kardon Coupé" <prefer.to@read on.newsgroups> schrieb:[color=blue]
        > 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.Dire ctX.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.[/color]

        'Imports' + F1.

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

        Comment

        • GhostInAK

          #5
          Re: Shortening my source.

          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.Dir ectX 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
          [color=blue]
          > At the top of your file you can add
          >
          > Imports dx3d=Microsoft. DirectX.Direct3 D
          >
          > Volia :-)
          >
          > Kardon Coupé wrote:
          >[color=green]
          >> Dear All,
          >>
          >> I've been advised by a friend of mind that in VB you can shorten your
          >> sou
          >>[/color]
          > rce
          >[color=green]
          >> (he doesn't know how to do it, it said someone told him), for example
          >> I could have 'Microsoft.Dire ctX.Direct3D' in my source alot, but he
          >> said I could, at the beginning on my source, define a short handle,
          >> like 'dx3d'
          >>[/color]
          > to
          >[color=green]
          >> equal that. So instead of typing the whole line, I can just use dx3d,
          >> and
          >>[/color]
          > it[color=green]
          >> 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.[/color][/color]


          Comment

          Working...