home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / alt / lang / basic / 880 < prev    next >
Encoding:
Text File  |  1992-11-20  |  2.4 KB  |  52 lines

  1. Newsgroups: alt.lang.basic
  2. Path: sparky!uunet!pipex!warwick!bham!ibm3090.bham.ac.uk!LANDINIG
  3. From: Gabriel Landini <g.landini@uk.ac.bham>
  4. Subject: Re: QuickBasic editor question
  5. Sender: usenet@rs6000.bham.ac.uk (USENET News Service)
  6. Message-ID: <924720164714@ibm3090.bham.ac.uk>
  7. Date: Fri, 20 Nov 1992 16:47:14 GMT
  8. References: <1992Nov20.072552.44968@kuhub.cc.ukans.edu>
  9. Organization: The University of Birmingham, United Kingdom
  10. Lines: 40
  11.  
  12. >Is there any way to temporarily disable features of the QuickBasic 4.5
  13. >editor?  There are a number of minor annoyances but the biggest problem
  14. >I have is related to making subroutines.
  15. >
  16. >Often when writing a program I'll decide "hmm, that block of code
  17. >would be better as a subroutine".  But when I try to put a SUB
  18. >statement before an already-existing section of code,
  19. >the editor takes me out of the original routine and creates a new,
  20. >empty subroutine.
  21. >
  22. >(IMPORTANT:  Notice I'm **NOT** talking about developing a really new
  23. >             subroutine from scratch, but extracting already-present
  24. >             code to make a SUB .  Typically this would be starting from old
  25. >             "spaghetti" code and converting it to a more structured form.)
  26. >
  27. >I can avoid this by saving the program as ASCII, getting out of QB,
  28. >using a text editor to insert the "SUB ... END SUB" statements around the
  29. >appropriate lines of code, moving the new SUB to the bottom of the
  30. >file, then getting back into QB.  But something tells me there's got to
  31. >be an easier way ....
  32. >
  33. >Thanks for any help.  Apologies if this is a dumb/RTFM question but
  34. >I haven't been able to find anything in the docs.
  35. >________________________________________________________________________
  36. >Raymond W. Arritt                     |  Dept. of Physics and Astronomy
  37. >Assistant Professor                   |  University of Kansas
  38. >arritt@kuhub.cc.ukans.edu             |  Lawrence, KS  66045
  39. >Apr  1 12:29:21 timed[92]: THIS MACHINE IS A SLAVE
  40. >Apr  1 12:29:27 timed[92]: THIS MACHINE IS A CANDIDATE
  41. >Apr  1 12:29:31 timed[92]: This machine is master
  42. >
  43. >------------------------------------------------------------------------------
  44.  
  45. You could: first decide your subroutine name and create that empty
  46. SUB, then with the block copy, copy the part of the main code into
  47. the empty SUB and after delete the selected block from the main.
  48. It works, but of course you have to DEFINE SUB at the begining.
  49. Hope it helps :-)
  50.  
  51. Gabriel
  52.