[Gambas-user] #Stream

Me adamnt42 at gmail.com
Wed Aug 15 23:51:06 CEST 2018


On Wed, 15 Aug 2018 15:55:25 +0200
Tobias Boege <taboege at gmail.com> wrote:

> On Wed, 15 Aug 2018, Hans Lehmann wrote:
> > Hello,
> > 
> > the following, for example, is a riddle:
> > 
> > FLUSH [ [ # ] Stream ]
> > 
> > When is the # sign set and in which other cases not - it is optional?
> > 
> 
> And Benoit or any other old-timer :-) -- what is the history of this symbol?
> I assume it had a meaning in BASIC similar to "$", but in this case I could
> only find exactly one comment in a translation/etymology forum for "octothorpe"
> which references that "some BASIC dialects" used it, but I couldn't find
> any concrete dialect or what the symbol was used for.
> 
> Regards,
> Tobi
> 
> -- 
> "There's an old saying: Don't change anything... ever!" -- Mr. Monk
> 
> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----

In fact the original BASIC (Dartmouth) Write #n ... relates to the FORTRAN WRITE(n,m) statement where n was a UNIT NUMBER (and m was a line reference number to a FORMAT statement). So, the BASIC statement WRITE #1 "Hello world" would result in byte code representing (say):
        WRITE(1,100) "Hello world"
100  FORMAT "a20"

The UNIT NUMBER back in the original days actually referred to a hardware channel. For instance, 5 referred to the channel for the keyboard (teletype!) which was connected to device number 5 on the backplane of the computer, 6 referred to the teletype printer which was connected to (guess!). 

The reason beleve it or not was that in those days we did not write to files we wrote to devices: teletypes, lineprinters, card punches, card readers etc. Disk drives? What kind of new fangled tomfoolery is that?

Oh well, with the advent of mass storage devices the "file" concept came into being. So FORTRAN had to expand the use of the unit number to include these "logical devices" and hence the OPEN and CLOSE statements came into being.

Before FORTRAN we had to write out own I-O routines in assembler. So we could do whatever we damn well pleased.  Ah for the days when computer scientists wore lab coats, smoked pipes and drove sports cars (and computers took up large buildings!)

cheers
b
-- 
Me <adamnt42 at gmail.com>


More information about the User mailing list