spanga Posted January 7, 2007 Share Posted January 7, 2007 Hello. Is there any performance difference at all between my two examples. When you got more like 50 cases instead of 2. Ex 1. CODEIf StringInStr($number,"!02") > 0 THEN Return 3 If StringInStr($number,"?10") > 0 THEN Return 3 Ex 2. CODEIf StringInStr($number,"!02") > 0 OR StringInStr($number,"?10") > 0 THEN Return 3 Link to comment Share on other sites More sharing options...
herewasplato Posted January 7, 2007 Share Posted January 7, 2007 Measure it using the code at the bottom of the TimerDiff page in the help file. I would use the code from your first example for ease of read. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
xcal Posted January 7, 2007 Share Posted January 7, 2007 What about sticking the conditions in an array and looping through them? How To Ask Questions The Smart Way Link to comment Share on other sites More sharing options...
Psibernetic Posted January 7, 2007 Share Posted January 7, 2007 Select & Case commands are your friend [sup]Psibernetic[/sup]My Creations:X-HideSecuracy Link to comment Share on other sites More sharing options...
spanga Posted January 8, 2007 Author Share Posted January 8, 2007 Select & Case commands are your friendSure they are, but I'm only interested in the perfomance - you say it's faster than any of the examples? Link to comment Share on other sites More sharing options...
herewasplato Posted January 9, 2007 Share Posted January 9, 2007 Sure they are, but I'm only interested in the perfomance - you say it's faster than any of the examples?Did you measure them using sample code like you posted? You would have had your answer by now. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now