Re: Problem writing code to go to a label after calling a procedure
- From: Brian <bclark@xxxxxxxx>
- Date: Mon, 28 Nov 2005 02:38:22 +1300
erewhon@xxxxxxxxxx (J French) wrote:
>On Sun, 27 Nov 2005 14:03:07 +1300, Brian <bclark@xxxxxxxx> wrote:
>
><snip>
>
>>I'm trying to convert a program that was written in Quick Basic to
>>Visual Basic so it will run happily with Windows.
>
>90% of your logic code should be simply cut and paste
>
>>I've drawn flow charts of the ordinal code to try and create a new
>>flow chart that will work will with Visual Basic.
>
>>I now think that it's not possible to restructure the ordinal code as
>>depending on the user input only certain parts of the code are
>>executed each time. There are too many conditions in the program. It
>>would be nice if the program followed the same path each time.
>
>That should not be a problem
>- one main control routine can drive subsidiary procedures
>
>>I first tried to create procedures for parts of the program to avoid
>>many jumps in the program code but then found that the program went
>>deep in following to many procedures.
>
>There is nothing wrong with going deep into procedures
>- the first trick is to separate 'generic' code and App specific code
>into separate areas
>
>- the next is to make sure that as many procedures as possible are
>'Black Boxes' with tightly defined input and output
>
>- one needs to ensure that nothing 'knows' anything about anything
>else unless it absolutely has to
>
>- avoid Global variables like the plague
>- avoid module level variables unless they are essential, generally in
>'normal' routines they are not essential
>
>- make everything 'Private' unless it absolutely has to be 'Public'
>
>- Use: Select Case rather than If .. Then .. Else
>
>>Maybe Visual Basic is not suitable for this type of program.
>
>If you could write it in Quick Basic, then you can transfer it to VB
>with very little trouble
>
>However, from what you have said so far, it sounds as if your App
>would benefit from a complete re-write
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.
The other problem is that there is a jump (goto) to a line number
within a subroutine from outside of the subroutine.
I might find some examples of Visual Basic code for complete programs
on the internet which I could study.
Regards Brian
.
- Follow-Ups:
- Re: Problem writing code to go to a label after calling a procedure
- From: Michael B . Johnson
- 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
- 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
- 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: Transparency (2)
- 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):
Relevant Pages
|