Is it possible to assign a value to a class variable from inside a #IF DEBUG
conditional?
I want to conditionally execute some code from inside my main form load if I am running in DEBUG
mode. I thought I could do something like:
Public Class Form1 public DEB as Integer #if DEBUG then DEB = 1 #else DEB = 0 #end if Private Sub Form1_Load(....) if DEB=1 Then <do something> else <do something else> end if ....
However, it seems like you can't assign a value to a variable. I'm obviously not understanding the scoping correctly. I can't seem to put the #if DEBUG
inside the Load sub routine. How do I do this?
Use a semicolon to replace a period between related sentences when the second sentence starts with either a conjunctive adverb or a transitional expression, such as for example, for instance, that is, besides, accordingly, furthermore, otherwise, however, thus, therefore.
A semicolon may be used between independent clauses joined by a connector, such as and, but, or, nor, etc., when one or more commas appear in the first clause. Example: When I finish here, and I will soon, I'll be glad to help you; and that is a promise I will keep.
When a comma separates two complete sentences joined by a conjunction (and, but, or, nor, for, so, or yet) the comma and the conjunction can be replaced with a semicolon. I ate dinner, and I went to the movies. = I ate dinner; I went to the movies.
Use dashes to mark the beginning and end of a series, which might otherwise get confused, with the rest of the sentence: Example: The three female characters—the wife, the nun, and the jockey—are the incarnation of excellence. Dashes are also used to mark the interruption of a sentence in dialogue: Example: “Help!
Why not just test the compilation constant directly? You are not gaining anything by testing an actual variable.
Public Class Form1 Private Sub Form1_Load(....) #if DEBUG then <do something> #else <do something else> #end if End Sub End Class
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With