Wednesday, September 7, 2011

AndAlso, OrAlso

if x = 5 And y = 7 
Checks if x is equal to 5, and if y is equal to 7, then continues if both are true. แต่ถ้าใช้ AndAlso
if x = 5 AndAlso y = 7 
Checks if x is equal to 5. If it's not, it doesn't check if y is 7, because it knows that the condition is false already. (This is called short-circuiting) จะทำให้เร็วขึ้น

No comments:

Post a Comment