Solved

what does the # mean in front of a line is it a comment??

Posted on 2006-11-11
4
209 Views
Last Modified: 2010-04-23
i have a program im useing and it has # in front of the lines

the lines are pulled all the way to the left and not in structured as the others are

is this a sort of comment line and does not do anything inside to the next # line ie

# if this = that then
print to screen and move on
# end if

the lines are simmaler to the above (and i have found it does not do the instructions in the middle of the # lines too

is this the case it does not run the block??

thanks for enlightenment here
0
Comment
Question by:Johnny
  • 2
4 Comments
 
LVL 29

Expert Comment

by:Nightman
ID: 17921069
the #If...Then...#Else directives evaluate what is compiled by the compiler and not at run time.

Conditional compilation is typically used to compile the same program for different platforms. It is also used to prevent debugging code from appearing in an executable file. Code excluded during conditional compilation is completely omitted from the final executable file, so it has no effect on size or performance.
0
 
LVL 29

Assisted Solution

by:Nightman
Nightman earned 250 total points
ID: 17921089
You can set conditional compilation constants in one of three ways:

1. In the Property Pages dialog box of the project (see constants under the BUILD menu)
2. At the command line when using the command-line compiler
3. In your code

Have a look at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcn7/html/vacondeclaringconditionalcompilationconstants.asp
0
 
LVL 10

Accepted Solution

by:
Kinger247 earned 250 total points
ID: 17921097
They are compiler conditional statements.

If the if statement is true, then the code between the condition is inlcuded the build.

So, for example the below code would only include the messagebox "I'm in debug" if the current ide is set to debug.
Otherwise its set to "I'm in release"

#If DEBUG Then
  MessageBox.Show("I'm in debug")
#Else
  MessageBox.Show("I'm in release")
#End If

You can also do this on procedures etc to.
The below code would opnly allow the RunME procedure to run if the InTestMode is true. Otherwise, all calls to the procedure will not function.

Public Class Form1
  #Const InTestMode = True

  Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    RunME()
  End Sub

  <Conditional("InTestMode")> Public Sub RunME()
    MessageBox.Show("InTestMode")
  End Sub
End Class
0
 

Author Comment

by:Johnny
ID: 17921113
oh hey thats neet ... thanks i thought i maybe a comment as php and others do...

thanks allot
now let me think on how to award the points....
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now