Hello group,
I have some strange behavior in the putfile() function and can't see what goes wrong. Here is a part of my code:
lExcel := .T. && Ihave checked earlier that there is excel available on the computer
cIniBestand := 'beplantingslijst voor Rene Koot'
cSaveBestand := 'plantlijst'
SELECT plantlijst
IF lExcel
cBestand := ALLTRIM(PutFile( { { 'Microsoft Excel-werkmap (*.' + cExcelExt + ')','*.' + cExcelExt + ''}, { 'Tekstbestand (*.txt)', '*.txt'}, {'Database (*.dbf)', '*.dbf' } }, 'Sla selectie op als:', cDocument, .T., cIniBestand ))
ELSE
cBestand := ALLTRIM(PutFile( { { 'Tekstbestand (*.txt)', '*.txt'}, {'Database (*.dbf)', '*.dbf' } }, 'Sla selectie op als:', cDocument, .T., cIniBestand ))
ENDIF
IF !EMPTY(cBestand)
cExtBestand := UPPER(ALLTRIM(SUBSTR(cBestand,RAT('.',cBestand)+1)))
IF cExtBestand == 'TXT'
SaveToTxt(cSaveBestand, cBestand)
ELSEIF cExtBestand == 'XLS' .OR. cExtBestand == 'XLSX'
IF lEtiket
IF nWindow == 3
RKPK_SelectExportFields()
ENDIF
ENDIF
SaveToXls(cSaveBestand, cBestand)
ELSEIF cExtBestand == 'DBF'
SaveToDbf(cSaveBestand, cBestand)
ENDIF
ENDIF
When I don't change the name of the file in the putfile function everything works well, but if I type another name, the extention is not checked OK.
Hope someone has an solution.
Regards,
René Koot