× 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.



-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx 
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Scott Klement
Sent: Friday, July 14, 2006 2:30 AM
To: RPG programming on the AS400 / iSeries
Subject: Re: Passing a path name through C open function.

However, if you want to use only one variable for filename 
(and I highly 
recommend that) then do this:

   d crtXMLDoc       PI             1N
   d  FlrPth                         *   value options(*string)
   d  ErrId                              like(ref.msgid)

and then open it like this:

    FilDes = open( FlrPth
                 : O_CREAT+O_TRUNC+O_WRONLY
                 : RW*OWNER + RW*GROUP + RW )

That way, the caller can pass any variable (either varying or 
fixed) of 
any length to the subprocedure, and there's no limitations.  The 
disadvantage, however, is that the caller has to remember to trim the 
blanks off, which seems to be confusing for a lot of people.  
So as an 
alternative, you could do it this way:

Mike,

I agree with all of Scott's advice.  However, if you happen to be at
v5r4, then you can use the following instead:

   d crtXMLDoc       PI             1N
   d  FlrPth                         *   value options(*string:*trim)
   d  ErrId                              like(ref.msgid)

Which removes the requirement that the caller remember to %trim the
blanks off.


HTH,
Charles


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.