RLn: Difference between revisions
No edit summary |
|||
Line 5: | Line 5: | ||
====Comments and Examples==== | ====Comments and Examples==== | ||
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",I,I,S | 00100 OPEN #1:"name=filename",I,I,S | ||
Line 13: | Line 14: | ||
The number printed by PRINT RLN(1) is the record length for file 1. The END statement is a short way to close any open files. | The number printed by PRINT RLN(1) is the record length for file 1. The END statement is a short way to close any open files. | ||
In the following example, RLN shortens the record length of file 1 to 128 bytes. It is important to note that RLN can only shorten, not lengthen, external file record lengths. | In the following example, RLN shortens the record length of file 1 to 128 bytes. It is important to note that '''RLN can only shorten''', not lengthen, external file record lengths. | ||
10 LET RLN(1,128) | 10 LET RLN(1,128) | ||
====Related Functions==== | ====Related Functions==== | ||
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 [[statement]]. | ||
For additional information about files, see the following: | For additional information about files, see the following: | ||
*[[Exists]] | *[[Exists]] | ||
*[[ | *[[FILE]] | ||
*[[File$]] | *[[File$]] | ||
*[[FileNum]] | *[[FileNum]] | ||
*[[ | *[[FREESP]] | ||
*[[KLn]] | *[[KLn]] | ||
*[[KPs]] | *[[KPs]] |
Revision as of 10:41, 30 January 2012
RLn(N[,X])
The RLn internal function returns the record length of an open file handle N. The optional X parameter may be used with external files only to shorten the record length to the specified amount.
Comments and Examples
Here are three quick steps to determine the record length of an internal file:
00100 OPEN #1:"name=filename",I,I,S 00200 PRINT RLN(1) 00300 END
The number printed by PRINT RLN(1) is the record length for file 1. The END statement is a short way to close any open files.
In the following example, RLN shortens the record length of file 1 to 128 bytes. It is important to note that RLN can only shorten, not lengthen, external file record lengths.
10 LET RLN(1,128)
Related Functions
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: