2
votes

I don't know if any one have experience in programming in BASIC language. I am reading a manual regarding a device which used enhanced BASIC language. I have no experience at all. The statement is like

OUTPUT 621 USING "#, K, 1024(W)";

I wonder what's the using statement is for? what's '#', 'K' and 1024(W) really mean? Sorry that the manual is so old and some of the pages lost and I can't even tell more information from the context.

2
My guess is that it's formatting the output. This might point you in the right direction: truebasic.com/downloads/PrintUsing.pdf - codemonkeh

2 Answers

1
votes

In BASIC, USING statement was typically used for output formatting. So you can read that as "Output number 621 using formatting "#, K, 1024(W)"

What that formatting means, I think that's totally dependent on the BASIC dialect, though. You have to consult it's reference manual. # means "number", for sure, and the rest probably specifies how that number should be formatted.

Example of PRINT USING in TrueBasic manual (PDF, found by google).

As a totally wild guess, it could mean, use suffix K after dividing by 1024 and rounding as specified by (W). If this is so, then number 621 is probably number of bytes, and output is wanted in kilobytes.

1
votes

It looks to me like this is a statement to write output to some type of external storage, any of the myriad types of tapes and disks that existed 35 or 40 years ago. Before things became more standardized with the advent of operating systems like CP/M and MS-DOS, there were hundreds (I'm guessing at the number) of companies building and marketing computers with their own proprietary operating systems. Each one would have its own commands and syntax for reading and writing to peripherals (as any storage outside the RAM was called in those days).

621 probably is the code for the particular tape drive, disk pack or floppy disk that they wanted to write output to. K is probably just a parameter for an option of some sort. I'm pretty sure that 1024(W) refers to the length in bytes to be allocated on the disk or tape for each instance that is written, and I'm even more certain that (W) means to access the device in write-only mode.