SOFTWARE Specialists I State of the Art Programrnng P.O
Total Page:16
File Type:pdf, Size:1020Kb
Three types of records are de- file whose name is given. Ways are Native -format files are accessed scribed: display, internal, and native. provided to find out if a file exists, through "templates" and are provided Display records are produced by and if it does, what its attributes are. for possible access to COBOL files. PRINT statements -strings of charac- The CLOSE statement closes a file. ters ending in a carriage return -line- The ERASE statement erases the con- feed. Internal records contain values tents of a file and leaves it of zero Exception Handling of numbers or strings, but in some in- length. Two examples: The construct for intercepting ex- ternal format. The key point is that ceptions (situations during execution what gets read back in is exactly iden- that usually cause the program to ter- tical to what was written out. (This is OPEN #infile: NAME "Myfile ", minate) is: not necessarily true with display - ACCESS INPUT, format files, as numbers must be con- ORGANIZATION WHEN EXCEPTION IN verted to strings of characters on out- SEQUENTIAL put and from strings of characters USE back to numbers on subsequent in- OPEN #3: NAME "filename" put.) END WHEN Of the 12 combinations of file In the second example, it is assumed organization and record type, only 3 that the organization is sequential; The following simple example can are required in the core standard: se- the record -type, display; and the ac- be used to protect against an invalid quential- display, sequential- internal, cess, "outin" (both input and output). VAL argument: and stream -internal. Five other com- PRINT and INPUT are used to pass binations are defined as possible en- information to and from sequential - LET flag = 0 hancements. The remaining 4 are not display files, just about the way they WHEN EXCEPTION IN defined by the standard, which leaves work for the terminal. READ and LET x = VAL(a$) open the possibility that some im- WRITE are used to communicate USE plementations may use them. with all three file types. Display files PRINT "Bad number; reenter" The OPEN statement associates a can thus be accessed by both PRINT LET flag = 1 channel- setter of the form " #13" to a and INPUT, and READ and WRITE. END WHEN the language that is based on the past but looks to the uses of the future. JANNow You Can Nave JANUS On Your System. JANUS is a subset of the famous ADA language developed by the U. S. Department of Defense. JANUS includes all of the most useful features of PASCAL, plus many useful enhancements. Enhancements found in no other microprocessor programming language. For example, JANUS includes true Modular programming, where the computer, rather than the user, remembers what modules are being used. D JANUS doesn't forget error handling, either. JANUS helps you with full error messages -no more looking up error numbers in a manual. At run time, JANUS gives you the line number of the error, and a full walkback including subprogram names. JANUS is available on the following systems: IBM Personal Computer All CP /M 8" Disk Systems A TRS -80 Model II (CP /M) Seattle Computer 8086 North Star (CP/ M) Apple Softcard The JANUS package produces ROMable, re- entrant 8080, Optimized Z80, or 8086 machine code. JANUS runs under CP /M, CP /M -86, and MS -DOS (also known as 86 -DOS, IBM PC -DOS, and SB -86). You too can take a step forward into the future. 8080 or Z80, CP /M (requires 56K memory) - $300.00 8086/8088, CP /M -86 or MS -DOS (requires 64K memory) - $400.00 JANUS is supplied on IBM formatted, single density 8" floppy disks. North Star DD, Apple Softcard, IBM Personal Computer and other formats are available. SOFTWARE specialists i state of the art programrnng P.O. BOX 1512 MADISON, WISCONSIN 53701 (608) 244 -6436 208 )une 1982 © BYTE Publications Inc Circle 384 on inquiry card. .