Let's take a look at an example:
| The code is as follows |
Copy Code |
|
<%
If fun1 () and fun2 () Then
Response.Write ("Yes" & "<br/>")
Else
Response.Write ("No" & "<br/>")
End If
Function fun1 ()
Response.Write ("Fun1" & "<br/>")
FUN1 = False
End Function
Function fun2 ()
Response.Write ("Fun2" & "<br/>")
Fun2 = True
End Function
%> |
According to the figure above, FUN1 returns False when it also calls Fun2 (C # and other languages have done optimizations do not invoke fun2), so when the current expression has a relationship with the top of the writing program may be wrong:
| The code is as follows |
Copy Code |
|
<%
Dim number:number = "mzwu.com"
If IsNumeric (number) and Instr (number, ".") =0 and CInt (number) >=10 Then
Response.Write ("Yes")
Else
Response.Write ("No")
End If
%> |
The first two expressions are used to determine that number is an integer, but CInt is still called, it is really maddening, there is no way, by design, change to if nested structure can be resolved:
| The code is as follows |
Copy Code |
|
<%
Dim number:number = "mzwu.com"
If IsNumeric (number) and Instr (number, ".") =0 Then
If CInt (number) >=10 Then
Response.Write ("Yes")
Else
Response.Write ("No")
End If
Else
Response.Write ("No")
End If
%> |
Other operators also have the same problem, the program code to write must pay attention to.