Can't get good output from SYSTEM
Boaz Bezborodko
boaz at mirrotek.com
Thu Jan 24 14:37:09 PST 2008
Thanks for the assistance on the previous problem. I did figure it out
just before getting the first response.
I have a different problem that whose solution is probably simple, but I
haven't been able to get an answer to it.
I'm trying to execute a simple SYSTEM command to combine two files using
TYPE. The command will look something like TYPE file1 >> file2. But I'm
using variables for the files since they are different each time. (I'm
adding a "!Bang" line to the front of a printout to generate a PDF.)
The thing is that it never executes this command and I can't find out why.
Here is the code:
1 ------- - - - - - - - - - - - - - - - -
◄ If: ◄
Then: DECLARE EXTERN PrintFileName ' Should be defined as (25,*) ◄
2 ------- - - - - - - - - - - - - - - - -
◄ If: ◄
Then: DECLARE flname(55,*) ◄
3 ------- - - - - - - - - - - - - - - - -
◄ If: ◄
Then: DEBUG ON ◄
4 ------- - - - - - - - - - - - - - - - -
◄ If: ◄
Then: aa(8,yymd)=@td ; ab(5,*)=GETENV("USERNAME") ◄
5 ------- - - - - - - - - - - - - - - - -
◄ If: ◄
Then: flname="f:/fpro/temp/"&ab{PrintFileName{aa ◄
6 ------- - - - - - - - - - - - - - - - -
◄ If: ◄
Then: ad=flname{".txt" ◄
7 ------- - - - - - - - - - - - - - - - -
◄ If: ◄
Then: ae=("!PDF /f\\server\data\fpro\temp\ "{ab{PrintFileName{aa{".txt").
8 ------- - - - - - - - - - - - - - - - -
◄ If: ◄
Then: af=("f:/fpro/temp/temp"&ab{PrintFileName{aa{".txt") ◄
9 ------- - - - - - - - - - - - - - - - -
◄ If: ◄
Then: EXPORT ASCII pdf = (af) ◄
10 ------- - - - - - - - - - - - - - - - -
◄ If: ◄
Then: pdf(1) = ae ◄
11 ------- - - - - - - - - - - - - - - - -
◄ If: ◄
Then: CLOSE pdf ◄
12 ------- - - - - - - - - - - - - - - - -
◄ If: ◄
Then: SYSTEM "TYPE "&ad&" >> "&af ◄
13 ------- - - - - - - - - - - - - - - - -
The error occurs at line 12. I have tried any number of different ways
and I can't get it to work right. The error I'm getting is
"The syntax of the command is incorrect."
But if I type the results directly into the Command line it works fine.
What am I doing wrong.
Boaz
More information about the Filepro-list
mailing list