× 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: Re[2]: "extract" command enhancement
  • From: dhandy@xxxxxxxxxxx (Douglas Handy)
  • Date: Tue, 21 Sep 1999 12:11:13 -0400

Paul,
     
>     I don't think there's a way to code a procedure that will allow 
>     functionality like...
>     
>          EVAL %subdtz(DateField:*M) = 12
>     
>     ...or is there?  If so, I want to know about it!!

You can come close enough.  Just code procedures like

  SetMonth( DateField: Month )  

or whatever.  Its arguably not quite the same as being able to write
left-hand side expressions, but it gets the job done. 

A full set of GetXXX and SetXXX functions would not take much time to
code in a service program.  And as Hans points out, then you can use
it immediately, even if you are supporting V3R2 code, as I do. :(

I still wouldn't mind if the BIFs get added, because I think Hans & Co
could add all of them in pretty short order without using up too much
of a $100 upgrade budget.  But I won't wait around for them.  This
stuff is too easy to add ourselves.

The only problem with doing your own SetXXX procedures for d/t/z parts
is you must know the field format.  This is because you can't use
VALUE or CONST on the d/t/z field since you need to pass it by
reference.  The BIFs would not have this limitation since it can
determine the field format at compile time.  (Too bad Rochester can't
give us operational descriptors on anything but character fields!)

In general, I like to code SetXXX() type procedures to return a
success/fail return code.  Then in the procedure you can do a TestD to
make sure the format is OK, and validate the range of what you are
trying to set.  Then you can use the subprocedure in an expression to
condition code when it fails instead of blindly using CallP and
assuming it worked.

Doug
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-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.