• Subject: Re: Edit APIs
  • From: Dave Mahadevan <mahadevan@xxxxxxxx>
  • Date: Fri, 06 Feb 1998 16:42:49 -0500
  • Organization: Stoner and Associates


Jeff Crosby wrote:

> Dave,
> > Yes I have done it as a prototyped procedure to mimic what we poor V3R2 
>cant get
> > (as in V4R1 %EDITC %EDITW).  It is just not that hard.
> Ooooh!  Can I _pleeeze_ have it?
> --
> -Jeff
> jlcrosby@fwi.com

Sure.  To prevent david's mailbox overflowing, I have e-mailed the code to you.

The invocation is
EVAL char_str = P_EditCode(number,editcode,length,decimal,special,adjust)
The first parm is reqd, everything else is optional.  Default Editcode is 'J'
default length is 30, default decimal is 9 (for date fields it is 6 and 0 -- 
somehow 8
0 causes troubles in the mask).   special is * or $.  adjust is L  left adjust 
edited string (default)  or R for right adjust.
so if I wanted to edit a field called amount using all defaults
it will be EVAL           EDITSTRING = P_EditCode(Amount)
or for K edit code (my favorite)
it will be EVAL           EDITSTRING = P_EditCode(Amount :'K')

for editword the invocation is
EVAL char_str = P_EditWord(number,editword,adjust)
first one is required.  default editword is , and .
for example EVAL            Y2K_STRING = P_EditWord(date8N0 : '  /  /    ;')
the ; will tell the end of the editword.

Again this will become useful in formatting a string like:

Eval        Out_string = 'You paid ' + %TRIM(P_EditCode(Amount)) + ' on '  +
%TRIM(P_EditWord(date8N0 : '  /  /     ;')) + '.  Thank you.'

What I usually do is when I develop a utility procedure like this, I stick them 
in a
binding directory called PROCEDURES and include this in every CRTBNDPGM (set up 
option CP in PDM)...

Thank You.


Dave Mahadevan.. mailto:mahadevan@fuse.net

| This is the Midrange System Mailing List!
| To submit a new message, send your mail to "MIDRANGE-L@midrange.com".
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com

This thread ...


Return to Archive home page | Return to MIDRANGE.COM home page