Welcome! Log In Create A New Profile

Advanced

HDeleteFile Errors

Posted by Jeff Graham 
Jeff Graham
HDeleteFile Errors
April 02, 2009 07:29PM
Hi All,

I have added code to create temporary work files on a per user basis using fTempFile. I do this in the Project code after the connection is open which may be HF Classic or HF C/S. I save the defined name and the temp name in a global string. Then I do an HChangeName.

At the closing of the project, I close all files with HClose("*"). Then I do either an HDeleteFile or fDeleteFile depending on C/S or not. However, the work files are used in queries so sometimes I get errors in C/S with the HDeleteFile saying that it can't delete the file.

I know we are missing some HCancelDeclaration calls but I would have thought that closing out all the windows would implicitly cancel all queries.

Is there a generalized way to clear all queries that remain active so HDeleteFile will not fail?

Thanks for any suggestions,
Fabrice Harari
Re: HDeleteFile Errors
April 03, 2009 02:25PM
Hi Jeff..

I do not think that something like that exists... But YOU can probably do it quite easily by overwriting the hexecutequery and hcancelquery commands:
- create the corresponding global procedures (same name)
- in them, do the original call with wl.hexecutequery(...) and wl.hcancelquery
- and of course in them also add (execute) the query name in a global associative array and remove (cancel) it from there

When you want to close all remaining queries, you just loop on the remaining one in the associative array...

That should do the trick

Best regards

Jeff Graham
Re: HDeleteFile Errors
April 03, 2009 03:23PM
Hi Fabrice,

That is a very clever idea! I will try that out.

I wish I could attend the conference. I will buy copies of all the materials offered from the conference.

Thanks,
Jeff
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: