>I am trying to find the best way since the way I have done things up to this point do not always work 100 percent.
>
>For example I need to do six things:
>1. Copy a file from one directory to another(current to archive)
>2. Use Acrobat automation to mark the archive file 'Historical'.
>3. Delete the current file.
>4. Copy the new file(working to current)
>5. Use Acrobat automation to mark the current file 'Released'.
>6. Delete the working file.
>
>I have all this working but not very efficently. Some times I get an error because a file is not released before preforming an action on it.
>
>My main question is should FOpen/FClose be done within the procedure or at the calling program level?
How do you delete/copy the file? If you call a DOS command, VFP may continue executing, without waiting for the command to complete. Two workarounds are using other commands to copy/delete/etc. (for instance, API, built-in VFP commands, or RUN without the /N parameter), and using a Timer object to postpone a later action.
HTH,
Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)