tags:

views:

133

answers:

4

Which of the following allows more than one statement to appear on a single text Line? a) Colon ( : ) b) Semicolon ( ; ) c) Space + Underscore ( _ ) d) Underscore + space ( _ )

Thanks :)

A: 

Colon. Space + Underscore is used to split a single statement over multiple lines.

Thorarin
A: 

Do you mean what allows a single statement to appear on MORE than one line of text, e.g:

somefunction(param1

          param2

          param3)

If so, the answer is [space][underscore], as:

somefunction(param1 _

          param2 _

          param3)

Hmmm, just had to edit my reply to show newlines, but could only get it correctly formatted by using 2 newlines, but (formatting aside) you get the point.

Brian
+1  A: 

The Visual Basic .NET Language Specification shows that a StatementTerminator is either a LineTerminator (which is a newline or a couple of other choices) or a colon (':').

Greg Hewgill
A: 

The following lines:

IF Value = 10 THEN
    IncrementCounter
    AnotherValue = 42
    YetAnotherValue = "Hello World!"
    CallOtherFunction 24, 28
ENDIF

are equivalent to:

IF Value = 10 THEN IncrementCounter: AnotherValue = 42: YetAnotherValue = "Hello World!": CallOtherFunction 24, 28

(Long line causing a scroll bar to appear is intentional.)

But please don't write code that resembles the second example.

coobird
yes! thank you very much coobird!