Results 1 to 5 of 5

Thread: Bug in code. Help?

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2004
    Location
    Florida
    Posts
    44

    Bug in code. Help?

    Theres a bug in my code for recieving remote directory list.. For some reason it seems to put an "F" at the end of the file name and I also can't access this file. I hope someone can help cause I've been banging my head over this... You can see screenshots and download the project here:http://www.shepstype-r.com/rfm_error/index.php
    I think this is where it is...
    VB Code:
    1. Public Sub ChangeDirectory(ByVal NewDirectory As String)
    2. ' "CHG"/Directory
    3. If Not bCon Then Exit Sub
    4. If Len(NewDirectory) = 0 Then Exit Sub
    5. Dim sPacket As String
    6. sPacket = "CHG" & DELIM & NewDirectory
    7. frmMain.sckMain.SendData sPacket & EOP
    8. End Sub
    9.  
    10. Public Sub ParseChangeDirectory(ByVal Data As String)
    11. On Error Resume Next
    12. ' Successfull: "CHG"/"Directory"/D:Folder1|F:File1*123|F:File2*123
    13. ' Folder doesn't exist: "CHG"/"Directory"/"NonExist"
    14. Dim sBuff() As String: sBuff() = Split(Data, DELIM)
    15. If sBuff(2) = "NonExist" Then
    16.     frmMain.StatusBar.SimpleText = "Status: Error changing directory; directory does not exist."
    17.     Exit Sub
    18. Else
    19.     sCurDir = sBuff(1)
    20.     frmMain.txtCurDir.Text = sCurDir
    21.     Dim sDir() As String, sType() As String, lLoop As Long, sTmpDir As String, sSize() As String
    22.     sDir() = Split(sBuff(2), "|")
    23.     With frmMain
    24.         .TVDir.Nodes.Clear
    25.         .LVFile.ListItems.Clear
    26.         For lLoop = 0 To UBound(sDir)
    27.             sTmpDir = sDir(lLoop)
    28.             If Len(sTmpDir) > 0 Then
    29.                 sType() = Split(sTmpDir, "*?*")
    30.                 If sType(0) = "D" Then
    31.                     .TVDir.Nodes.Add , , sType(1), sType(1), "Dir"
    32.                 ElseIf sType(0) = "F" Then
    33.                     sSize() = Split(sType(1), "*")
    34.                     .LVFile.ListItems.Add , , sSize(0), , "FN"
    35.                     .LVFile.ListItems(.LVFile.ListItems.Count).ListSubItems.Add , , BytesToKB(CDbl(sSize(1)))
    36.                     .LVFile.ListItems(.LVFile.ListItems.Count).ListSubItems(1).Bold = True
    37.                 End If
    38.             End If
    39.         Next lLoop
    40.         .LVFile.Refresh
    41.     End With
    42. End If
    43. End Sub
    Thanks for any help or comments/suggestions!!!!!
    $hep
    Last edited by $hep; Jun 27th, 2004 at 03:11 PM.

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