This might be a really easy one but I couldn’t seem to find an answer anywhere
I’m trying to comment my code as follows
Session("test") = "JAMIE" _
'TEST INFO
& "TEST" _
'ADDRESS INFO
& "ADDRESS = TEST"
With the code above i’m getting the error
Syntax error
But when I remove the comments like so
Session("test") = "JAMIE" _
& "TEST" _
& "ADDRESS = TEST"
It works fine so my guess is that I cannot comment my code between the _ character.
Is there some way I can get around this as I’d like to comment my code ideally
The
_character is the line continuation. It means that the next line is interpreted as if it was on the same line.So, putting a comment in the middle of the line is a syntax error.
Since you want a solution:
As Tim Schmelter points out in his answer, you can construct the value that will go into the
Sessionobject before you put it into theSessionobject – you can do that is separate statements and comment those to your hearts content.