Thread View: alt.lang.basic
3 messages
3 total messages
Started by arritt
Fri, 20 Nov 1992 13:25
QuickBasic editor question
Author: arritt
Date: Fri, 20 Nov 1992 13:25
Date: Fri, 20 Nov 1992 13:25
30 lines
1945 bytes
1945 bytes
Is there any way to temporarily disable features of the QuickBasic 4.5
editor? There are a number of minor annoyances but the biggest problem
I have is related to making subroutines.
Often when writing a program I'll decide "hmm, that block of code
would be better as a subroutine". But when I try to put a SUB
statement before an already-existing section of code,
the editor takes me out of the original routine and creates a new,
empty subroutine.
(IMPORTANT: Notice I'm **NOT** talking about developing a really new
subroutine from scratch, but extracting already-present
code to make a SUB . Typically this would be starting from old
"spaghetti" code and converting it to a more structured form.)
I can avoid this by saving the program as ASCII, getting out of QB,
using a text editor to insert the "SUB ... END SUB" statements around the
appropriate lines of code, moving the new SUB to the bottom of the
file, then getting back into QB. But something tells me there's got to
be an easier way ....
Thanks for any help. Apologies if this is a dumb/RTFM question but
I haven't been able to find anything in the docs.
________________________________________________________________________
Raymond W. Arritt | Dept. of Physics and Astronomy
Assistant Professor | University of Kansas
arritt@kuhub.cc.ukans.edu | Lawrence, KS 66045
Apr 1 12:29:21 timed[92]: THIS MACHINE IS A SLAVE
Apr 1 12:29:27 timed[92]: THIS MACHINE IS A CANDIDATE
Apr 1 12:29:31 timed[92]: This machine is master
Re: QuickBasic editor question
Author: Gabriel Landini
Date: Fri, 20 Nov 1992 16:47
Date: Fri, 20 Nov 1992 16:47
40 lines
2488 bytes
2488 bytes
>Is there any way to temporarily disable features of the QuickBasic 4.5 >editor? There are a number of minor annoyances but the biggest problem >I have is related to making subroutines. > >Often when writing a program I'll decide "hmm, that block of code >would be better as a subroutine". But when I try to put a SUB >statement before an already-existing section of code, >the editor takes me out of the original routine and creates a new, >empty subroutine. > >(IMPORTANT: Notice I'm **NOT** talking about developing a really new > subroutine from scratch, but extracting already-present > code to make a SUB . Typically this would be starting from old > "spaghetti" code and converting it to a more structured form.) > >I can avoid this by saving the program as ASCII, getting out of QB, >using a text editor to insert the "SUB ... END SUB" statements around the >appropriate lines of code, moving the new SUB to the bottom of the >file, then getting back into QB. But something tells me there's got to >be an easier way .... > >Thanks for any help. Apologies if this is a dumb/RTFM question but >I haven't been able to find anything in the docs. >________________________________________________________________________ >Raymond W. Arritt | Dept. of Physics and Astronomy >Assistant Professor | University of Kansas >arritt@kuhub.cc.ukans.edu | Lawrence, KS 66045 >Apr 1 12:29:21 timed[92]: THIS MACHINE IS A SLAVE >Apr 1 12:29:27 timed[92]: THIS MACHINE IS A CANDIDATE >Apr 1 12:29:31 timed[92]: This machine is master > >------------------------------------------------------------------------------ You could: first decide your subroutine name and create that empty SUB, then with the block copy, copy the part of the main code into the empty SUB and after delete the selected block from the main. It works, but of course you have to DEFINE SUB at the begining. Hope it helps :-) Gabriel
Re: QuickBasic editor question
Author: Brian Wheeler
Date: Fri, 20 Nov 1992 17:53
Date: Fri, 20 Nov 1992 17:53
10 lines
971 bytes
971 bytes
Declare sub will be added when the program is saved, providing the sub is called somewhere in the code Brian Wheeler -- ****************************************************************************** * Brian 'Nautical' Wheeler - These are my opinions, do you hear me? MINE! * "Wombats are our friends" - Me ******************************************************************************
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads