Microsoft KB Archive/32706

FORTRAN-80 OPEN Statement

PSS ID Number: Q32706 Article last modified on 07-18-1988

3.36 3.37 3.42 3.43 3.44 CP/M-80

Summary: The OPEN syntax is as follows: CALL OPEN( LUN,‘filename’,drive)

More Information: An explanation of the syntax is as follows: LUN An integer constant or variable with a value between 1 and 10 (inclusive). The maximum can be increased by modifying the library (see Note1 below). filename Must be placed in single quotation marks if it is a literal: 1. Must be in uppercase if it is a literal. 2. Must be blank filled to eleven characters: eight for the name and three for the extension (the blanks should be between the name and the extension, and at the end of the extension if required; see the examples). 3. The separating period between the name and the extension must not be included in the filename. 4. May be specified by a variable or array name. 5. Illegal filenames can cause bad entries in the CP/M directory (see Note2 below). drive An integer corresponding to the drive on which the file can be found: 0 = default drive 1 = drive A: 2 = drive B: The following are examples: MYDATA.TXT - CALL OPEN(6,‘MYDATA TXT’,0) B:HISDATA2.AB - CALL OPEN(7,‘HISDATA2AB’,2) A:HERDATA.AB - CALL OPEN(8,‘HERDATA AB’,1) Note1: More than ten LUNs may be used if the FORTRAN library is altered. (Please query articles pertaining to the addition of LUNs in this database.) Note2: The OPEN routine does not check if the filename given to it is a valid CP/M filename, and attempts to create the file. This can result in invalid files on the diskette that cannot be processed by other programs or, in the worst case, cannot be erased by the operating system.