Results 1 to 4 of 4

Thread: What is wrong with this code ?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2003
    Location
    Florida
    Posts
    18

    Question What is wrong with this code ?

    Hi there, VB.NET

    I need to write to a text file the values, instead it writes the string

    FileOpen(1, "d:\orders\orders.txt", OpenMode.Output)

    If LCase(Trim(MyArray(J, 45))) = "yes" Then
    OutLine = "TAB(2)," & " Trim(MyArray(J, 38)), "
    End If

    If LCase(Trim(MyArray(J, 37))) = "new" Then
    OutLine = OutLine & " TAB(51), " & " NONE "
    Else
    OutLine = OutLine & "TAB(51)," & " Trim(MyArray(J, 25)), "
    End If

    PrintLine(1, OutLine)

    orders.txt TAB(2), Trim(MyArray(J, 38)), TAB(51), NONE
    Thanks

  2. #2
    Junior Member
    Join Date
    Apr 2003
    Location
    India
    Posts
    30
    Try This

    VB Code:
    1. If LCase(Trim(MyArray(J, 45))) = "yes" Then
    2. OutLine = TAB(2) & "," &  Trim(MyArray(J, 38)) & ", "
    3. End If
    4.  
    5. If LCase(Trim(MyArray(J, 37))) = "new" Then
    6. OutLine = OutLine & TAB(51) & ", " & " NONE "
    7. Else
    8. OutLine = OutLine & TAB(51) & "," &  Trim(MyArray(J, 25)) & ", "
    9. End If

  3. #3
    Hyperactive Member sw_is_great's Avatar
    Join Date
    Nov 2003
    Posts
    330
    the problem lies here
    "TAB(2)," & " Trim(MyArray(J, 38)), "

    it should be like TAB(2) & "," & Trim(MyArray(J, 38)) & ","
    Regards

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Apr 2003
    Location
    Florida
    Posts
    18
    Well my guess is that the TAB(2) function is only recognized within the Print or PrintLine functions. It probably may be a work around this, but I have not figure it out yet.
    Thanks

Posting Permissions

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



Click Here to Expand Forum to Full Width