Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Different Users, different .dbc - same Computer
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00113800
Message ID:
00114146
Vues:
46
>>>FUNCTION RenDir
>>>
>>>LPARAMETERS pcoldname, pcnewname
>>>
>>>DECLARE SHORT MoveFile IN Win32API;
>>> STRING @lpcurrentname, STRING @lpnewname
>>>LOCAL lcoldname, lcnewname, llresult
>>>lcoldname = pcoldname
>>>lcnewname = pcnewname
>>>llresult = (MoveFile(@lcoldname, @lcnewname) # 0)
>>>RETURN llresult
>>>
>>>The thing I would caution you about is to make sure that the directory is named back when the program terminates. You might also want to include a check for this directory before you try to rename. Its presence may be indicative a a previous instance abnormally terminating. This would require that the directory's real be restored. Of course, changing the name back and forth can be accomplished through use of this function.
>>>
>>>hth,
>>
>>
>>George,
>>
>>Once again - thanks, it works.
>>By the way, where can I find info on writing API calls. Focus.??? I know there are alot of calls in that code. I am just hesitant to use it due to my inexperience in this area. Is there a reference manual I should purchase or available thats not too difficult to decipher?
>>
>>Robert
>
>Robert,
>
>There's a duh on my part in the above. Change the:
>llresult = (MoveFile(@lcoldname, @lcnewname) # 0)
>to:
>llresult = (MoveFile(@lcoldname, @lcnewname) = 0)
>Then llresult will return the right value.

No it won't, you idiot.

Robert, disregard the previous post. MoveFile returns a logical value, and 0 means failure. I shouldn't ever question myself on Fridays.:-(

The function as originally posted is correct.
George

Ubi caritas et amor, deus ibi est
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform