[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Re: RE Await file U2 routine



** Reply to message from Patricia M Godfrey  on Tue, 28 Sep
2004 13:20:12 -0400


> Note that all this was done
> before I got your last post with the many ways of doing things

Which I didn't post publicly -- so here it is, since you mention it (more plain
text below):

XPLeNCODE v2.0
b-gin [UNTITLED]
> >>[cr|lf]> We are assuming he
re that in the entire Path+Filename[cr|lf]> () there i
s only one period "." ...[cr|lf][cr|lf]OK, if that assumption
 is wrong then there are numerous ways to make it right. Let
 suppose for example purposes that S/G 50 is "D:\XY4FILES.TXT
\FILENAME.TXT". DeFine and RUNCODE these examples, each of w
hich will handle any number of periods:[cr|lf][cr|lf]1)[cr|lf
]{<}SV50,D:\XY4FILES.TXT\FILENAME.TXT{>};*;[cr|lf]{<}SV01,.{>
}{<}SV02,{>}{<}IF{<}IS50{>}{240}"."{>}{<}LBA{>}{<}XS50,01,03,
01,04{>}{<}SX02,{<}IS02{>}+{<}IS03{>}{>}{<}IF{<}IS04{>}{240}"
{046}"{>}{<}SX02,{<}IS02{>}+"."{>}{<}SX50,{<}IS04{>}{>}{<}GLA{>}{
<}EI{>}{<}SX50,{<}IS02{>}{>}{<}EI{>}{<}SX50,{<}IS50{>}+".ps"{
>}{<}PR@50{>}{<}EX{>}[cr|lf][cr|lf]2)[cr|lf]{<}SV50,D:\XY4FIL
ES.TXT\FILENAME.TXT{>};*;[cr|lf]{<}SX01,2{>}{<}SV02,{>}{<}LBA
{>}{<}SX03,"{<}SX04,{<}VA@50."+{<}IS01{>}+"{>}{>}"{>}{<}PV03{
>}{<}IF{<}VA|04{>}>0{>}{<}SX05,{<}PV01{>}-1{>}{<}SX03,"{<}SX0
4,{<}VA@50."+{<}IS05{>}+"{>}{>}"{>}{<}PV03{>}{<}SX02,{<}IS02{
>}+{<}IS04{>}+"."{>}{<}SX01,{<}PV01{>}+1{>}{<}GLA{>}{<}EI{>}{
<}SX02,{<}IS02{>}+"ps"{>}{<}PR@02{>}{<}EX{>}[cr|lf][cr|lf]3)[
cr|lf]{<}SV50,D:\XY4FILES.TXT\FILENAME.TXT{>};*;[cr|lf]{<}SV5
1,.{>}[JM_]2.XSR[Q2_]{<}SX01,{<}IS52{>}+".ps"{>}{<}PR@01{>}{<
}EX{>}[cr|lf][cr|lf]4)[cr|lf]{<}SV50,D:\XY4FILES.TXT\FILENAME
{046}TXT{>};*;[cr|lf]{<}IF{<}IS50{>}{240}"."{>}{<}SX01,{<}IS50{>}
+"[999]"{>}{<}SV02,{027}X[999]{>}{<}LBA{>}{<}XS01,02,03,04,05
{>}{<}IF"."{238}{<}IS04{>}<0{>}{<}SX01,{<}IS03{>}+"[999]"{>}{
<}GLA{>}{<}EI{>}{<}LBB{>}{<}SX01,{<}IS03{>}+".ps"{>}{<}PR@01{
>}{<}EX{>}{<}EI{>}{<}SX03,{<}IS50{>}{>}{<}GLB{>}[cr|lf][cr|lf
]5)[cr|lf]{<}SV50,D:\XY4FILES.TXT\FILENAME.TXT{>}
;*;[cr|lf]{<}IF{<}IS50{>}{240}"."{>}{<}SX01,{<}IS50{>}+"[999]
"{>}{<}SV02,{027}X[999]{>}{<}LBA{>}{<}XS01,02,03,04,05{>}{<}I
F"."{238}{<}IS04{>}<0{>}{<}SX02,"{027}X"+{<}IS02{>}{>}{<}GLA{
>}{<}EI{>}{<}LBB{>}{<}SX01,{<}IS03{>}+".ps"{>}{<}PR@01{>}{<}E
X{>}{<}EI{>}{<}SX03,{<}IS50{>}{>}{<}GLB{>}[cr|lf][cr|lf]
-nd
XPLeNCODE

