BBC BASIC for Windows
General >> General Board >> Component-Based Programming
http://bb4w.conforums.com/index.cgi?board=general&action=display&num=1381136182

Component-Based Programming
Post by kolesiko on Oct 7th, 2013, 08:56am

Is BBC BASIC component-oriented language, as it is stated in russian Wikipedia? If yes, how to write big program, that consist of sub-programs? In other words, I need the next level of abstraction after the functions and procedures. I'm writing a program that consists of three large, almost unrelated parts. Each part is ready, but tie them together doesn't work. I don't want to learn OOP and migrate on .NET.
Re: Component-Based Programming
Post by admin on Oct 7th, 2013, 10:59am

on Oct 7th, 2013, 08:56am, kolesiko wrote:
I need the next level of abstraction after the functions and procedures.

The 'next level of abstraction' is the module or library. That is, a separate source file which is incorporated in the program by means of the INSTALL statement. In an extreme case your main program could consist of nothing more than a series of INSTALLs:

Code:
      INSTALL @dir$+"MODULE1"
      INSTALL @dir$+"MODULE2"
      INSTALL @dir$+"MODULE3"
      INSTALL @dir$+"MODULE4"
      PROC_start 

To work in this environment you will almost certainly want in run the 'Module Viewer' utility (usually Slot 4 in the Utilities menu) which provides the IDE with a tabbed interface. The editor tabs (apart from the first) are 'read only' - hence Module Viewer - but double-clicking on a tab causes a new instance of the IDE to open with that module loaded for editing.

If you regularly use this mode of operation you can create a desktop shortcut which will run BBC BASIC for Windows with the Module Viewer automatically loaded. To do that run moduleviewer.exe (which you can find in the ADDINS subdirectory of your BB4W installation folder) and select the Create desktop shortcut box.

Richard.