Posts: 64
Threads: 9
Joined: Dec 2004
Hi guys
I noticed in CodeView that the program steps through every case untill it gets to the case number targetted.
When it has executed the code in that case, it jumps straight to End Select.
Some of my code has lots of routines, each with Select Case 1 of 20 or more. A bit like a PLC program that has to do things in a particular order.
As these routines get called in an endless loop, a lot of time appears to be wasted in this "case stepping".
Has anybody any suggestions on eliminating or reducing time lost.
t is the End result that matters, not the Tools used to get there.
Posts: 544
Threads: 27
Joined: Jan 2005
With such a general description, I think that the only suggestion that I can give is: if there is a preference, or more frequent use of some of the cases, put those first.
Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Posts: 64
Threads: 9
Joined: Dec 2004
Ralph
Not really an option.
Each time I complete a task, the "Case Nr" is incremented.
The next time it comes to this Routine , Select Case selects the next step in the sequence.
Regards
t is the End result that matters, not the Tools used to get there.
Posts: 544
Threads: 27
Joined: Jan 2005
If your program knows the next case number, then, instead of a CASE, I woud use a LABEL, say the case number, and just use a GOTO. That would seem to be the only logical approach to your problem.
Ralph, using QuickBASIC 4.5 and Windows XP Home Edition and Service Pack 2, with HP LaserJet 4L printer.
Posts: 64
Threads: 9
Joined: Dec 2004
Oh the KISS principle .
Not so simple.
How do you save and call/goto the new label.
I think this has been on the wish list for a long time.
Being able to call or jump to a routine using either a string or a number.
I am toiling with the idea, that if I use the .map file to identify a label or routine,
then I can write an asm routine that jumps to that address.
But I suspect I an only do this within a subroutine, thereby leaving basic's calling stack intact.
Like make a asm function called JUMP
then
JUMP Label19
t is the End result that matters, not the Tools used to get there.
Posts: 64
Threads: 9
Joined: Dec 2004
Unfortunately the extensive testing I have done with FB in Dos
has proven that FB is not faster then pds7.1 in my experience.
Sofar I have managed to create the JUMPTO asm routine, but
need to work out how to save the labels for the asm call.\
JUMPTO Label1
Will keep you posted.
t is the End result that matters, not the Tools used to get there.
Posts: 961
Threads: 81
Joined: Apr 2005
No offence, but FB is still in development, and as far as I can tell, it's far bigger than PDS.
However, the problem with save and GOTO can be solved using GOSUB / RETURN ...
Screwing with your reality since 1998.
Posts: 64
Threads: 9
Joined: Dec 2004
Quote:using that func ptr example vs select case in PDS
Absolutely with that function.
But I have already worn out my welcome on that subject, so
I wont go there.
t is the End result that matters, not the Tools used to get there.