Put# Statement

λ ˆμ½”λ“œλ₯Ό μƒλŒ€ νŒŒμΌμ— μ“°κ±°λ‚˜ λ°”μ΄νŠΈ μ‹œν€€μŠ€λ₯Ό 이진 νŒŒμΌμ— μ”λ‹ˆλ‹€.

tip

Use Print# statement to print data to a sequential text file. Use Write# statement to write data to a sequential text file with delimiting characters.


Syntax:

Put Statement diagram


Put [#]fileNum, [recordNum|filePos], variable

Parameters:

fileNum: Any integer expression that defines the file that you want to write to.

recordNum, filePos: For relative files (random access files), the number of the record that you want to write.

이진 파일(이진 μ•‘μ„ΈμŠ€)의 경우, μ“°κΈ°λ₯Ό μ‹œμž‘ν•  파일의 λ°”μ΄νŠΈ μœ„μΉ˜μž…λ‹ˆλ‹€.

variable: Name of the variable that you want to write to the file.

μƒλŒ€ νŒŒμΌμ— λŒ€ν•œ μ°Έκ³  사항: 이 λ³€μˆ˜μ˜ λ‚΄μš©μ΄ Open 문의 Len μ ˆμ— μ§€μ •λœ λ ˆμ½”λ“œ 길이와 μΌμΉ˜ν•˜μ§€ μ•Šμ„ 경우 μƒˆλ‘œ 기둝된 λ ˆμ½”λ“œμ˜ 끝 λΆ€λΆ„κ³Ό λ‹€μŒ λ ˆμ½”λ“œ μ‚¬μ΄μ˜ 곡백이 μ“°λ €λŠ” 파일의 κΈ°μ‘΄ λ°μ΄ν„°λ‘œ μ±„μ›Œμ§‘λ‹ˆλ‹€.

이진 νŒŒμΌμ— λŒ€ν•œ μ°Έκ³  사항: λ³€μˆ˜ λ‚΄μš©μ΄ μ§€μ •ν•œ μœ„μΉ˜μ— 기둝되고 λ§ˆμ§€λ§‰ λ°”μ΄νŠΈμ˜ λ°”λ‘œ 뒀에 파일 포인터가 μ‚½μž…λ©λ‹ˆλ‹€. λ ˆμ½”λ“œ 간에 곡백이 남지 μ•ŠμŠ΅λ‹ˆλ‹€.

Example: