Click here to Skip to main content
15,917,061 members
Home / Discussions / C#
   

C#

 
GeneralOwnerdrawn StatusBarPanel Pin
monrobot1316-Apr-03 5:48
monrobot1316-Apr-03 5:48 
GeneralRe: Ownerdrawn StatusBarPanel Pin
Alex Korchemniy16-Apr-03 5:55
Alex Korchemniy16-Apr-03 5:55 
GeneralArgument-substitution vs Concatenation Pin
Alvaro Mendez16-Apr-03 4:37
Alvaro Mendez16-Apr-03 4:37 
GeneralRe: Argument-substitution vs Concatenation Pin
Alex Korchemniy16-Apr-03 5:54
Alex Korchemniy16-Apr-03 5:54 
GeneralRe: Argument-substitution vs Concatenation Pin
James T. Johnson16-Apr-03 7:00
James T. Johnson16-Apr-03 7:00 
Alvaro Mendez wrote:
I'd like to get some opinions on the pros and cons of each approach.

By using the argument substitution you can add additional formatting to the WriteLine call (such as pad numbers or strings) which you may or may not be able to do the other way, depending on how the ToString method is written for each variable's type.

Another advantage is if you are localizing your application you only have one string to replace instead of 2 for your example.

As you point out the con is that you aren't placing the variable right there so you need to reference back and forth to get the whole picture.

Alvaro Mendez wrote:
as Debug.WriteLine and Trace.WriteLine

A shame too, I find myself having to do: string.Format inside of the WriteLine method Frown | :(

James

"It is self repeating, of unknown pattern"
Data - Star Trek: The Next Generation

GeneralRe: Argument-substitution vs Concatenation Pin
Paul Ingles16-Apr-03 7:56
Paul Ingles16-Apr-03 7:56 
GeneralRe: Argument-substitution vs Concatenation Pin
Adam Turner16-Apr-03 12:42
Adam Turner16-Apr-03 12:42 
GeneralRe: Argument-substitution vs Concatenation Pin
leppie16-Apr-03 12:54
leppie16-Apr-03 12:54 
GeneralDateTime Operation Pin
Mazdak16-Apr-03 3:52
Mazdak16-Apr-03 3:52 
GeneralRe: DateTime Operation Pin
Jim Stewart16-Apr-03 4:21
Jim Stewart16-Apr-03 4:21 
GeneralRe: DateTime Operation Pin
Mazdak16-Apr-03 4:42
Mazdak16-Apr-03 4:42 
GeneralLoad File Pin
Mazdak16-Apr-03 2:48
Mazdak16-Apr-03 2:48 
GeneralRe: Load File Pin
Chris Austin16-Apr-03 5:19
Chris Austin16-Apr-03 5:19 
GeneralRe: Load File Pin
Mazdak16-Apr-03 8:15
Mazdak16-Apr-03 8:15 
GeneralCheck if a windows service is installed Pin
AndyLatham16-Apr-03 2:20
AndyLatham16-Apr-03 2:20 
GeneralRe: Check if a windows service is installed Pin
Mazdak16-Apr-03 2:52
Mazdak16-Apr-03 2:52 
GeneralRe: Check if a windows service is installed Pin
AndyLatham16-Apr-03 4:06
AndyLatham16-Apr-03 4:06 
GeneralRe: Check if a windows service is installed Pin
Mazdak16-Apr-03 4:42
Mazdak16-Apr-03 4:42 
GeneralRe: Check if a windows service is installed Pin
AndyLatham16-Apr-03 5:04
AndyLatham16-Apr-03 5:04 
GeneralRe: Check if a windows service is installed Pin
sludgenz29-Oct-08 16:22
sludgenz29-Oct-08 16:22 
GeneralRe: Check if a windows service is installed Pin
AnnDunbar19-Jan-09 4:55
AnnDunbar19-Jan-09 4:55 
GeneralTerminate C# app at system shutdown Pin
pahlsson15-Apr-03 22:19
pahlsson15-Apr-03 22:19 
GeneralRe: Terminate C# app at system shutdown Pin
perlmunger16-Apr-03 6:07
perlmunger16-Apr-03 6:07 
GeneralRe: Terminate C# app at system shutdown Pin
pahlsson16-Apr-03 6:10
pahlsson16-Apr-03 6:10 
GeneralRe: Terminate C# app at system shutdown Pin
perlmunger16-Apr-03 6:56
perlmunger16-Apr-03 6:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.