Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Copy from exe to windows
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Installation et configuration
Divers
Thread ID:
00921092
Message ID:
00925085
Vues:
30
Khubaib,
Here sample code based on Your function
c_str = ""
FOR asd = 1 TO 10000
    c_str = c_str + STR(asd,5)+CHR(13)+CHR(10)
NEXT
STRTOFILE(c_str, "MyFile.TXT") 
CREATE CURSOR Table1 (FileName C(20), FileStr M)
INSERT INTO Table1 (FileName, FileStr) VALUES ("MyFile.TXT", FILETOSTR("MyFile.TXT"))
ERASE MyFile.TXT

Declare Integer GetSystemDirectory In Kernel32.Dll ;
                                STRING @lpBuffer, Integer lnSize
lcFolder = Space(255)
lnLength = GetSystemDirectory(@lcFolder,255)
If lnLength>0
   lcFolder = Left(lcFolder,lnLength)
Endif

? ExtractFile("MyFile.TXT","")







Function ExtractFile(c_DllName As String, tcDestPath As String)

    LOCAL lcDestFilename
    IF !USED("table1")
        USE table1 IN 0 
    ENDIF
    SELECT table1
    GO TOP
    LOCATE FOR UPPER(ALLTRIM(Table1.FileName)) == UPPER(ALLTRIM(c_dllname))
    lcDestFilename = ADDBS(ALLTRIM(tcDestPath))+c_dllname
    IF FOUND()
       STRTOFILE(RTRIM(table1.FileStr),lcDestFilename)
    ENDIF
RETURN FILE(lcDestFilename)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform