bwrite - output values in WRITE statement format


#include <basic/string.h>
#include <basic/type.h>
#include <basic/generic.h>

bwrite(flag, type, addr)
int flag, type;
union generic addr;


Bwrite formats the value given by type, addr (see generic(inc)) and outputs it to the current file (see initio(io)).  String values are enclosed in double quotes.  A terminating character is then output.  If flag is set, this character is a newline; otherwise, it is a comma.  It is legal to write sequentially to a random file provided the write is entirely within the buffer.  If flag is set and the file is a random file, the buffer is padded with blanks and the newline is output in the last position of the buffer. 

If flag is set, this function resets the current file. 

This function, when called successively for each argument in the statement, implements the WRITE and WRITE # statements. 


generic(inc), initio(io)
write(stmt), write #(stmt)


Error 5 (Illegal function call) is generated if the file is open for input only. 

from The Basmark QuickBASIC Programmerís Manual by Lawrence Leinweber