Information générale
Catégorie:
Codage, syntaxe et commandes
>For tmpfiles directory, there's an easy shortcut: Somewhere at startup of the app, I issue a thing like this:
>
>public _work
>create curs dummy (c l)
>_work=addbs(justpath(dbf()))
>use
>
>Then, later in the app, anywhere I need a temp filename, I use tempfilename=_work+sys(3). I don't give it an extension, because it may want to be an index, .dbf or whatever, so it'll get one when it needs one. Most of the time I actually hardcode it as
>Public _work
>_work="C:\Scratch\"
>though I know I should be using the full approach - but then, I take care every machine has the C:\Scratch\ directory.
>
>The reason why the other scenario might not work always is that it may not really create a .tmp file for the cursor, but use a filtered view instead. Worked for me practically always, probably because my SQL's were not straightforward and almost always had some added fields, so I don't remember ever getting a filtered view in FPD instead of a real-file-on-the-disk cursor. You may try adding a dummy field to your SQL selects where the other scenario doesn't work.
Dragan,
You certainly know a couple of good FPD tricks. I will try it. Thanks.
Alex
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement