Hi Frank,
If you read the thread on "file manipulation"
you will file examples of what you want.
The standard template for reading a file
is as follows,
setvar n finfo(hpstdin,"eof")
while setvar(n,n-1)>=0 and setvar(rec,input())>=""
echo ![rec]
endwhile
The finfo tells you how many records are in HPSTDIN,
and the command file just counts down until all
records are processed..
This technique is only useful when the input file
is specified as the STDIN.
The max record length is 1022 bytes.
Cheers,
Tad
Eg.,
> file FILEC;rec=-125,10,f,ascii
> xeq CNV125CF FILEB < FILEA > *FILEC
>
> Command file CNV125CF :-
>
> parm fileb=FILEB
> print !hpfile;start=-4 > tempcf
> xeq tempcf.!hpgroup < !fileb
> setvar n finfo(hpstdin,"eof")
> while setvar(n,n-1)>=0
> echo ![input()+rec!n]
> endwhile
> return
> setvar n finfo(hpstdin,"eof")
> while setvar(n,n-1)>=0
> setvar rec!n input()
> endwhile
-----------------------------------------------------------------------------
This message is confidential; its contents do not constitute a
commitment by Paribas except where provided for in a written agreement
between you and Paribas. Any unauthorised disclosure, use or
dissemination, either whole or partial, is prohibited. If you are not
the intended recipient of the message, please notify the sender
immediately.
Ce message est confidentiel ; son contenu ne représente en aucun cas un
engagement de la part de Paribas sous réserve de tout accord conclu par
écrit entre vous et Paribas. Toute publication, utilisation ou
diffusion, même partielle, doit être autorisée préalablement. Si vous
n'êtes pas destinataire de ce message, merci d'en avertir immédiatement
l'expéditeur.
|