home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0" encoding="utf-8"?>
- <html><head><title>Lof Function [Runtime]</title><meta name="filename" content="text/sbasic/common/03020303"/><help:css-file-link xmlns:help="http://openoffice.org/2000/help"/><!--The CSS style header method for setting styles--><style type="text/css">
-
- table.Tabelle1{
- }
- span.Tabelle1A{
- width:1.499cm;}
- span.Tabelle1B{
- width:16.498cm;}
- tr.Tabelle11{
- }
- td.Tabelle1A1{
- }
- p.P1{
- }
- span.T1{
- font-weight:bold;}
- span.fr1{
- }
- </style></head><body>
-
-
- <help:to-be-embedded Eid="lof" xmlns:help="http://openoffice.org/2000/help">
- <p class="Head1"><help:link Id="66598">Lof Function [Runtime]</help:link></p>
- <p class="Paragraph">Returns the size of an open file in bytes.</p>
- </help:to-be-embedded>
- <p class="Paragraph"><span class="T1">Syntax</span>:</p>
- <p class="Paragraph">Lof (FileNumber) <help:key-word value="Lof" tag="kw66598_1" xmlns:help="http://openoffice.org/2000/help"/></p>
- <p class="Paragraph"><span class="T1">Return value</span>:</p>
- <p class="Paragraph">Long</p>
- <p class="Paragraph"><span class="T1">Parameter</span>:</p>
- <p class="Paragraph">FileNumber: Any numeric expression that contains the file number specified by the Open statement.</p>
- <table><tr class="Tabelle11"><th class="Tabelle1A1" style="text-align:left;"><span class="Tabelle1A">
- <p class="TextInTable"><draw:image draw:style-name="fr1" draw:name="HIND_1" text:anchor-type="paragraph" svg:width="0.847cm" svg:height="0.847cm" draw:z-index="0" xlink:href="66732" xlink:type="simple" xlink:show="embed" xlink:actuate="onRequest" draw:filter-name="GIF - Graphics Interchange" xmlns:draw="http://openoffice.org/2000/drawing" xmlns:text="http://openoffice.org/2000/text" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"/>
- </p>
- </span></th><th class="Tabelle1A1" style="text-align:left;"><span class="Tabelle1B">
- <p class="TextInTable">To obtain the length of a file that is not open, use the <span class="T1">FileLen</span> function.</p>
- </span></th></tr></table>
- <p class="Paragraph"/>
- <p class="Paragraph"><span class="T1">Example:</span></p>
- <p class="PropText">Sub ExampleRandomAccess</p>
- <p class="PropText">Dim iNumber As Integer</p>
- <p class="PropText">Dim sText As Variant REM must be a Variant</p>
- <p class="PropText">Dim aFile As String</p>
- <p class="PropText">aFile = "c:\data.txt"</p>
- <p class="PropText"/>
- <p class="PropText">iNumber = Freefile</p>
- <p class="PropText">Open aFile For Random As #iNumber Len=32</p>
- <p class="PropText">Seek #iNumber,1 REM Position at start</p>
- <p class="PropText">Put #iNumber,, "This is the first line of text" REM Fill with text</p>
- <p class="PropText">Put #iNumber,, "This is the second line of text"</p>
- <p class="PropText">Put #iNumber,, "This is the third line of text"</p>
- <p class="PropText">Seek #iNumber,2</p>
- <p class="PropText">Get #iNumber,,sText</p>
- <p class="PropText">Print sText</p>
- <p class="PropText">Close #iNumber</p>
- <p class="PropText"/>
- <p class="PropText">iNumber = Freefile</p>
- <p class="PropText">Open aFile For Random As #iNumber Len=32</p>
- <p class="PropText">Get #iNumber,2,sText</p>
- <p class="PropText">Put #iNumber,,"This is a new line of text"</p>
- <p class="PropText">Get #iNumber,1,sText</p>
- <p class="PropText">Get #iNumber,2,sText</p>
- <p class="PropText">Put #iNumber,20,"This is the text in record 20"</p>
- <p class="PropText">Print Lof(#iNumber)</p>
- <p class="PropText">Close #iNumber</p>
- <p class="PropText"/>
- <p class="PropText">end sub</p>
- <p class="PropText"/>
- </body></html>