Hi,
I have been using Rexx scripting for a little while for very basic scripts for "copying & pssting" information from a text file into a third party application.
I tried using the ZocGetFilename commannd, i.e. file= ZocGetFilename(Select file to Upload: ", "*.txt"), but I cannot see to get it to work correctly.
I am trying to amend the script below so that when I run the script it will do the following:
1) Open a window to select the filename to use
2) Get the window to open in a specific default location, i.e. the "ZOC6 Files" folder where the scripts are located
3) Exit the script if a file is not selected, i.e. open command is cancelled.
4) Ignore the first two records within a file if it is selected are these are the header information from the Excel document the text file was generated from.
Any help would be much appreciated
/* REXX */
file = "C:\Users\Name\Documents\ZOC6 Files\User Names.txt"
tabchar = '09'x
do while( lines(file) )
data=LINEIN(file)
Parse Var data v1 (tabchar) v2
CALL ZocSend v1
CALL ZocSend "^M"
CALL ZocSend "f"
CALL ZocSend "^M"
CALL ZocDelay 1
CALL ZocSend "^Z"
CALL ZocDelay 1
CALL ZocSend v1
CALL ZocSend "^I"
CALL ZocDelay 1
CALL ZocSend v2
IF LENGTH(v2) < 20 THEN DO
CALL ZocSend "^I"
END
CALL ZocDelay 1
CALL ZocSend "^M"
CALL ZocSend "a"
CALL ZocSend "^M"
CALL ZocDelay 1
CALL ZocSend "^Z"
CALL ZocDelay 1
END
I have been using Rexx scripting for a little while for very basic scripts for "copying & pssting" information from a text file into a third party application.
I tried using the ZocGetFilename commannd, i.e. file= ZocGetFilename(Select file to Upload: ", "*.txt"), but I cannot see to get it to work correctly.
I am trying to amend the script below so that when I run the script it will do the following:
1) Open a window to select the filename to use
2) Get the window to open in a specific default location, i.e. the "ZOC6 Files" folder where the scripts are located
3) Exit the script if a file is not selected, i.e. open command is cancelled.
4) Ignore the first two records within a file if it is selected are these are the header information from the Excel document the text file was generated from.
Any help would be much appreciated
/* REXX */
file = "C:\Users\Name\Documents\ZOC6 Files\User Names.txt"
tabchar = '09'x
do while( lines(file) )
data=LINEIN(file)
Parse Var data v1 (tabchar) v2
CALL ZocSend v1
CALL ZocSend "^M"
CALL ZocSend "f"
CALL ZocSend "^M"
CALL ZocDelay 1
CALL ZocSend "^Z"
CALL ZocDelay 1
CALL ZocSend v1
CALL ZocSend "^I"
CALL ZocDelay 1
CALL ZocSend v2
IF LENGTH(v2) < 20 THEN DO
CALL ZocSend "^I"
END
CALL ZocDelay 1
CALL ZocSend "^M"
CALL ZocSend "a"
CALL ZocSend "^M"
CALL ZocDelay 1
CALL ZocSend "^Z"
CALL ZocDelay 1
END