...

View Full Version : Saving file



loveperson
12-23-2004, 07:41 AM
I have used the VB package & deployment wizard for my
app.

How do I save the text file filename as the variable coding?

This are the coding, which part I make a mistake?

Dim AA As Integer
AA = 0
Do While AA < 3
Call DataLoop
AA = AA + 1
Loop

Public Sub DataLoop ( )
For dataSample = 0 To 10
tempArr(dataSample) = GetData(dataSample)
avrPress = avrPress + tempArr(dataSample)
Next dataSample
End Sub

Public Function GetData(ByVal dataSample) As String
If dataSample > 0 Then
Open App.Path & "\TenSample.txt" For Append As #1
Print #1, GetPressure
Close #1
End If
End If
End Function

Actuaaly when the AA = 0 then the TenSample.txt should be 0.txt and AA = 1 then the filename should be 1.txt and so on.........


Thanks in advance

Regds

shmoove
12-23-2004, 09:22 AM
Open App.Path & "\" & CStr(dataSample) & ".txt" For Append As #1


shmoove



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum