× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


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

Jeff

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 
the
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 
as
option CP in PDM)...

--
Thank You.

Regards

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
+---


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.