Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: Saving file

  1. #1
    New to the CF scene
    Join Date
    Dec 2004
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Saving file

    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

  • #2
    Regular Coder
    Join Date
    Dec 2003
    Posts
    367
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
     Open App.Path & "\" & CStr(dataSample) & ".txt" For Append As #1
    shmoove


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •