473,320 Members | 1,961 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to span function call params across multiple lines?

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

Feb 19 '07 #1
14 4780
On Feb 19, 3:59 pm, sean.gilbert...@gmail.com wrote:
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")
Feb 19 '07 #2
se*************@gmail.com wrote in news:1171922389.523507.309510
@j27g2000cwj.googlegroups.com:
SomeSubOrFuncCall("param 1", _
"param 2", _
"param 3")

Use the underscore/

Feb 19 '07 #3
<se*************@gmail.comschrieb
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.

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

HTH

Martin

<se*************@gmail.comwrote in message
news:11**********************@j27g2000cwj.googlegr oups.com...
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

Feb 19 '07 #5
On Feb 19, 3:59 pm, sean.gilbert...@gmail.com wrote:
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

Feb 19 '07 #6
<se*************@gmail.comschrieb:
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.
Use space-underscore at the end of the line:

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

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Feb 20 '07 #7
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

"Herfried K. Wagner [MVP]" <hi***************@gmx.atschreef in bericht
news:uu*************@TK2MSFTNGP05.phx.gbl...
<se*************@gmail.comschrieb:
>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.

Use space-underscore at the end of the line:

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

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

Feb 20 '07 #8
"Cor Ligthert [MVP]" <no************@planet.nlschrieb:
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.

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

Feb 20 '07 #9
OK,

Discussion :-)

What is in your opinion the advantage from that?

Cor

"Herfried K. Wagner [MVP]" <hi***************@gmx.atschreef in bericht
news:u0*************@TK2MSFTNGP04.phx.gbl...
"Cor Ligthert [MVP]" <no************@planet.nlschrieb:
>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.

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

Feb 20 '07 #10
"Cor Ligthert [MVP]" <no************@planet.nlschrieb:
OK,

Discussion :-)

What is in your opinion the advantage from that?
Readability.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Feb 20 '07 #11
\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

"Herfried K. Wagner [MVP]" <hi***************@gmx.atschreef in bericht
news:%2***************@TK2MSFTNGP04.phx.gbl...
"Cor Ligthert [MVP]" <no************@planet.nlschrieb:
>OK,

Discussion :-)

What is in your opinion the advantage from that?

Readability.

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

Feb 20 '07 #12
Cor Ligthert [MVP] wrote:
\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.
There /is/ more - the closing bracket. :-)

Confusing? Perhaps, but it makes it easier to manipulate the number of
arguments as [and when] you add or remove them. It's far easier to add
and remove entire lines than to fiddle about in the middle of them,
especially if said line is four times wider than your screen.

Also, I think Herfried's example is oversimplified - I frequently find
that each argument to a method can /itself/ span much of a page, so
separating each into its own line adds to the clarity.

Note: I /don't/ do this for /every/ function call!
Typically, I'll break it down as above as soon as the [single] line
starts nearing the edge of my code window.

Regards,
Phill W.
Feb 22 '07 #13
"Phill W." <p-.-a-.-w-a-r-d-@-o-p-e-n-.-a-c-.-u-kschrieb:
>\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.

There /is/ more - the closing bracket. :-)

Confusing? Perhaps, but it makes it easier to manipulate the number of
arguments as [and when] you add or remove them. It's far easier to add
and remove entire lines than to fiddle about in the middle of them,
especially if said line is four times wider than your screen.

Also, I think Herfried's example is oversimplified - I frequently find
that each argument to a method can /itself/ span much of a page, so
separating each into its own line adds to the clarity.
That's true. In this cases I nest multi-line calls (again a simple
example):

\\\
Bla( _
Param1, _
Foo( _
Param1, _
Param2 _
), _
Param3 _
)
///
Note: I /don't/ do this for /every/ function call!
Typically, I'll break it down as above as soon as the [single] line starts
nearing the edge of my code window.
That's how I am doing it too.

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

Feb 22 '07 #14
\\\
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

Feb 22 '07 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Stephen Boulet | last post by:
I've run across code like "myfunction(x, *someargs, **someotherargs)", but haven't seen documentation for this. Can someone fill me in on what the leading * and ** do? Thanks. Stephen
3
by: Bryan Parkoff | last post by:
Do C/C++ Compiler allow function to contain more than 8 parameters? I checked MS Visual C++ 6.0 that it can only limit 8 parameters, but most C/C++ Compiler can limit maximum 256 parameters. Can...
6
by: hsomob1999 | last post by:
so i have a <ul> and I allow the user to append items to it. The problem is that on mozilla the <span class="line"> which is just a line to divide the sections gets overlaped and doesnt move down...
1
by: dan.roffman | last post by:
Is there a way to span a report over multiple pages. I think you could do something like count the number of lines and if it exceeds a certain number, then put the rest of th text into another RTF...
2
by: Tobias Olbort | last post by:
Hello, i've a outer function, which takes a params-array as a parameter. I want to pass this array to inner function with a params-array (e. g. string.format). When i've passed an integer to...
4
by: Michael Yanowitz | last post by:
I am still new to Python but have used it for the last 2+ months. One thing I'm still not used to is that functions parameters can't change as expected. For example in C, I can have status =...
7
by: sfeher | last post by:
Hi All, Is there a way to preserve the arguments across functions? I have: <script> function myFirstFunction() { // arguments = 'param1'
4
by: simon | last post by:
hi, I would like to separate my javascript completely from my xhtml. in the end there should be only <script type="text/javascript" src="javalib.js"></script> in the head-tag to my javascript....
7
by: =?Utf-8?B?TG9zdEluTUQ=?= | last post by:
Hi All :) I'm converting VB6 using True DBGrid Pro 8.0 to VB2005 using DataGridView. True DBGrid has a MultipleLines property that controls whether individual records span multiple lines. Is...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.