|
Bob Cozzi www.rpgiv.com/seminars -----Original Message----- From: rpg400-l-admin@midrange.com [mailto:rpg400-l-admin@midrange.com] On Behalf Of Hans Boldt Sent: Tuesday, September 17, 2002 10:10 AM To: rpg400-l@midrange.com Subject: Re: rpgile strings > 65535 varner=vwZBVSELaea5SvY1vBzdmdi2O/JbrIOy@public.gmane.org wrote: > I need to retrieve the last 32000 characters from a null-terminated > string. According to IBM this can only be done using a C language > program. I don't know C. Does anyone have any examples or > suggestions? Assuming you have a pointer to the data, you can manually search for the X'00' character at the end of the string, then subtract 32000 to point to the beginning of the data you're interested in. The following program illustrates (but pointing to the last 10 chars): ------------------------------------------------------------- H dftactgrp(*no) D area s 10a based(p) D bch s 1a based(p) D len s 10i 0 D long s 65535a inz(*all'jdshfgjhdf') /free %subst(long:%size(long):1) = x'00'; p = %addr(long); dow bch <> x'00'; p = p + 1; enddo; p = p - 10; dsply area; *inlr = *on; /end-free ------------------------------------------------------------- Cheers! Hans _______________________________________________ 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 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.