How to span function call params across multiple lines?

  • Thread starter Thread starter sean.gilbertson
  • Start date Start date
S

sean.gilbertson

How do I do this in VB.NET?

---------------------------------------------------

SomeSubOrFuncCall("param 1",
"param 2",
"param 3")

---------------------------------------------------

Right now, this is a syntax error. I thought by adding backslashes at
the ends of the lines it would work, but alas it does not.

Thanks :-)
Sean
 
How do I do this in VB.NET?

---------------------------------------------------

SomeSubOrFuncCall("param 1",
"param 2",
"param 3")


SomeSubOrFuncCall("param 1", _
"param 2", _
"param 3")


Armin
 
How do I do this in VB.NET?

---------------------------------------------------

SomeSubOrFuncCall("param 1",
"param 2",
"param 3")

---------------------------------------------------

Right now, this is a syntax error. I thought by adding backslashes at
the ends of the lines it would work, but alas it does not.

Thanks :-)
Sean

SomeSubOrFuncCall("param 1", _
"param 2", _
"param 3")
 
In addition to what others have posted, I found that you need a space before
the underscore for it to work.

HTH

Martin
 
How do I do this in VB.NET?

---------------------------------------------------

SomeSubOrFuncCall("param 1",
"param 2",
"param 3")

---------------------------------------------------

Right now, this is a syntax error. I thought by adding backslashes at
the ends of the lines it would work, but alas it does not.

Thanks :-)
Sean

Thanks everyone!! You SET ME STRAIGHT.

Take care!
Sean
 
How do I do this in VB.NET?

---------------------------------------------------

SomeSubOrFuncCall("param 1",
"param 2",
"param 3")

Use space-underscore at the end of the line:

\\\
SomeSubOrFuncCall( _
"param 1", _
"param 2", _
"param 3" _
)
///
 
Herfried,

I know that you like it in Austria the real ones and this is even a 5times
one, however please set it off.

Cor
 
Cor Ligthert said:
I know that you like it in Austria the real ones and this is even a 5times
one, however please set it off.

I wanted to show my preferred /style/ of formatting longer procedure calls.
 
\> Readability.
\\
SomeSubOrFuncCall( _
"param 1", _
"param 2", _
"param 3" _
)
///

I don't think that it does that for me. Especialy the last blank underscore
which does suggest that there is more is in my idea confusing.

Cor
 
\\\
Bla( _
Param1, _
Foo( _
Param1, _
Param2 _
), _
Param3 _
)
///

I agree with Herfried. Unfortunately VB's autoformatter doesn't work
with _. It left justifies them at first. And then if you mess with
the previous line, it'll push them even further left (yes, it
reformats the line you AREN'T messing with)!

I wish it had extra options, kinda like C# does, for formatting.
Would be cool.

Zytan
 
Back
Top