OPEN

From QB64 Wiki
Revision as of 09:15, 28 August 2009 by 72.95.147.221 (talk)
Jump to navigation Jump to search

OPEN is used to open a file, COM(serial) or LPT(parallel) port.


Syntax 1: OPEN FileName$ FOR Mode AS #FileNumber [LEN = Bytes]


FileName$: as a string file name using the DOS 8.3 naming convention limits.


Modes: Open can use 5 different access modes:

 OUTPUT: Creates a new file or erases an existing file for new program output
 APPEND: Creates a new file or appends program output to existing file
 BINARY: Creates a new file or uses input and/or output from existing file
 RANDOM: Creates a new file or uses input and/or output from existing file
 INPUT : Only reads input from an existing file

FileNumber: as a low Integer number or a value from the FREEFILE function.


Bytes: Integer number of bytes used in a RANDOM record as defined in a FIELD or TYPE definition.


See also: CLOSE