Write Statement
๋ฐ์ดํฐ๋ฅผ ์์ฐจ ํ์ผ์ ๊ธฐ๋กํฉ๋๋ค.
๊ตฌ๋ฌธ:
Write [#FileName], [Expressionlist]
๋งค๊ฐ ๋ณ์:
FileName: ๊ฐ ํ์ผ์ ๋ํด Open ๋ฌธ์ผ๋ก ์ค์ ๋ ํ์ผ ๋ฒํธ๋ฅผ ํฌํจํ๋ ์์์ ์ซ์ ์์ ๋๋ค.
Expressionlist: ํ์ผ์ ์ ๋ ฅํ ์ผํ๋ก ๊ตฌ๋ถ๋ ๋ณ์ ๋๋ ์์ ๋๋ค.
ํํ์ ๋ชฉ๋ก์ด ์๋ต๋ ๊ฒฝ์ฐ Write ๋ฌธ์ ํ์ผ์ ๋น ์ค์ ์ถ๊ฐํฉ๋๋ค.
์ ๋ชฉ๋ก์ ์ ํ์ผ์ด๋ ๊ธฐ์กด ํ์ผ์ ์ถ๊ฐํ๋ ค๋ฉด ํ์ผ์ Output ๋๋ Append ๋ชจ๋๋ก ์ด์ด์ผ ํฉ๋๋ค.
์์ฑํ๋ ๋ฌธ์์ด์ ๋ฐ์ดํ๋ก ๋ฌถ์ด๊ณ ์ผํ๋ก ๊ตฌ๋ถ๋ฉ๋๋ค. ํํ์ ๋ชฉ๋ก์ ์ด ๊ตฌ๋ถ ๊ธฐํธ๋ฅผ ์ ๋ ฅํ ํ์๋ ์์ต๋๋ค.
๊ฐ Write ๋ฌธ์๋ ๋ง์ง๋ง ํญ๋ชฉ์ผ๋ก ์ค ๋ ๊ธฐํธ๊ฐ ์ถ๋ ฅ๋ฉ๋๋ค.
์์์ ์ ๊ฐ๋ ์๋ ๊ตญ๊ฐ๋ณ ์ค์ ์ ๋ฐ๋ผ ๋ณํ๋ฉ๋๋ค.
์:
Sub ExampleWrite
Dim iCount As Integer
Dim sValue As String
iCount = Freefile
Open "C:\data.txt" For Output As iCount
sValue = "Hamburg"
Write #iCount,sValue,200
sValue = "New York"
Write #iCount,sValue,300
sValue = "Miami"
Write #iCount,sValue,450
Close #iCount
End Sub