17.07.2013 Views

GWBASIC User's Manual

GWBASIC User's Manual

GWBASIC User's Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

GW-BASIC <strong>User's</strong> Guide<br />

Sample GW-BASIC command lines are as follows:<br />

The following uses 64K bytes of memory and three files; loads and executes the program file<br />

payroll.bas:<br />

A>gwbasic PAYROLL<br />

The following uses 64K bytes of memory and six files; loads and executes the program file invent.<br />

bas:<br />

A>gwbasic INVENT /F:6<br />

The following disables RS-232 support and uses only the first 32K bytes of memory. 32K bytes<br />

above that are reserved for user programs:<br />

A>gwbasic /C:0 /M:32768,4096<br />

The following uses four files and allows a maximum record length of 512 bytes:<br />

A>gwbasic /F:4 /S:512<br />

The following uses 64K bytes of memory and three files. Allocates 512 bytes to RS-232 receive<br />

buffers and 128 bytes to transmit buffers, and loads and executes the program file tty.bas:<br />

A>gwbasic TTY /C:512<br />

For more information about RS-232 Communications, see Appendix F.<br />

Redirection of Standard Input and Output<br />

When redirected, all INPUT, LINE INPUT, INPUT$, and INKEY$ statements are read from the<br />

specified input file instead of the keyboard.<br />

All PRINT statements write to the specified output file instead of the screen.<br />

Error messages go to standard output and to the screen.<br />

File input from KYBD: is still read from the keyboard.<br />

File output to SCRN: still outputs to the screen.<br />

GW-BASIC continues to trap keys when the ON KEY(n) statement is used.<br />

Typing CTRL-BREAK when output is redirected causes GW-BASIC to close any open files, issue<br />

the message "Break in line nnnn" to standard output, exit GW-BASIC, and return to MS-<br />

DOS.<br />

When input is redirected, GW-BASIC continues to read from this source until a CTRL-Z is<br />

detected. This condition can be tested with the end-of-file (EOF) function. If the file is not<br />

terminated by a CTRL-Z, or if a GW-BASIC file input statement tries to read past the end of file,<br />

then any open files are closed, and GW-BASIC returns to MS-DOS.<br />

file:///C|/Documents%20and%20Settings/Lorenzo/Desktop/GW%20Basic/Chapter%202.html (4 of 8)28/03/2004 21.28.57

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!