🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.lang.basic
Article #362

Re: QuickBasic editor question

#362
From: Gabriel Landini
Date: Fri, 20 Nov 1992 16:47
40 lines
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
Technical Details
Message-ID: <924720164714@ibm3090.bham.ac.uk>
Path: arc1-ca.pugleaf.net!sparky!uunet!pipex!warwick!bham!ibm3090.bham.ac.uk!LANDINIG
References: <1992Nov20.072552.44968@kuhub.cc.ukans.edu>

Show Full Headers
Complete Article Headers
Newsgroups: alt.lang.basic
Path: arc1-ca.pugleaf.net!sparky!uunet!pipex!warwick!bham!ibm3090.bham.ac.uk!LANDINIG
From: Gabriel Landini <g.landini@uk.ac.bham>
Subject: Re: QuickBasic editor question
Sender: usenet@rs6000.bham.ac.uk (USENET News Service)
Message-ID: <924720164714@ibm3090.bham.ac.uk>
Date: Fri, 20 Nov 1992 16:47:14 GMT
References: <1992Nov20.072552.44968@kuhub.cc.ukans.edu>
Organization: The University of Birmingham, United Kingdom
Lines: 40