Doriano Blengino ha scritto: > Dimitris Anogiatis ha scritto: > >> Vassili, >> >> Glad to hear that it's working for you :) >> >> > I join - congratulations! > > The only pity is to have such an awful case statement, when 5 or 6 lines > of code would do the same job. That SELECT it is not much faster, > because it compares case by case until it finds a match, and then exits. > For this purpose, I forget to put a return in my subroutine just after > the match (when the test is true). Doing so, I bet the speed is comparable. > I forgot again...
if speed is really important, you can "cache" the results from the routine, ie create an array of labels, and assign them once using either methods (select or loop). Then you use the database value as an index in the array, and obtain in just one instruction the reference for the label. About 50 times faster... Hope it is clear. Best regards, -- Doriano Blengino "Listen twice before you speak. This is why we have two ears, but only one mouth." ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user