We Recommend

ASP.NET 3.5 Unleashed ASP.NET 3.5 Unleashed
ASP.NET 3.5 Unleashed is the most comprehensive book available on the Microsoft ASP.NET 3.5 Framework, covering all aspects of the ASP.NET 3.5 Framework--no matter how advanced.


Posted By

krisdb on 04/17/07


Tagged

ASP


Versions (?)


IsInArray


Published in: ASP 


  1. 'accepts: value, array, convert values to integers (if passing in numbers)
  2. 'returns: boolean, if value is in array
  3. function IsInArray(value,string,bCint)
  4. IsInArray = false
  5.  
  6. dim arr: arr = split(string,",")
  7.  
  8. if isArray(arr) then
  9. dim iArr,arr2
  10. for iArr = 0 to ubound(arr)
  11.  
  12. if (bCint = 1) then
  13. value = cint(value)
  14. arr2 = cint(arr(iArr))
  15. else
  16. arr2 = arr(iArr)
  17. end if
  18.  
  19. if (value = arr2) then
  20. IsInArray = true
  21. exit function
  22. end if
  23.  
  24. next
  25. end if
  26. end function

Report this snippet 

You need to login to post a comment.