Re: Problem writing code to go to a label after calling a procedure
- From: erewhon@xxxxxxxxxx (J French)
- Date: Sun, 27 Nov 2005 14:58:22 +0000 (UTC)
On Mon, 28 Nov 2005 02:38:22 +1300, Brian <bclark@xxxxxxxx> wrote:
<snip>
>Thanks for the advice J French.
>The Quickbasic code looks like a game of snakes and ladders with all
>it's 'goto' commands. I know a good program structure avoids many goto
>commands in the code. There are 'goto' commands in the subroutines
>that jump to a line number outside the number range for the
>subroutine, this is somthing I found that Visual Basic can't do.
I know, that little Lulu is crazy,
- when I found it about 18 years ago, I swore not to use it
>The other problem is that there is a jump (goto) to a line number
>within a subroutine from outside of the subroutine.
That is pretty easy to tackle, you just Exit Sub from the procedure
with a flag (preferably an Enum) set up that tells the control
procedure where to send control
>I might find some examples of Visual Basic code for complete programs
>on the internet which I could study.
The thing is that with VB one can write old style code, which will
work just fine, or write a different type of code that a lot of VB
programmers do not realize can be done.
I have a suspicion that you did not write the original code that you
are trying to port, and thus have two problems
- if that is so a functional re-write is far quicker
I've converted shed loads of DOS BASIC code to VB, and other
languages, it is seldom a problem, provided one understands what it is
doing.
Sometimes the last programmer was a cretin ( like me 15 years ago ) so
you rip out his code and re-write it, sometimes it is Ctl V and the
odd tweak ... and you are off.
If it is someone elses code then re-write it anyway
- just as a matter of principle
.
- Follow-Ups:
- References:
- Problem writing code to go to a label after calling a procedure
- From: Brian
- Re: Problem writing code to go to a label after calling a procedure
- From: Bill Plenge
- Re: Problem writing code to go to a label after calling a procedure
- From: Brian
- Re: Problem writing code to go to a label after calling a procedure
- From: J French
- Re: Problem writing code to go to a label after calling a procedure
- From: Brian
- Problem writing code to go to a label after calling a procedure
- Prev by Date: Re: A Picture with a ComboBox
- Next by Date: Re: A Picture with a ComboBox
- Previous by thread: Re: Problem writing code to go to a label after calling a procedure
- Next by thread: Re: Problem writing code to go to a label after calling a procedure
- Index(es):