Lof Function

์—ด๋ฆฐ ํŒŒ์ผ์˜ ํฌ๊ธฐ๋ฅผ ๋ฐ”์ดํŠธ๋กœ ๊ตฌํ•ฉ๋‹ˆ๋‹ค.

๊ตฌ๋ฌธ:


Lof (FileNumber)

๋ฐ˜ํ™˜ ๊ฐ’:

Long

๋งค๊ฐœ ๋ณ€์ˆ˜:

FileNumber: Open ๋ฌธ์— ์ง€์ •๋œ ํŒŒ์ผ ๋ฒˆํ˜ธ๋ฅผ ํฌํ•จํ•˜๋Š” ์ž„์˜์˜ ์ˆซ์ž ์‹์ž…๋‹ˆ๋‹ค.

ํŒ ์•„์ด์ฝ˜

์—ด์ง€ ์•Š์€ ํŒŒ์ผ์˜ ๊ธธ์ด๋ฅผ ๊ตฌํ•˜๋ ค๋ฉด FileLen ํ•จ์ˆ˜๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.


Error codes:

5 ์ž˜๋ชป๋œ ํ”„๋กœ์‹œ์ € ํ˜ธ์ถœ์ž…๋‹ˆ๋‹ค.

52 ์ž˜๋ชป๋œ ํŒŒ์ผ ์ด๋ฆ„ ๋˜๋Š” ๋ฒˆํ˜ธ์ž…๋‹ˆ๋‹ค.

์˜ˆ:


Sub ExampleRandomAccess
Dim iNumber As Integer
Dim sText As Variant REM must be a Variant
Dim aFile As String
    aFile = "c:\data.txt"
    iNumber = Freefile
    Open aFile For Random As #iNumber Len=32
    Seek #iNumber,1 REM Position at start
    Put #iNumber,, "This is the first line of text" REM Fill with text
    Put #iNumber,, "This is the second line of text"
    Put #iNumber,, "This is the third line of text"
    Seek #iNumber,2
    Get #iNumber,,sText
    Print sText
    Close #iNumber
    iNumber = Freefile
    Open aFile For Random As #iNumber Len=32
    Get #iNumber,2,sText
    Put #iNumber,,"This is a new line of text"
    Get #iNumber,1,sText
    Get #iNumber,2,sText
    Put #iNumber,20,"This is the text in record 20"
    Print Lof(#iNumber)
    Close #iNumber
End Sub

Please support us!