Results 1 to 40 of 40

Thread: Killing after processing

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2005
    Posts
    277

    Killing after processing

    Is it possible to put a command to kill the process after it has finished. i.e after clicking a command button that writes to a file. when it has finished can I kill that somehow -

    Thanks
    R

  2. #2
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Killing after processing

    You can't kill a process that has already ended.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2005
    Posts
    277

    Re: Killing after processing

    does this make sense then. I click a button that updates my file but it renders all my other command buttons useless and I cant understand why.

    thanks
    R

  4. #4
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Killing after processing

    Try using a DoEvents if you have some loop.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2005
    Posts
    277

    Re: Killing after processing

    It is when this is happening, I will try and have a look for info on what you just suggested.

    Thanks
    R

    VB Code:
    1. Private Sub Command2_Click()
    2. Dim f1 As Integer, xmlpath As String, songpath As String, mp3path As String, f2 As Integer, i As Integer, pos As Integer
    3.     Dim Artist As String, SongName As String, artname As String, fname As String, MyPath As String
    4. Dim mysong As String
    5.  
    6.     Dim mytag As Boolean
    7.    mp3path = "C:\Program Files\mgamerz\XML PLAYER\my_mp3s\"
    8.    xmlpath = "C:\Program Files\mgamerz\XML PLAYER\"
    9.  
    10.  
    11.      
    12.      SongName = Dir(mp3path & "\*.mp3")
    13.      fname = mp3path & SongName
    14.      
    15.             With Form4
    16.    
    17.     While Not Len(SongName) = 0
    18.        
    19. '        Artist = GetMP3Tag(fname)
    20.                 If Not i = 0 Then
    21.                     Load .Label1(i): Load .Text1(i)
    22.                     .Label1(i).Top = .Label1(i - 1).Top + 350
    23.                     .Text1(i).Top = .Text1(i - 1).Top + 350
    24.                     .Label1(i).Visible = True: .Text1(i).Visible = True
    25.                    
    26.                 End If
    27.                
    28.                 .Label1(i) = SongName
    29.                 mytag = GetMP3Tag(fname)
    30.                 .Text1(i) = RTrim(MP3Info.sArtist)
    31.                      
    32.  
    33.         SongName = Dir
    34.              fname = mp3path & SongName
    35.  
    36.         i = i + 1
    37.    
    38.     Wend
    39.                 .Height = .Text1(.Text1.Count - 1).Top + 1600
    40.                 .TAG = mp3path
    41.                 MDIForm1.Caption = "Close This Form to Update XML Playlist"
    42.                 .Show
    43. '                .WindowState = 2
    44.             End With
    45.     TAG = "wait"
    46.     While TAG = "wait"
    47.     DoEvents
    48.     Wend
    49.    
    50.      
    51.    i = 1
    52.      f2 = FreeFile
    53.     Open mp3path & "mp3.txt" For Output As #f2
    54.      f1 = FreeFile
    55.      
    56.     Open xmlpath & "audiolist.xml" For Output As #f1
    57.    
    58.    
    59.     Print #f1, "<?xml version=""1.0""?>"
    60.     Print #f1, "<songs>"
    61.     SongName = Dir(mp3path & "\*.mp3")
    62.     i = 1
    63.     While Not Len(SongName) = 0
    64.        
    65.         ' if you can return the name of the artist you put the code in here
    66.  
    67.                mytag = GetMP3Tag(mp3path & SongName)
    68.              'pos = InStr(mytag, "\")
    69.              mytag = Replace(mytag, "\", "/")
    70. Do While InStr(mytag, " ")
    71.   mytag = Replace(mytag, " ", "")
    72. Loop
    73.  
    74.              Artist = RTrim(MP3Info.sArtist)
    75.              If Len(Artist) = 0 Then Artist = "UNKOWN"
    76.                  
    77.                  
    78.               MyPath = Right(mp3path, (Len(mp3path) - Len(xmlpath))) & " " & SongName
    79.        
    80.              MyPath = Replace(MyPath, "\", "/")
    81.              
    82.  
    83.            MyPath = Replace(MyPath, " ", "", 1, 1)
    84.            
    85.            mysong = Left$(SongName, Len(SongName) - 4)
    86.  
    87.            
    88.        songpath = "<song path=""" & MyPath & """ artist=""" & Artist & """ title=""" & mysong & """/> "
    89.  
    90.        
    91.         Print #f1, songpath
    92.         Print #f2, SongName
    93.         Sleep 100
    94.         SongName = Dir
    95.    
    96.     Wend
    97.  
    98.     Print #f1, "</songs>"
    99. Close
    100.  
    101. End Sub

  6. #6
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Killing after processing

    I would put one DoEvents into each While/Wend loop.

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2005
    Posts
    277

    Re: Killing after processing

    not too sure where to add it or how to do that - would it just need to be in the update XML code?

    Thanks
    R

  8. #8
    Admodistrator |2eM!x's Avatar
    Join Date
    Jan 2005
    Posts
    3,900

    Re: Killing after processing

    doevents let your computer do other things while its doing your code, so it wont freeze. Put it rigth before the wend, remember its one word-doevents

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2005
    Posts
    277

    Re: Killing after processing

    I'll need to do some reading into that thanks

  10. #10

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2005
    Posts
    277

    Re: Killing after processing

    will I be able to add the do events to the exixting code I posted or will it all need changing,

    Thanks
    R

  11. #11
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Killing after processing

    I'll format your code for you, so you can see where it would go

    VB Code:
    1. Private Sub Command2_Click()
    2.   Dim f1 As Integer, xmlpath As String, songpath As String, mp3path As String, f2 As Integer, i As Integer, pos As Integer
    3.   Dim Artist As String, SongName As String, artname As String, fname As String, MyPath As String
    4.   Dim mysong As String
    5.   Dim mytag As Boolean
    6.   mp3path = "C:\Program Files\mgamerz\XML PLAYER\my_mp3s\"
    7.   xmlpath = "C:\Program Files\mgamerz\XML PLAYER\"
    8.   SongName = Dir(mp3path & "\*.mp3")
    9.   fname = mp3path & SongName
    10.   With Form4
    11.     While Not Len(SongName) = 0
    12.       If Not i = 0 Then
    13.         Load .Label1(i): Load .Text1(i)
    14.         .Label1(i).Top = .Label1(i - 1).Top + 350
    15.         .Text1(i).Top = .Text1(i - 1).Top + 350
    16.         .Label1(i).Visible = True: .Text1(i).Visible = True
    17.       End If
    18.       .Label1(i) = SongName
    19.       mytag = GetMP3Tag(fname)
    20.       .Text1(i) = RTrim(MP3Info.sArtist)
    21.       SongName = Dir
    22.       fname = mp3path & SongName
    23.       i = i + 1
    24.     Wend
    25.     .Height = .Text1(.Text1.Count - 1).Top + 1600
    26.     .TAG = mp3path
    27.     MDIForm1.Caption = "Close This Form to Update XML Playlist"
    28.     .Show
    29.   End With
    30.   f2 = FreeFile
    31.   Open mp3path & "mp3.txt" For Output As #f2
    32.     f1 = FreeFile
    33.     Open xmlpath & "audiolist.xml" For Output As #f1
    34.       Print #f1, "<?xml version=""1.0""?>"
    35.       Print #f1, "<songs>"
    36.       SongName = Dir(mp3path & "\*.mp3")
    37.       i = 1
    38.       While Not Len(SongName) = 0
    39.         [B]DoEvents[/B]  '  <---------------------------- HERE \\
    40.         mytag = GetMP3Tag(mp3path & SongName)
    41.         mytag = Replace(mytag, "\", "/")
    42.         Do While InStr(mytag, " ")
    43.           mytag = Replace(mytag, " ", "")
    44.         Loop
    45.         Artist = RTrim(MP3Info.sArtist)
    46.         If Len(Artist) = 0 Then Artist = "UNKOWN"
    47.           MyPath = Right(mp3path, (Len(mp3path) - Len(xmlpath))) & " " & SongName
    48.            MyPath = Replace(MyPath, "\", "/")
    49.            MyPath = Replace(MyPath, " ", "", 1, 1)
    50.            mysong = Left$(SongName, Len(SongName) - 4)
    51.           songpath = "<song path=""" & MyPath & """ artist=""" & Artist & """ title=""" & mysong & """/> "
    52.         Print #f1, songpath
    53.         Print #f2, SongName
    54.         Sleep 100
    55.         SongName = Dir
    56.       Wend
    57.       Print #f1, "</songs>"
    58.      Close #f1
    59.      close #f2
    60. End Sub

  12. #12

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2005
    Posts
    277

    Re: Killing after processing

    Thanks for that but Im still unsure of the next step. I have been studying my books but I just cant seem to fathom it out. I thought this would be the process that needs to end before anything else can be carried out.

    Sorry to be a nuisance as usual
    Rob

  13. #13
    Junior Member
    Join Date
    Mar 2005
    Location
    Calgary Alberta
    Posts
    17

    Re: Killing after processing

    That would suck. Say you are playing music in a game. until the music finishes you cannot play the game? Yeah, it would make you mute your game more often. It is my understanding that code runs from top to bottom in every event, but multiple events can be running at the same time.

  14. #14
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Killing after processing

    What do you want to do while the computer is saving files? You could set enabled = false for all of the butons so that they cannot be clicked until the save finishes.

    Explain what you want to be able to do while the computer is saving the files?

  15. #15

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2005
    Posts
    277

    Re: Killing after processing

    what I want is that when the program has finished writing the XML file then the user can add more files or delete files but currently after the button is clicked to update the XML file the other buttons stop functioning.

    Thanks
    Rob

  16. #16

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2005
    Posts
    277

    Re: Killing after processing

    would it be easier if I made it into 2 seperate programs?

  17. #17

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2005
    Posts
    277

    Re: Killing after processing

    If set enabled = false for all of the butons would that allow them to work when the xml file has been processed?

    thanks
    R

  18. #18
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Killing after processing

    You turn them back on when the code has finished. You could also search for LockWindowUpdate, which prevents doing anything until Unlock Window

  19. #19

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2005
    Posts
    277

    Re: Killing after processing

    would I put the code to disable the buttons at the beginning of the code and then enable them at the end?

  20. #20
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Killing after processing

    Yes. That would prevent them doing anthing else while the code is executing.

  21. #21

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2005
    Posts
    277

    Re: Killing after processing

    thanks for that, I havent goot VB installed on this machine because Ive been trying to find it in books but am I right in thinking that they wiil need to be disabled before this line

    VB Code:
    1. Dim f1 As Integer, xmlpath As String, songpath As String, mp3path As String, f2 As Integer, i As Integer, pos As Integer

    and then enable them after this line

    VB Code:
    1. Print #f1, "</songs>"
    2.      Close #f1
    3.      close #f2

    Is it only because the code hasn't finished executing that the buttons wont work currently

  22. #22
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Killing after processing

    You will like this. I have just been changing it to suit you. Also saved it for next time, so I don't have to search the forums.

    VB Code:
    1. Option Explicit
    2. Private Sub Form_Load()
    3.   Dim ctlAll As Control
    4.     For Each ctlAll In Me.Controls
    5.         If TypeOf ctlAll Is CommandButton Then
    6.           ctlAll.Enabled = False
    7.         End If
    8.     Next
    9. End Sub

    Turns of ALL buttons in the form. Just change it to TRUE to turn them back on.

  23. #23

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2005
    Posts
    277

    Re: Killing after processing

    Thanks very much as I say I cannot try it until later because I have no access to VB but I will keep you posted. It is really appreciated.

    Rob

  24. #24

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2005
    Posts
    277

    Re: Killing after processing

    Just a quickie when I have added that to my code where will I need to add the code to enable them - Thanks very much again
    R

  25. #25
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Killing after processing

    Same loop from above, but change it to this:

    VB Code:
    1. ctlAll.Enabled = True

  26. #26

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2005
    Posts
    277

    Re: Killing after processing

    if the first bit of code goes on the form load where will the second go. Sorry I just want to get it clear because I want to try and not bother you later because I think Ive taken up enough of your time.

    Thanks
    R

  27. #27
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Killing after processing

    Just like you said in Post #21. Disable them at the top and re-enable them at the bottom. Substitue the correct form name for your app. I used Form1 in my sample, but you probably have it named something else.

  28. #28

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2005
    Posts
    277

    Re: Killing after processing

    Thanks very much

  29. #29

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2005
    Posts
    277

    Re: Killing after processing

    Right, I have successfully added the code and got the buttons to be disabled when the file is bieng written but after the file has been written the buttons still cease to work. If I wanted to add or delete files I need to close the app and restart it.

    Any other suggestions that could be caussing this.

    Thanks
    R

  30. #30
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Killing after processing

    did you run the code to enable them?

    put a breakpoint in to make sure it gets there.

    are the buttons enabled?

  31. #31

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2005
    Posts
    277

    Re: Killing after processing

    the buttons disable when the filea are bieng added and then they are enabled again Here is where I added them to my code

    VB Code:
    1. Private Sub Command2_Click()
    2.  
    3.  
    4. Dim f1 As Integer, xmlpath As String, songpath As String, mp3path As String, f2 As Integer, i As Integer, pos As Integer
    5.     Dim Artist As String, SongName As String, artname As String, fname As String, MyPath As String
    6. Dim mysong As String
    7.  
    8.     Dim mytag As Boolean
    9.     Dim ctlAll As Control
    10.    
    11.     For Each ctlAll In Me.Controls
    12.         If TypeOf ctlAll Is CommandButton Then
    13.           ctlAll.Enabled = False
    14.         End If
    15.     Next
    16.  
    17.  
    18.    
    19.    
    20.    mp3path = "C:\Program Files\mgamerz\XML PLAYER\my_mp3s\"
    21.    xmlpath = "C:\Program Files\mgamerz\XML PLAYER\"
    22.  
    23.  
    24.      
    25.      SongName = Dir(mp3path & "\*.mp3")
    26.      fname = mp3path & SongName
    27.      
    28.             With Form4
    29.    
    30.     While Not Len(SongName) = 0
    31.        
    32. '        Artist = GetMP3Tag(fname)
    33.                 If Not i = 0 Then
    34.                     Load .Label1(i): Load .Text1(i)
    35.                     .Label1(i).Top = .Label1(i - 1).Top + 350
    36.                     .Text1(i).Top = .Text1(i - 1).Top + 350
    37.                     .Label1(i).Visible = True: .Text1(i).Visible = True
    38.                    
    39.                 End If
    40.                
    41.                 .Label1(i) = SongName
    42.                 mytag = GetMP3Tag(fname)
    43.                 .Text1(i) = RTrim(MP3Info.sArtist)
    44.                      
    45.  
    46.         SongName = Dir
    47.              fname = mp3path & SongName
    48.  
    49.         i = i + 1
    50.    
    51.     Wend
    52.                 .Height = .Text1(.Text1.Count - 1).Top + 1600
    53.                 .TAG = mp3path
    54.                 MDIForm1.Caption = "Close This Form to Update XML Playlist"
    55.                 .Show
    56. '                .WindowState = 2
    57.             End With
    58.     TAG = "wait"
    59.     While TAG = "wait"
    60.     DoEvents
    61.     Wend
    62.    
    63.      
    64.    i = 1
    65.      f2 = FreeFile
    66.     Open mp3path & "mp3.txt" For Output As #f2
    67.      f1 = FreeFile
    68.      
    69.     Open xmlpath & "audiolist.xml" For Output As #f1
    70.    
    71.    
    72.     Print #f1, "<?xml version=""1.0""?>"
    73.     Print #f1, "<songs>"
    74.     SongName = Dir(mp3path & "\*.mp3")
    75.     i = 1
    76.     While Not Len(SongName) = 0
    77.        
    78.         ' if you can return the name of the artist you put the code in here
    79.  
    80.                mytag = GetMP3Tag(mp3path & SongName)
    81.              'pos = InStr(mytag, "\")
    82.              mytag = Replace(mytag, "\", "/")
    83. Do While InStr(mytag, " ")
    84.   mytag = Replace(mytag, " ", "")
    85. Loop
    86.  
    87.              Artist = RTrim(MP3Info.sArtist)
    88.              If Len(Artist) = 0 Then Artist = "UNKOWN"
    89.                  
    90.                  
    91.               MyPath = Right(mp3path, (Len(mp3path) - Len(xmlpath))) & " " & SongName
    92.        
    93.              MyPath = Replace(MyPath, "\", "/")
    94.              
    95.  
    96.            MyPath = Replace(MyPath, " ", "", 1, 1)
    97.            
    98.            mysong = Left$(SongName, Len(SongName) - 4)
    99.  
    100.            
    101.        songpath = "<song path=""" & MyPath & """ artist=""" & Artist & """ title=""" & mysong & """/> "
    102.  
    103.        
    104.         Print #f1, songpath
    105.         Print #f2, SongName
    106.         Sleep 100
    107.         SongName = Dir
    108.    
    109.     Wend
    110.      
    111.     Print #f1, "</songs>"
    112.     For Each ctlAll In Me.Controls
    113.         If TypeOf ctlAll Is CommandButton Then
    114.           ctlAll.Enabled = True
    115.         End If
    116.     Next
    117. Close
    118.  
    119. End Sub

  32. #32
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Killing after processing

    CLOSE should be Close #F1

    what happened to the formatted code that I made


    So does it work correctly? That looks right.

  33. #33

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2005
    Posts
    277

    Re: Killing after processing

    Hi I have used the formatted code I just didn't want to mess it up which is usually what I normally do. I have made the changes you suggested. as below but I add a number of songs, Add some more and then the buttons just will not do anything. It allows me to add songs once or twice but then they cease to work.

    Thanks
    R

    VB Code:
    1. Private Sub Command2_Click()
    2.   Dim f1 As Integer, xmlpath As String, songpath As String, mp3path As String, f2 As Integer, i As Integer, pos As Integer
    3.   Dim Artist As String, SongName As String, artname As String, fname As String, MyPath As String
    4.   Dim mysong As String
    5.   Dim mytag As Boolean
    6.   Dim ctlAll As Control
    7.    
    8.     For Each ctlAll In Me.Controls
    9.         If TypeOf ctlAll Is CommandButton Then
    10.           ctlAll.Enabled = False
    11.         End If
    12.     Next
    13.  
    14.  
    15.   mp3path = "C:\Program Files\mgamerz\XML PLAYER\my_mp3s\"
    16.   xmlpath = "C:\Program Files\mgamerz\XML PLAYER\"
    17.   SongName = Dir(mp3path & "\*.mp3")
    18.   fname = mp3path & SongName
    19.   With Form4
    20.     While Not Len(SongName) = 0
    21.       If Not i = 0 Then
    22.         Load .Label1(i): Load .Text1(i)
    23.         .Label1(i).Top = .Label1(i - 1).Top + 350
    24.         .Text1(i).Top = .Text1(i - 1).Top + 350
    25.         .Label1(i).Visible = True: .Text1(i).Visible = True
    26.       End If
    27.       .Label1(i) = SongName
    28.       mytag = GetMP3Tag(fname)
    29.       .Text1(i) = RTrim(MP3Info.sArtist)
    30.       SongName = Dir
    31.       fname = mp3path & SongName
    32.       i = i + 1
    33.     Wend
    34.     .Height = .Text1(.Text1.Count - 1).Top + 1600
    35.     .TAG = mp3path
    36.     MDIForm1.Caption = "Close This Form to Update XML Playlist"
    37.     .Show
    38.   End With
    39.   f2 = FreeFile
    40.   Open mp3path & "mp3.txt" For Output As #f2
    41.     f1 = FreeFile
    42.     Open xmlpath & "audiolist.xml" For Output As #f1
    43.       Print #f1, "<?xml version=""1.0""?>"
    44.       Print #f1, "<songs>"
    45.       SongName = Dir(mp3path & "\*.mp3")
    46.       i = 1
    47.       While Not Len(SongName) = 0
    48.         DoEvents  '  <---------------------------- HERE \\
    49.         mytag = GetMP3Tag(mp3path & SongName)
    50.         mytag = Replace(mytag, "\", "/")
    51.         Do While InStr(mytag, " ")
    52.           mytag = Replace(mytag, " ", "")
    53.         Loop
    54.         Artist = RTrim(MP3Info.sArtist)
    55.         If Len(Artist) = 0 Then Artist = "UNKOWN"
    56.           MyPath = Right(mp3path, (Len(mp3path) - Len(xmlpath))) & " " & SongName
    57.            MyPath = Replace(MyPath, "\", "/")
    58.            MyPath = Replace(MyPath, " ", "", 1, 1)
    59.            mysong = Left$(SongName, Len(SongName) - 4)
    60.           songpath = "<song path=""" & MyPath & """ artist=""" & Artist & """ title=""" & mysong & """/> "
    61.         Print #f1, songpath
    62.         Print #f2, SongName
    63.         Sleep 100
    64.         SongName = Dir
    65.       Wend
    66.       Print #f1, "</songs>"
    67.       For Each ctlAll In Me.Controls
    68.         If TypeOf ctlAll Is CommandButton Then
    69.           ctlAll.Enabled = True
    70.         End If
    71.     Next
    72.  
    73.      Close #f1
    74.      Close #f2
    75. End Sub

  34. #34
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Killing after processing

    I'm not sure. Add some Debug.Print statements to tell you where the program is executing "Reading Files" "Writing XML" so we can figure out where it is messing up. You don't have any other timers or anything that could be interrupting the code, do you? What about Error Traps? Do you have On Error Goto 0 to turn off error traps?

  35. #35

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2005
    Posts
    277

    Re: Killing after processing

    Ive never done that before is it difficult to do?

  36. #36
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Killing after processing

    Just place a few lines in your code, like

    VB Code:
    1. On Error Goto 0  ' At the top of the module somewhere
    2.  
    3. debug.print "Reading XML file"
    4. -
    5. -
    6. -
    7. debug.print "Writing file#1"
    8. -
    9. -
    10. -
    11. debug.print "Writing file#2"
    12. -
    13. -
    14. -

    As the program is running, it will print the line it runs accross in the debug window of your ide (and not do anything when it's compiled)
    Use the on error goto 0 to make sure that any error is not sending the code somewhere else while the buttons are disabled. You could also try not disabling the buttons and seeing if the buttons don't work after a few times through.

  37. #37

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2005
    Posts
    277

    Re: Killing after processing

    I cannot find any errors. Is it possible that you could have a look through it when you get time if I attach it as a zip file here? I may be missing something obvoius.

    Thanks
    R

  38. #38
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Killing after processing

    It wouldnot run on my computer without all of the necessary files. If you have any error traps that aren't set to 0, then any error in your code would go to that error trap. if the buttons were disabled at the time, that would explain them not working. I don't think I could find anything by just looking through the code. You have to find an error, and determine where it is occurring by stepping through it, or printing out messages, or whatever you can do to help you.

    I've done a lot of this code, and my code usually works many times as long as it works the first time.

    Good Luck!

  39. #39

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2005
    Posts
    277

    Re: Killing after processing

    Thanks David for all your help throughout this, I think I have found the problem it's either the length of the file names or the amount of files I have been trying to add. I have managed to add 93 file so far. I have added them in 10's and they all have short names. So maybe thats what it was all along. I dont know if that makes sense but again thanks very much for all your help.

    Cheers
    ?Rob

  40. #40
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Killing after processing

    I think someone said that FSO had a limited number of files that it allowed. Now that you say that it rang a bell. Look for FSO.Files or something like that.
    The buffer is too small for that many files.

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