CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 17 of 17

Thread: Kill file issue

  1. #16
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: Kill file issue

    Actually using the get and put one record at a time would be fine, no problem there.

    I agree that you should not use hard coded filenumbers, should use the freefile function to make sure you get a filenumber that is not in use each time.

    As for the issue with a 0 this would not be written to the file nor would it be read in from the file and you have not shown any related code so hard to even guess at that.


    Another tip. Always use Option Explicit in your code [as shown in post #7] this will flag any miss spelled variable names right away and point you to such a problem.
    Always use [code][/code] tags when posting code.

  2. #17
    Join Date
    Dec 2001
    Posts
    6,332

    Re: Kill file issue

    I think DataMiser got it right in an early post. There may not have been anything necessarily wrong with your code, except that the file may not yet have been deleted when the program attempted to rename the new file. This can occur because the Kill command doesn't wait for the action to complete before returning. I've seen this happen before, and as I recall, the easy fix was to use a DoEvents statement after the Kill command, so that the file is gone before the renaming is attempted.
    Last edited by WizBang; April 25th, 2013 at 03:38 PM.
    Please remember to rate the posts and threads that you find useful.
    How can something be both new and improved at the same time?

Page 2 of 2 FirstFirst 12

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

Featured