>>>copy file ("a.txt") to ("c:\program files\my application\a.txt") >>>>>>
>>c = [copy file a.txt to "c:\program files\my application\a.txt"]
>>&c
>>
FUNCTION CopyFile LPARAMETERS lpcFile1,lpcFile2,lpcSafety * lpcfile1 - source file * lpcfile2 - destination file * [lpcsafety] - overwrite default on or off for set safety LOCAL llReturn IF PCOUNT()>=2 AND ; VARTYPE(m.lpcFile1)="C" AND ; NOT EMPTY(m.lpcFile1) AND ; FILE(m.lpcFile1) AND ; VARTYPE(m.lpcFile2)="C" ; THEN LOCAL lcSafety m.lcSafety = SET("Safety") IF VARTYPE(m.lpcSafety)=[C] AND ; NOT EMPTY(m.lpcSafety) AND ; INLIST(m.lpcSafety,'ON','OFF','on','off') ; THEN SET SAFETY &lpcSafety ENDIF LOCAL lcCmd m.lcCmd = [copy file "] + m.lpcfile1 + [" to "] + m.lpcfile2 + [" ] &lcCmd m.llReturn = FILE(m.lpcFile2) SET SAFETY &lcSafety ENDIF RETURN m.llReturn ENDFUNC && CopyFileSo, from the above example, the lines:
LOCAL lcCmd m.lcCmd = [copy file "] + m.lpcfile1 + [" to "] + m.lpcfile2 + [" ] &lcCmdCan be reduced to:
copy file (m.lpcfile1) to (m.lpcfile2)Yes, that is more concise. Thank you. I've learned alot since the begining of the thread.
"Do not let any unwholesome talk come out of your mouths,
but only what is helpful for building others up according to their needs,
that it may benefit those who listen."
- Ephesians 4:29-30 NIV
Dare to Question -- Care to Answer
Time is like water in a sponge, as long as you are willing you can always squeeze some.
--Lu Xun, Father of Modern Chinese Literature