Code Snippets

  

ASP Source Code


Welcome to Dream.In.Code
Getting Help is Easy!

Join 131,953 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,952 people online right now. Registration is fast and FREE... Join Now!





Some "missing" logic functions

Logic functions that should have been in VB and ASP, but were not.

Submitted By: Chubber
Actions:
Rating:
Views: 429

Language: ASP

Last Modified: June 12, 2007

Snippet


  1. Function IIf(TheBoolean, TruePart, FalsePart)
  2. If TheBoolean Then
  3.      IIf = TruePart
  4. Else
  5.      IIf = FalsePart
  6. End If
  7. End Function
  8. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  9. Function Min(One, Two)
  10. If One > Two Then
  11.      Min = Two
  12. Else
  13.      Min = One
  14. End If
  15. End Function
  16. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  17. Function Max(One, Two)
  18. If One < Two Then
  19.      Max = Two
  20. Else
  21.      Max = One
  22. End If
  23. End Function
  24. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  25. Function Floor(InVal)
  26.      If InVal > 0 Then
  27.           Floor = Int(InVal)
  28.      Else
  29.           Floor = Int(InVal) - 1
  30.      End If
  31. End Function

Copy & Paste


Comments


There are currently no comments for this snippet. Be the first to comment!

Add comment


You must be registered and logged on to </dream.in.code> to leave comments.





Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month