shortcut

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • vinnie

    #1

    shortcut

    is there any shortcut available that i can use, without typing all the
    time Console.Writeli ne() all the time in C#?

    Thanks

  • Doug Semler

    #2
    Re: shortcut

    On Sep 7, 5:32 pm, vinnie <centro.ga...@g mail.comwrote:
    is there any shortcut available that i can use, without typing all the
    time Console.Writeli ne() all the time in C#?
    >
    Thanks
    Create a keyboard macro. Tools->Options

    Comment

    • =?Utf-8?B?TWFya19QYXJrZXI=?=

      #3
      RE: shortcut

      Add this line amongst the other using statements:

      using System.Console;

      With that in place the compiler will understand that you mean
      System.Console. WriteLine when you have WriteLine.
      Mark

      "vinnie" wrote:
      is there any shortcut available that i can use, without typing all the
      time Console.Writeli ne() all the time in C#?
      >
      Thanks
      >
      >

      Comment

      • =?Utf-8?B?UmFr?=

        #4
        RE: shortcut

        code snipper to the rescue
        "cw" + tab

        http://msdn2.microsoft.com/en-us/lib...at(VS.80).aspx
        http://ceiled.spaces.l ive.com/blog/cns!FDEE70107FF 2676B!126.entry

        - Rakesh

        "vinnie" wrote:
        is there any shortcut available that i can use, without typing all the
        time Console.Writeli ne() all the time in C#?
        >
        Thanks
        >
        >

        Comment

        • Lit

          #5
          Re: shortcut

          create a private method like this C#

          w(string stringToWriteli ne)
          {
          System.Console. Writeline(strin gToWriteline);
          }

          then use it like this.

          w("this);
          w("that");

          Lit


          "vinnie" <centro.gamma@g mail.comwrote in message
          news:1189200747 .759939.281080@ 50g2000hsm.goog legroups.com...
          is there any shortcut available that i can use, without typing all the
          time Console.Writeli ne() all the time in C#?
          >
          Thanks
          >

          Comment

          • Doug Semler

            #6
            Re: shortcut

            "Mark_Parke r" <MarkParker@dis cussions.micros oft.comwrote in message
            news:CCC7B1D2-40B8-40BB-A8FF-4ABE0B918AC4@mi crosoft.com...
            Add this line amongst the other using statements:
            >
            using System.Console;
            >
            With that in place the compiler will understand that you mean
            System.Console. WriteLine when you have WriteLine.
            Mark
            >
            I *DARE* you to try this and see if it works.



            --
            Doug Semler, MCPD
            a.a. #705, BAAWA. EAC Guardian of the Horn of the IPU (pbuhh).
            The answer is 42; DNRC o-
            Gur Hfrarg unf orpbzr fb shyy bs penc gurfr qnlf, abbar rira
            erpbtavmrf fvzcyr guvatf yvxr ebg13 nalzber. Fnq, vfa'g vg?

            Comment

            • =?Utf-8?B?TWFya19QYXJrZXI=?=

              #7
              Re: shortcut

              You're right--it didn't work. Care to enlighten me as to why it didn't?

              "Doug Semler" wrote:
              "Mark_Parke r" <MarkParker@dis cussions.micros oft.comwrote in message
              news:CCC7B1D2-40B8-40BB-A8FF-4ABE0B918AC4@mi crosoft.com...
              Add this line amongst the other using statements:

              using System.Console;

              With that in place the compiler will understand that you mean
              System.Console. WriteLine when you have WriteLine.
              Mark
              >
              I *DARE* you to try this and see if it works.
              >
              >
              >
              --
              Doug Semler, MCPD
              a.a. #705, BAAWA. EAC Guardian of the Horn of the IPU (pbuhh).
              The answer is 42; DNRC o-
              Gur Hfrarg unf orpbzr fb shyy bs penc gurfr qnlf, abbar rira
              erpbtavmrf fvzcyr guvatf yvxr ebg13 nalzber. Fnq, vfa'g vg?
              >
              >

              Comment

              • Doug Semler

                #8
                Re: shortcut

                "Mark_Parke r" <MarkParker@dis cussions.micros oft.comwrote in message
                news:52101D79-EE65-4E9A-9941-BA7314FFDA4E@mi crosoft.com...
                You're right--it didn't work. Care to enlighten me as to why it didn't?
                >
                I meant to smilie that but I had a bad day...

                the "using" statement (in this context) requires a namespace. System is a
                namespace. Console is a class in that namespace. What I like about C++ is
                it's obvious:
                using namepace System;

                but in C#, you could say:
                using System;

                .....

                Console.WriteLi ne(ladeeda);

                What Vinnie was asking was trying to avoid the actual typing of the letters
                'C' 'o' 'n' 's' 'o' 'l' 'e' '.' 'W' 'r' 'i' 't' 'e' 'L' 'i' 'n' 'e'

                In other words, he's just like all other programmers.... he's lazy! <BIG
                grin>
                --
                Doug Semler, MCPD
                a.a. #705, BAAWA. EAC Guardian of the Horn of the IPU (pbuhh).
                The answer is 42; DNRC o-
                Gur Hfrarg unf orpbzr fb shyy bs penc gurfr qnlf, abbar rira
                erpbtavmrf fvzcyr guvatf yvxr ebg13 nalzber. Fnq, vfa'g vg?

                Comment

                Working...