So let's look at your examples.

initial version (not really, but has the plain name, as opposed to
awftest#.pgm):
XPLeNCODE v2.0
b-gin [UNTITLED]
[BC_]save[XC_]{<}SX50,{<}VA$FP{>}{>}[JM_]2.GetPath[Q2_]{<}SV0
2,.{>}{<}XS51,02,03,04,05{>}{<}SX01,{<}IS50{>}{>}[BC_]ldprn p
ost47.prn[XC_][BC_]printf ,c:\gs\gs8.14\lib\{<}PV03{>}.ps[XC_
][BC_]wait[XC_][BC_]unload post47.prn[XC_]
-nd
XPLeNCODE
Runs OK

Comments: SA/NV, in case it already exists (no confirmation)
BX waitQ2 after SAVE
XS51,02,02,,03 -- don't fritter useless S/Gs
SX01, -- unnecessary
ldprn = lp
printf = tyf
UNLOAD -- pointless. An LP procedure commits S/G memory which cannot be
released. You should put post47.prn in your PP table and use SETP instead of
LP -- SETP does NOT commit memory, whereas repeated LPs eventually lead to
[d]OOM condition

Version 2:
XPLeNCODE v2.0
b-gin [UNTITLED]
[BC_]ldprn d:post47.prn[XC_][BC_]printf ,fo.tmp[XC_][BX_]wait
[Q2_][BC_]unload d:post47.prn[XC_][JM_]2.Errcode[Q2_]
-nd
XPLeNCODE
Yields error 10 cannot find item.

d: what? d:\path\ or d:\ or current dir on d: or what?
printf ,fo.tmp -- the default target of a PRINTF|TYF is FO.TMP, so unnecessary
to specify target filename
Err 10 is probably due to the d: thing -- you need to DEBUG the code! Put an
 after each command, to determine EXACTLY where the VA$ER=10 occurs

Version 3:
XPLeNCODE v2.0
b-gin [UNTITLED]
{<}SX50,"c:\gs\gs8.14\lib\sample.ps"{>}[BC_]ldprn d:post47.pr
n[XC_][BC_]printf ,{<}PV50{>}[XC_][JM_]2.AwaitFile [Q2_]
-nd
XPLeNCODE
Yields Application error, then Printing Done

SX50,"c:\gs\gs8.14\lib\sample.ps" = SV50,c:\gs\gs8.14\lib\sample.ps
Why all the BC XC instead of BX Q2? Latter MUCH MUCH faster
Don't need AwaitFile -- just use BX waitQ2. If AwaitFile were really needed,
you're better off with AwaitRen, because AwaitFile can give false "all clear to
proceed" due to DOS bugs (DOS shows "file exists" even if not yet fully written)

Version 4:
XPLeNCODE v2.0
b-gin [UNTITLED]
[BC_]ldprn d:post47.prn[XC_][BC_]printf ,fo.tmp[XC_][BX_]wait
[Q2_]
-nd
XPLeNCODE
_Twice_ says Filename already exists, Overwrite it? I answer Y both
times, and it completes OK otherwise.

Then use TYF/NV (NoVerify -- no confirmation prompt)

Version 5:
XPLeNCODE v2.0
b-gin [UNTITLED]
[BC_]ldprn d:post47.prn[XC_][BC_]printf ,fo.tmp[XC_][BC_]unlo
ad d:post47.prn[XC_]
-nd
XPLeNCODE
Runs OK, finishes with Printing done message.

-----------------------------
Robert Holmgren
holmgren@xxxxxxxx
-----------------------------