Advertisement
Guest User

Untitled

a guest
May 23rd, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. Dim a, b As String
  2. a = ""
  3. b = Nothing
  4. If a = b Then ' this will NOT throw an error even though B is nothing
  5. Debug.WriteLine("same")
  6. Else
  7. Debug.WriteLine("different")
  8. End If
  9. If a.Length > 0 Then
  10. Debug.WriteLine("string a has a length")
  11. End If
  12. If b.Length > 0 Then ' this will throw an error because the object is nothing
  13. Debug.WriteLine("string b has a length")
  14. End If
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement