PCINPUT.BAS PCGOTO.BAS PCCOPY.BAS Ernie Graves June 1, 1984 Do you ever need to copy large amounts of data from one PerfectCalc spreadsheet to another without linking the two spreadsheets or from a data base file to a PerfectCalc spread- sheet? This disk contains three Microsoft Basic programs to accomplish these tasks without tedious manual entry of data on the new spreadsheet. The files on the disk include: PCINPUT.BAS PCINPUT.COM PCINPUT.DOC V100FILE.PC PCGOTO.BAS PCGOTO.COM PCGOTO.DOC V100FILE.DTA PCCOPY.BAS PCCOPY.COM NS.COM V100FILE.DOC V100PART.DOC V112FILE.PC The three MBASIC programs are described below, and more explanation is included in the programs themselves. NS.COM and the data files are included to permit viewing the various types of data files so as to grasp more quickly just what the programs are doing. The data files are also convenient for experimentation and practice with the programs. Numbers that do not depend upon formulas can be copied from one PerfectCalc spreadsheet to another using the "two-windows" procedure of PerfectCalc's multiple file handling capability. So can labels. However, if a number depends upon a formula, the two spreadsheets must be linked by a reference entry, and both spreadsheets must have been loaded into memory for the new spreadsheet to display the "copied" number without an "Error!" message. Such a number isn't really copied, only referenced. Each of the three MBASIC programs on this disk overcomes this problem by processing the contents of a disk file to create a new PerfectCalc spreadsheet file that is able to display all the numbers free of formulas. This is useful when you have finished using the old spreadsheet and want to begin a fresh spreadsheet using the results of the earlier spreadsheet as a starting point. The processing can start at any one of four different types of data file, each of which stores the entries in a different way. The sample files of the four types are: V100FILE.PC PerfectCalc spreadsheet file, Versions 1.00-1.10 V112FILE.PC PerfectCalc spreadsheet file, Version 1.12 V100FILE.DTA DataStar comma-delimited data base file V100FILE.DOC Document file with data in a rectangular matrix PCINPUT.BAS has the widest application. It takes data from either (1) a comma-delimited data base file or (2) a document file with data in a matrix and writes the entries in a separate PerfectCalc spreadsheet file on a disk. If you wish to copy numbers that depend upon formulas from a spreadsheet file produced with Versions 1.00-1.10, the first step is to use the PerfectCalc PRINT REGION command (CTRL-X, p) to write the numbers to a separate document file on a disk. Then use PCINPUT to convert the document file to a spreadsheet file. PCINPUT.COM is a compiled version of PCINPUT.BAS that runs without MBASIC.COM. PCGOTO.BAS provides another way to copy numbers that depend upon formulas from one spreadsheet to another. To use this program requires three steps: (1) On the old spreadsheet set up a column 19 characters wide that displays the numbers to be copied in scientific notation. The entries in Column f of the sample spreadsheet files show how to do this. All the numbers to be copied should be listed in one column without any intervening blank lines. Numbers to appear in the same column on the new spreadsheet should be grouped together. (2) Use the PerfectCalc PRINT REGION command (CTRL-X, p) to write this column of numbers to a separate document file on a disk. V100PART.DOC is a sample document file containing the numbers from Column f of the spreadsheet. (3) Use PCGOTO.BAS to convert the document file into a a PerfectCalc spreadsheet file. PCGOTO.BAS and the second option of PCINPUT.BAS rely on the same concept: create an intermediate document file, then create a new PerfectCalc spreadsheet file in order to replace the formu- las in the original spreadsheet file with the numbers in the final spreadsheet file. This approach is necessary for spreadsheets produced with PerfectCalc Versions 1.00, 1.02, 1.05 and 1.10. The data files produced by these versions do not include the numbers which result from the formulas, only the formulas them- selves. PCCOPY.BAS processes the old spreadsheet file directly. It works only with files produced with PerfectCalc Version 1.12. It copies either the entire spreadsheet or a rectangular region of the spreadsheet selected by the user. The position of the entries on the new spreadsheet is the same as on the old spread- sheet. Data files produced by Version 1.12 include both the formulas and the resulting numbers, paired in the same entries. PCCOPY.BAS removes the formulas so that the numbers no longer depend on them. PCCOPY.BAS can also be used to process a spreadsheet file produced with Version 1.12 so that the formulas can be read by earlier versions, such as 1.00, 1.02, 1.05 and 1.10. Without such processing the earlier versions cannot solve the formulas in a spreadsheet produced by Version 1.12. Each program includes instructions on entering file names and spreadsheet parameters. For the programs to run properly it is essential to enter the spreadsheet parameters accurately without any extra spaces. Each program displays the entries that are output to the new spreadsheet file. In addition you can check the contents of the input and output files with the CP/M TYPE command or NS.COM.