daily pastebin goal
21%
SHARE
TWEET

OMG_I_HATE_VB

jessicakennedy1028 Sep 18th, 2018 102 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     dim var1, var2, var3, var4, var5, var6
  2.  
  3.     var1 = true
  4.     var2 = false
  5.     var3 = "1"
  6.     var4 = "0"
  7.     var5 = "First Name"
  8.     var6 = "Last Name"
  9.     'var7 is not to be Assigned
  10.  
  11.     if var1 then
  12.         response.write("Var1 is recoginized as true<br />" & vbCrLf)
  13.     else
  14.         response.write("Var1 is not recoginized as true<br />" & vbCrLf)
  15.     end if
  16.     ' OUTPUT: Var1 is recoginized as true
  17.  
  18.     if not var2 then
  19.         response.write("Var2 is recoginized as NOT<br />" & vbCrLf)
  20.     elseif var2 = false then
  21.         response.write("Var2 is recoginized as false<br />" & vbCrLf)
  22.     else
  23.         response.write("Var2 is not recoginized as false<br />" & vbCrLf)
  24.     end if
  25.     ' OUTPUT: Var2 is recoginized as NOT
  26.  
  27.     if var1 and var2 then
  28.         response.write("Var1 and Var2 did not match correctly<br />" & vbCrLf)
  29.     elseif var1 and var2 = false then
  30.         response.write("Var1 and Var2 matched correctly<br />" & vbCrLf)
  31.     else
  32.         response.write("What a weird world we live in with Var1 and Var2<br />" & vbCrLf)
  33.     end if
  34.     ' OUTPUT: Var1 and Var2 matched correctly
  35.  
  36.     if var5 = "" then
  37.         response.write("Var5 shows it existed, but doesn't matter what<br />" & vbCrLf)
  38.     else
  39.         response.write("Var5 does exist, but it didn't match.<br />" & vbCrLf)
  40.     end if
  41.     ' OUTPUT: Var5 does exist, but it didn't match
  42.  
  43.     if (var1) and (var5 = "First Name") or (not var2) and (var6 = "Name Last") then
  44.         response.write("Welcome to Classic ASP<br />" & vbCrLf)
  45.     else
  46.         response.write("Var6 should fail<br />" & vbCrLf)
  47.     end if
  48.     'OUTPUT: Welcome to Classic ASP
  49.  
  50.     if var5 then
  51.         response.write("Var5 shows it existed, but doesn't matter what<br />" & vbCrLf)
  52.     else
  53.         response.write("Var5 does exist, but it didn't match.<br />" & vbCrLf)
  54.     end if
  55.     'OUTPUT:
  56.     'Microsoft VBScript runtime error '800a000d'
  57.     'Type mismatch: '[string: "First Name"]'
  58.     '/_PARSYSTEM/assets/playarea.asp, line 44
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top