FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour change an array of files on the fly. SOLVED
Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM
change an array of files on the fly. SOLVED
Posted: Sat Feb 12, 2011 11:31 PM

I have an array of file names in a directory...Created as follows ... directory(c:*.?55)
I then copy the files into another directory.
Say there are 4 files that make up the array:
gl.d55
base.d55
term.d55
gener.p55

All works fine. All files with the 55 are copied into another directory.

But under certain conditions I want to keep the exact same 4 files in the array but I want to copy them to a directory with a different number say 67.
so file gl.d55 should copy as gl.d67
so file base.d55 should copy as base.d67
so file term.d55 should copy as term.d67
so file gener.d55 should copy as gener.d67

I don't know how to do this.
Help please.

Thank you

Harvey
Posts: 603
Joined: Sun May 04, 2008 08:44 PM
Re: change an array of files on the fly.
Posted: Sun Feb 13, 2011 12:22 AM

try use this way:

directory("c:*.*55")

Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM
Re: change an array of files on the fly.
Posted: Sun Feb 13, 2011 12:35 AM

Thanks for the quick response but I solved it.

set up arraof the file with the 55 in the name.
cNewFile := directory("c:\directory*.?55)

Create varible to copy the file:
cCopyFile := substr(cNewFile,0,(len(cNewFile)))

Change the file number 55 to 43.
cCopyFile := left(cCopyfile,len(cCopyfile)-2)+"43"

Works

Thank you

Harvey

Continue the discussion