shortcut

  • Thread starter Thread starter vinnie
  • Start date Start date
V

vinnie

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

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

Thanks

Create a keyboard macro. Tools->Options
 
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
 
create a private method like this C#

w(string stringToWriteline)
{
System.Console.Writeline(stringToWriteline);
}

then use it like this.

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

Lit
 
Mark_Parker said:
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?
 
Mark_Parker said:
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.WriteLine(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?
 
cw <tab><tab> is the shortcut ;)



vinnie wrote:

shortcut
07-Sep-07

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

Thanks

Previous Posts In This Thread:

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

Thanks

Re: shortcut
Create a keyboard macro. Tools->Options

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

:

RE: shortcut
code snipper to the rescue
"cw" + tab

http://msdn2.microsoft.com/en-us/library/z41h7fat(VS.80).aspx
http://ceiled.spaces.live.com/blog/cns!FDEE70107FF2676B!126.entry

- Rakesh

:

create a private method like this C#w(string stringToWriteline){ System.
create a private method like this C#

w(string stringToWriteline)
{
System.Console.Writeline(stringToWriteline);
}

then use it like this.

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

Lit

Re: shortcut

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?

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

:

Re: shortcut

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.WriteLine(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?


Submitted via EggHeadCafe - Software Developer Portal of Choice
Getting PC information
http://www.eggheadcafe.com/tutorial...8c65-58b133610606/getting-pc-information.aspx
 
Back
Top