Sharp OZ-707 Operation Manual - Page 105
![]() |
UPC - 074000012141
View all Sharp OZ-707 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 105 highlights
PRINT# P D FORMAT: PRINT# file number, {esxtnpnregSSion} [{';} {esxtrpinregSSion}] [{';}] Abbreviation: P.# See Also: OPEN, INPUT# PURPOSE: Writes values of specified variables into a specified file. REMARKS: PRINT# is valid only for a file opened for OUTPUT or APPEND with the OPEN command. The file number is the number given to the file when opened. The mode does not need to be specified when the device name is COM. When an array variable (one or two dimensions) has been specified in the form of "array name(*)", the entire array is written to the file . Its elements are written in the order of, for example, C$(O,O), C$(O,l), C$(0,2) .. .. C$(1,0) ..... C$(5,5) . It is recommended that the FOR...NEXT statement be used for writing array variable data. When the respective elements of the array are specified, they must be specified in the form of "B(7)", "C$(5,6)", etc. When a character or string element is used, it must not be specified using a comma (,) or semicolon (;): PRINT#2, "ABC" PRINT#2,A$ If PRINT#2,"ABC",A$ is executed, no data delimiter is written and "ABC" and A$ cannot be distinguished. A numeric value is recorded in such a form that the sign (space when it is positive), numeric character string, and space appear in that order. The recording format is shown below: (1) When a comma or semicolon does not tollow the data, CR(&HOD) and LF(&HOA) are provided. 198 Example: PRINT # 2, - 1.2 PRINT #2, "ABC" I- I I1 I 2 I ICR ILF I I A I B I C ICR ILF I (2) When a comma follows the data, 20 bytes are occupied. A numeric value is right justified and a character string is left justified. Example: PRINT #2, - 1.2,3 II I I -I 1 I . I 2 I I I 3 I I CRI LFI ~ 20 bytes .1 PRINT #2, "ABC ", "DEF" I AI BI CI ~ 20 bytes I DIE I F I CRI LF I .j When the character string exceeds 20 bytes, the excess part is written to the next 20-byte area. The maximum size is 254 bytes. (3) When a semicolon follows the data, it is stored without spaces. Example: PRINT #2, - 1.2;3 I - 11 I . I2 I I I3 I ICR ILF I PRINT #2, "ABC";" DEF" [ IA I B I C I 0 I E l F ICR ILF I In this case, character strings "ABC" and "DEF" will not be read as separate strings during an INPUT# command. When character strings are recorded with commas or semicolons, they must be read with the INPUT$ command by specifying the exact format in which they were recorded. EXAMPLE: Transmitting data using device name "PACOM" Sender Receiver 10: DIM C (2,3) 10: DIM C (2,3) 20: OPEN "PACOM: DATA" 20: OPEN ·PACOM: DATA" FOR OUTPUT AS #2 FOR INPUT AS #3 30: FOR 1=0 TO 2 30: FOR 1=0 TO 2 40: FOR J=O TO 3 40: FOR J=O TO 3 50: C(I,J)=I*10+J 50: INPUT#3, C(I,J) 60: PRINT #2, C(I,J) 60: NEXT J: NEXT 1 70: NEXT J: NEXT 1 70: CLOSE 80: CLOSE 80: END 90: END After entering RUN IENTER Ion the receiver, enter RUN IENTER Ion the sender. 199
![](/manual_guide/products/sharp-oz707-operation-manual-7aa0508/105.png)