Re: How big is the number of Case expression-n in RealBasic?
|
Helen Deol |
|
5/4/2008 11:30:30 PM |
Hesus, That's not a limit on the number of case statements; that's a bug in the compiler, which is choking on the sheer, astonishing size of that method. Please file a bug report - and then please, for your own sake, find some way of solving your problem that doesn't require you to put thousands of lines of code in a single method. Helen. Post Comments |
|
Re: Thank you for the reply
|
Hesus Oliver Pecce |
|
5/4/2008 11:33:34 PM |
Helen, Thank you for the reply.
My work around is to just break up my code into a few Methods. Post Comments |
|
Re: How big is the number of Case expression-n in RealBasic?
|
Poutt Keitis |
|
5/4/2008 11:35:38 PM |
That's not really a brilliant workaround. If you've got that many possibilities, you sh ould consider putting the values into a file and reading them at runtime. Then you can process them using an if statement inside a loop while giving user-feedback. Post Comments |
|
Re: How big is the number of Case expression-n in RealBasic?
|
Potthaccio Vaavaacione |
|
5/4/2008 11:39:46 PM |
Hello Hesus, Use a Dictionary -- since it hashes values, the lookup is much faster than the method call overhead or file I/O. Post Comments |
|
Ah! That's a much better idea - forget what I said.
Post Comments |
|
Re: How big is the number of Case expression-n in RealBasic?
|
Konjanja Takeuchi |
|
5/4/2008 11:48:50 PM |
Hesus, Another idea: if the different cases are all integers, and they're sequential, you might even consider an array.
Post Comments |
|
Re: i agreed..but dictinary is better
|
Hesus Oliver Pecce |
|
5/4/2008 11:52:10 PM |
Oh, Konjanja, i agreed, it might not be the best way.
I like the Dictionary idea.
Thank you for everyones input. Post Comments |
|
Re: How big is the number of Case expression-n in RealBasic?
|
Raphaelin Mantein |
|
5/4/2008 11:55:36 PM |
As a rule of thumb, whenever you find yourself using many Select Case statements, you're probably not taking advantage of Object Oriented programming. Try replacing the Select Case with classes and subclasses. This may not apply to your method, but is a good general rule anyway. Post Comments |
|