Change the first line to:
%ECHO if (field1 !<= fielda and field2 !>= fielda) and !["&"] >> suprcom
The last character is no longer an ampersand, so MPEX doesn't think the line
is continued, but the !["&"] evaluates to an ampersand and is redirected to
the file.
%ECHO echo !["&"] > $NEWPASS
%ECHO This is a test >> $OLDPASS
%PRINT $OLDPASS
echo &
This is a test
%XEQ $OLDPASS
This is a test
---
Steve Fulton
The NPD Group Canada, Inc.
---
> Does anyone know how to echo an ampersand & to a file in MPEX? Here's the
rub,
> when I do this:
>
> %ECHO if (field1 !<= fielda and field2 !>= fielda) and & >> suprcom
> %ECHO field3 = "yaddayaddayadda" >> suprcom
> %ECHO ext this >> suprcom
> %ECHO ext that >> suprcom
>
> Note: the exclamation marks before the < and > in the first line are
> intentional so MPEX doesn't interpret them as IO redirection.
>
> MPEX thinks the ampersand is a continuation of the first command so I only get
> three lines of code in the file (and I get an MPEX error to boot!).
>
> PRINT suprcom
> if (field1 <= fielda and field2 >= fielda) and
> ext this
> ext that
>
>
> Charlie Fontaine
> NYLCare Health Plans
>