RLn: Difference between revisions
No edit summary |
No edit summary |
||
(6 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
RLN(<file handle>[,<new record length>]) | |||
The '''RLn''' [[internal function]] returns the record length of an open [[file handle]] N. The optional X parameter may be used with external files | The '''RLn''' [[internal function]] returns the [[record length]] of an open [[file handle]] N. The optional X parameter may be used only with external files to reset the record length to the specified amount. The new record length cannot exceed the original record length specified in the OPEN statement. | ||
====Comments and Examples==== | ====Comments and Examples==== | ||
Line 8: | Line 8: | ||
Here are three quick steps to determine the record length of an internal file: | Here are three quick steps to determine the record length of an internal file: | ||
00100 OPEN #1:"name=filename", | 00100 OPEN #1:"name=filename",Internal,Input,Sequential | ||
00200 PRINT RLN(1) | 00200 PRINT RLN(1) | ||
00300 END | 00300 END | ||
The number printed by PRINT RLN(1) is the record length for file 1. The END statement is | The number printed by PRINT RLN(1) is the record length for file 1. The file will be closed when the END statement is processed. | ||
In the following example, RLN shortens the record length of file 1 to 128 bytes. | |||
10 LET RLN(1,128) | 10 LET RLN(1,128) | ||
==== | ====See Also==== | ||
For additional information about external file record lengths, see the [[POS=]] and [[REC=]] parameters for the [[READ]] file [[statement]]. | For additional information about external file record lengths, see the [[POS=]] and [[REC=]] parameters for the [[Read File|READ]] file [[statement]]. | ||
For additional information about files, see the following: | For additional information about files, see the following: | ||
*[[Exists]] | *[[Exists]] | ||
*[[FILE]] | *[[FILE (internal function)]] | ||
*[[File$]] | *[[File$]] | ||
*[[FileNum]] | *[[FileNum]] | ||
Line 34: | Line 33: | ||
*[[Rec]] | *[[Rec]] | ||
*[[File Handle]] | *[[File Handle]] | ||
*[[RecL]] | |||
<noinclude> | <noinclude> | ||
[[Category:Internal Functions]] | [[Category:Internal Functions]] | ||
</noinclude> | </noinclude> |
Latest revision as of 00:51, 22 May 2014
RLN(<file handle>[,<new record length>])
The RLn internal function returns the record length of an open file handle N. The optional X parameter may be used only with external files to reset the record length to the specified amount. The new record length cannot exceed the original record length specified in the OPEN statement.
Comments and Examples
Here are three quick steps to determine the record length of an internal file:
00100 OPEN #1:"name=filename",Internal,Input,Sequential 00200 PRINT RLN(1) 00300 END
The number printed by PRINT RLN(1) is the record length for file 1. The file will be closed when the END statement is processed.
In the following example, RLN shortens the record length of file 1 to 128 bytes.
10 LET RLN(1,128)
See Also
For additional information about external file record lengths, see the POS= and REC= parameters for the READ file statement.
For additional information about files, see the following: