You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Regardless of the outcome of any evaluation, all expressions are evaluated using `Option Compare Binary`. The `Option Compare` statement does not affect expressions in `#If` and `#ElseIf` statements.
64
62
65
63
> [!NOTE]
66
-
> No single-line form of the `#If`, `#Else`, `#ElseIf`, and `#End If` directives exists. No other code can appear on the same line as any of the directives.
67
-
68
-
## Example
64
+
> No single-line form of the `#If`, `#Else`, `#ElseIf`, and `#End If` directives exists. No other code can appear on the same line as any of the directives.
65
+
66
+
The statements within a conditional compilation block must be complete logical statements. For example, you cannot conditionally compile only the attributes of a function, but you can conditionally declare the function along with its attributes:
67
+
68
+
```vb
69
+
#IfDEBUGThen
70
+
<WebMethod()>
71
+
PublicFunctionSomeFunction()AsString
72
+
#Else
73
+
<WebMethod(CacheDuration:=86400)>
74
+
PublicFunctionSomeFunction()AsString
75
+
#EndIf
76
+
```
77
+
78
+
## Example
69
79
This example uses the `#If...Then...#Else` construct to determine whether to compile certain statements.
0 commit comments