Re: comment out a large portion of codes

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Mythran,
| That won't work exactly how comments work. For example, anything in the
#IF
| ... #END IF directives must be compilable code. You can't have any syntax
| errors in the code.

Odd! ;-) I've used #IF False on blocks of code that have syntax errors.

For example the following block contains a syntax error (3.7x is not a valid
literal). It compiles under VB.NET 2003.

Public Sub Main()
Dim s As Single
#If False Then
s = 3.7x
#End If

End Sub

I would expect it to compile as #if is one of the Conditional Compilation
statements.

Are there specific syntax errors that you have used that cause the above not
to work?

Hope this helps
Jay

"Mythran" <kip_potter@xxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:eQOaZxskFHA.1464@xxxxxxxxxxxxxxxxxxxxxxx
|
| "AMercer" <AMercer@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
| news:AC3F9263-7FA8-4B6B-8CC9-CA342617BEF1@xxxxxxxxxxxxxxxx
| > #If False Then
| > < the code you want to comment out goes here>
| > #End If
| >
| >> Does anyone know if there is a way to get VB.net to let me comment out
a
| >> large portion of codes? Like in C/C++, I was able to comment out using
| >> /*
| >> ..... */ I think there is something to do with "Define Debug Constant
=
| >> 1"
| >> but I am not sure how it works. thanks.
|
| That won't work exactly how comments work. For example, anything in the
#IF
| ... #END IF directives must be compilable code. You can't have any syntax
| errors in the code.
|
| HTH,
| Mythran
|


.



Relevant Pages

  • Re: Using C Code from Code Composer Studio in Simulink
    ... SRC_PATH like that to the path dialog of s-function builder. ... But too many syntax errors are found in the header files. ... I've got C code which compiles fine using Code Composer Studio ... working from within a Simulink model. ...
    (comp.soft-sys.matlab)
  • Re: What is the proper way to declare an stl stack.
    ... this compiles fine with microsoft's compiler. ... It gives enough warnings though ... > I get warnings and a syntax errors about deque ...
    (comp.lang.cpp)
  • Re: client
    ... Make sure your code at least compiles to the point you can figure out ... how to fix any more syntax errors before posting it. ...
    (comp.lang.java.help)
  • Re: What is the proper way to declare an stl stack.
    ... > JustSomeGuy wrote: ... > this compiles fine with microsoft's compiler. ... >> I get warnings and a syntax errors about deque ...
    (comp.lang.cpp)
  • Re: COBOL "non-myth" confirmed - Index and subscripts (MF on Windows)
    ... all know IBM can handle. ... try compiling it with the directives listed above and see what happens. ... the '02 Standard), then can you re-post it - as I don't seem to have it in my ... Therefore, as I say, once you produce code that compiles ...
    (comp.lang.cobol)