vijay mysore
New Member
I am new to progress I want to copy a file the edit it and move it using progress script can any help me on how to do this?
[FONT=courier new]DEFINE VARIABLE iTemp AS INTEGER NO-UNDO.
DEFINE VARIABLE cSrcFileName AS CHARACTER NO-UNDO.
DEFINE VARIABLE cTrgFileName AS CHARACTER NO-UNDO FORMAT "x(60)" VIEW-AS FILL-IN.
DEFINE VARIABLE OKpressed AS LOGICAL NO-UNDO INITIAL TRUE.
/*1. Copy File from Location-1 to Location-2 */
UPDATE cTrgFileName WITH FRAME copyframe.
SYSTEM-DIALOG GET-FILE cSrcFileName
TITLE "Choose File to Copy"
MUST-EXIST
USE-FILENAME
UPDATE OKpressed.
IF OKpressed = FALSE THEN RETURN NO-APPLY.
OS-COPY VALUE(cSrcFileName) VALUE(cTrgFileName).
/* 2. Edit the copied File */
RUN ShellExecuteA IN THIS-PROCEDURE
(0,
"open",
cTrgFileName,
"",
"",
1,
OUTPUT iTemp).
PROCEDURE ShellExecuteA EXTERNAL "shell32" :
define input parameter hwnd as long.
define input parameter lpOperation as char.
define input parameter lpFile as char.
define input parameter lpParameters as char.
define input parameter lpDirectory as char.
define input parameter nShowCmd as long.
define return parameter hInstance as long.
END PROCEDURE.
/*3. Move the copied file*/
ASSIGN cSrcFileName = cTrgFileName.
UPDATE cTrgFileName WITH FRAME copyframe.
OS-COMMAND SILENT MOVE VALUE(cSrcFileName) VALUE (cTrgFileName).
[/FONT]
Thanks for the script.
how can I make the changes without a window.....something like replace.
My file contents are "01" "Claims" 22/07/11 22/07/11 "EUR" "14"
I just want to change the date in this file to 23/07/11