-
June 26th, 2012, 01:05 PM
#1
How to comment on a line at runtime
Is there a way one can comment on a line of code at runtime. I want the line to be skipped at some at some points in the program, when certain conditions are met.
Thank you.
-
June 26th, 2012, 07:02 PM
#2
Re: How to comment on a line at runtime
Hmmm... Isn't that what an If statement is for?
I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.
This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.
-
June 27th, 2012, 01:37 AM
#3
Re: How to comment on a line at runtime
You can't comment a line during run time. You are speaking of conditions, well, as Eri523 said, you need to use an If Statement. Otherwise you should look into debugging which provides tools such as Step Over (which skips some lines of code ) and Step Into ( which goes to the next line(s) ).
If you provide more details on what you want to achieve, we coulkd help better
-
June 27th, 2012, 08:48 AM
#4
Re: How to comment on a line at runtime
Originally Posted by Ucheske
Is there a way one can comment on a line of code at runtime. I want the line to be skipped at some at some points in the program, when certain conditions are met.
I'm sure you comment a line so as to skip it if certain conditions aren't met but thats what If Then is for.
You could put a BreakPoint in the code so when your apps gets to that line of code it will stop. You can look at the code window and move through the code by pressing the F8 button that will slip through a line at a time. You can look at the code window and hold your mouse over any variable and if will show its value.
I've been programming with VB for 17 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.
Martin2k
-
June 27th, 2012, 11:27 AM
#5
Re: How to comment on a line at runtime
No you can not comment a line of code at runtime, and no you can not make a comment do anything other than display a comment in the editor. Comments are completely ignored at run time and do not exist in the exe.
As stated by others this is what the If Then is for.
Comments are simply used to make the code easier to understand.
And if you actually meant to say Comment out a line at runtime then no you can not do that either.
Last edited by DataMiser; June 27th, 2012 at 11:29 AM.
Always use [code][/code] tags when posting code.
-
June 27th, 2012, 11:01 PM
#6
Re: How to comment on a line at runtime
That's what Debug.Print does. Prints to the output window ONLY when you run in DEBUG mode.
-
June 28th, 2012, 02:15 PM
#7
Re: How to comment on a line at runtime
I'm not sure what debug.print would have to do with it ?
Always use [code][/code] tags when posting code.
-
June 28th, 2012, 03:46 PM
#8
Re: How to comment on a line at runtime
tells you WHICH variable to monitor at various stages of your application
-
June 28th, 2012, 03:54 PM
#9
Re: How to comment on a line at runtime
I figured out what you were referring to after I posted, I just did not think that is what the OP was referring to. Seems like the intent was to either add a comment to the code at runtime or more likely change a line of code into a comment so it does not execute neither of which are possible.
As others had said it appears that what is need is a IF Then block
Always use [code][/code] tags when posting code.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|