Why does vb reject this character when I use it to break a line up? I am not using it within a string expression.
Any help would be appreciated.
Printable View
Why does vb reject this character when I use it to break a line up? I am not using it within a string expression.
Any help would be appreciated.
If you use the '_' always make sure a space preceed it.
:cool:Code:
Str = "The cat sat" & _
" on the mat"
If Text1.Text = vbNullString _
Then
'do something
End If
?
Try this:
Code:MsgBox "Hellooooooh" _
, , "is it not working?"
I do ensure there is a space before the '_' character, it still refuses to work right. If I remove the '_' character, then the program works without a problem!
Is this a VB Quirk or is it just taking the day off seeing its Friday?? *lol*
Please post the code lines where you are trying to use the continuation character.
If (Label1.Caption = 7) Or (Label2.Caption = 7) _
or (Label3.Caption = 7) then
Image1.Visible = True
It's looking for an End If. Also you can't compare a lable caption with a number.
adding the underscore puts it all into one line allowing no end ifCode:If (Label1.Caption = "7") Or (Label2.Caption = "7") _ 'add quotes
Or (Label3.Caption = "7") Then _ 'add _ here
Image1.Visible = True
(or just put end if on the line after Image1....)
:)
You cannot have continuation line in quotes.
(Example:
string = "Hello _
World")
But you could have it like:
string = _
"Hello World"