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



Okay, scratch my last post, I didn't see the initial statement... Still
recovering from pneumonia.


> -----Original Message-----
> From: rpg400-l-admin@midrange.com
> [mailto:rpg400-l-admin@midrange.com] On Behalf Of Nicolay, Paul
> Sent: Monday, June 03, 2002 8:53 AM
> To: 'rpg400-l@midrange.com'
> Subject: RE: Help... %Len initializing field ?
>
>
> Hi Buck,
>
> Problem is that I don't know the length in advance.
>
> I pass the pointer to a C function to store it's result, and
> get in the return value the actual length it stored in there.
>  Only then I can change the length.
>
> Anyway, solved it with a 5U 0 field overlayed on the varying
> field... but I had the impression that this worked before.
>
> Kind regards,
> Paul
>
> -----Original Message-----
> From: Buck Calabro [mailto:Buck.Calabro@commsoft.net]
> Sent: 03 June, 2002 15:48
> To: rpg400-l@midrange.com
> Subject: RE: Help... %Len initializing field ?
>
>
> >Has this always been like that ?
> >
> >DBuffer           S          32767    Varying
> >DpFixed           S               *
> >DFixed            S          32767    Based(pFixed)
> >
> > /free
> >  pFixed = %Addr(Buffer) + 2;
> >  Fixed = 'Hello';
> >  %Len(Buffer) = %Len(Buffer) + 5;
> >  *INLR = *On;
> >  Return;
> > /end-free
> >
> >Given this sample... I end up with Buffer containing 5 blanks... and
> >not my 'Hello' ?
>
> Paul, I think this has always been this way.  When the
> program starts, Buffer contains 'undefined' data.  When I set
> the length explicitly, the compiler initialises the string to
> blanks up to the new length (5 blanks.) This will work as you
> expect if you set the length prior to setting 'Fixed'.
>   --buck
>
> --------------------------------------------------------------
> ----------------
> Notice: This e-mail message, together with any attachments,
> contains information of Merck & Co., Inc. (Whitehouse
> Station, New Jersey, USA) that may be confidential,
> proprietary copyrighted and/or legally privileged, and is
> intended solely for the use of the individual or entity named
> on this message. If you are not the intended recipient, and
> have received this message in error, please immediately
> return this by e-mail and then delete it.
>
> ==============================================================
> ================
>
> _______________________________________________
> This is the RPG programming on the AS400 / iSeries (RPG400-L)
> mailing list To post a message email: RPG400-L@midrange.com
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
> or email: RPG400-L-request@midrange.com
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/rpg400-l.
>
>



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.