Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Minimal Min & Max Functions
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Podge
Support Moderator

Ireland
3776 Posts

Posted - 31 August 2007 :  13:37:43  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
Recently I wrote these functions
Function Min(a, b)
	if a > b then 
		Min = b
	else 
		Min = a
	end if
end function

Function Max(a, b)
	if a > b then 
		Max = a
	else 
		Max = b
	end if
end function
but soon realised that they could be shorter
Function Min(a, b)
	Min=a:if a>b then Min=b
end function

Function Max(a, b)
	Max=a:if b>a then Max=b
end function


Thats 23 characters including spaces for the middle line of each function (excluding the outer Function() and End Function lines.

Can you do better? No prize, just the glory of being the best.

Must be in vb.
Functions must be named Min and Max.

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.

Edited by - Podge on 31 August 2007 13:38:34
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.41 seconds. Powered By: Snitz Forums 2000 Version 3.4.07