投稿日 | : 2002/12/21(Sat) 09:00 |
投稿者 | : A221 |
Eメール | : |
URL | : |
タイトル | : Re: ファイル反転処理 |
加工している間にSayさんがレスをつけられたので
蛇足ぎみですがコードです。
Private Const in_file = "c:\text.txt"
Private Const Out_file = "c:\text2.txt"
Private Sub Form_Load()
Dim Load() As Byte
Dim swap() As Byte
Dim Flen As Long
Dim Fnum As Long
Dim tmpstr As String
Fnum = FreeFile
Open in_file For Binary As #Fnum
Flen = FileLen(in_file)
ReDim Load(1 To Flen)
ReDim swap(1 To Flen)
Load = InputB$(Flen, #Fnum)
Close #Fnum
For i = LBound(Load) To UBound(Load)
swap(UBound(Load) - i + 1) = Load(i)
Next
Fnum = FreeFile
Open Out_file For Output As #Fnum
Print #Fnum, StrConv(swap, vbUnicode)
Close #Fnum
End Sub