FreeFile Function

ํŒŒ์ผ ์—ด๊ธฐ์— ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋Š” ๋‹ค์Œ ํŒŒ์ผ ๋ฒˆํ˜ธ๋ฅผ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค. ํ˜„์žฌ ์—ด๋ ค์ง„ ํŒŒ์ผ์ด ์•„์ง ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š” ํŒŒ์ผ ๋ฒˆํ˜ธ๋กœ ํŒŒ์ผ์„ ์—ด๋ ค๋ฉด ์ด ํ•จ์ˆ˜๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

๊ตฌ๋ฌธ:


FreeFile

๋ฐ˜ํ™˜ ๊ฐ’:

Integer

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

์ด ํ•จ์ˆ˜๋Š” Open ๋ฌธ ๋ฐ”๋กœ ์•ž์—์„œ๋งŒ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. FreeFile์€ ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ๋‹ค์Œ ํŒŒ์ผ ๋ฒˆํ˜ธ๋ฅผ ํ‘œ์‹œํ•˜์ง€๋งŒ ํŒŒ์ผ ๋ฒˆํ˜ธ๋ฅผ ์˜ˆ์•ฝํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

Error codes:

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

67 ํŒŒ์ผ์ด ๋„ˆ๋ฌด ๋งŽ์Šต๋‹ˆ๋‹ค.

์˜ˆ:


Sub ExampleWorkWithAFile
Dim iNumber As Integer
Dim sLine As String
Dim aFile As String
Dim sMsg As String
    aFile = "c:\data.txt"
    sMsg = ""
    iNumber = Freefile
    Open aFile For Output As #iNumber
    Print #iNumber, "First line of text"
    Print #iNumber, "Another line of text"
    Close #iNumber
    iNumber = Freefile
    Open aFile For Input As #iNumber
    While Not eof(#iNumber)
        Line Input #iNumber, sLine
        If sLine <>"" Then
            sMsg = sMsg & sLine & chr(13)
        End If
    Wend
    Close #iNumber
    MsgBox sMsg
End Sub

Please support us!