'import from foxpro return error file is not exist reasons

My code:

    fileName = GETFILE('XLS')
   IF LEN(ALLTRIM(fileName)) < 1 THEN 
   MESSAGEBOX("ôàéë íå âûáðàí",1)
   RETURN
   endif
fileLength = GETWORDCOUNT(fileName,"\")
fileNumber = GETWORDNUM(fileName, fileLength,"\")
lc_f = GETWORDNUM(fileNumber,1,".")
getFreePosition = ""
indexNumber = 1

DO WHILE indexNumber < fileLength 
    getFreePosition = ALLTRIM(getFreePosition)+ALLTRIM(GETWORDNUM(fileName,indexNumber,"\"))+"\"
    indexNumber = indexNumber + 1
ENDDO 
CREATE CURSOR xlsfile(AccountName CHAR(20), TrafficSourceCommunicationName CHAR(20), CommunicationScheduledFor CHAR(20), CommunicationStartDate CHAR(20), CommunicationTemplate CHAR(20), Fromv CHAR(12), Tov CHAR(12), MessageId CHAR(45), SendAt CHAR(35), CountryPrefix  CHAR(2), CountryName CHAR(16), NetworkName CHAR(21), PurchasePrice CHAR(2), Statusv CHAR(25), Reason CHAR(25), Action CHAR(25), ErrorGroup CHAR(25), ErrorName CHAR(80), DoneAt CHAR(15), Textv CHAR(254), MessagesCount CHAR(2), ServiceName CHAR(16), UserName CHAR(19), SeenAt CHAR(19), Clicks CHAR(19), PairedMessageId CHAR(19), DataPayload CHAR(19))

   IMPORT FROM getFreePosition+lc_f".xls" TYPE XL8

returns error: file is not exist I can't understand. Function GETFILE() gives us options for choosing file and this block works correctly. Where is the mistake?



Solution 1:[1]

Alex,
just add + between lc_f and ".xls" .
It should work fine after that.
Cheers,
Sime
PS In most situations APPEND would suite you better than IMPORT but either
one does the job.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Sime Atanasov