Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to concatenate SDF files?
Message
From
01/10/2002 12:06:12
Henry Ravichander
RC Management Systems Inc.
Saskatchewan, Canada
 
 
To
01/10/2002 09:30:36
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00705004
Message ID:
00706422
Views:
45
Hi Cetin:

Thank you for your response.

I got it to work. The code was looking for .dat files while the file to be copied is an SDF type. Once I change the file name to read "Process*.*", the code found the files and copied them.

The only remaining problem is that the file being copied to should also be an SDF type file. How do I accomplish this? Thank you.
>>
>>
LOCAL cConCatString, aBWFiles[1,5], nFiles, i
>>
>>cConCatString = ''
>>nFiles = adir(aBWFiles, "c:\BW\Process*.dat")
>>
>>FOR i = 1 TO nFiles  && this avoids all copies if no files were found
>>      cConCatString = cConCatString + FILETOSTR("c:\BW\" + aBWFiles[i,1])
>>ENDFOR
>>=STRTOFILE(cConCatString,'MyConCatFile.DAT',.F.)  && .T. would append to any existing MyConCatFile.DAT found
>>RELEASE cConCatString  && releases the large string memory allocation
>>
>>Problem now is that nothing is being copied. Second the MyConCatFile appears as a text file and not an sdf type.
>>
>>Thanks
>
>
>
LOCAL array aBWFiles[1]
>local lnFiles, ix
>lnFiles = adir(aBWFiles, "c:\BW\Process*.dat")
>erase ('MyConCatFile.DAT') && erase old if exists
>FOR ix = 1 TO lnFiles  && this avoids all copies if no files were found
>    strtofile(FILETOSTR("c:\BW\" + aBWFiles[ix,1]),'MyConCatFile.DAT',.t.)
>ENDFOR
>
Cetin
- Ravi

True greatness consists in being great in little things.
- Charles Simmons
Previous
Reply
Map
View

Click here to load this message in the networking platform