×

Good News Everybody!

A new search engine is coming soon.

As a stop gap measure, we are using Google's custom search engine service.




Also you want to fix your prototype.
Your strstr function should be "VALUE" not "CONST" for the two parms.
Again, a good reason to use the www.rpgiv.com/downloads page when using C
and MI APis.
-Bob


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Rick.Chevalier@xxxxxxxxxxxxxxx
Sent: Thursday, November 11, 2004 11:31 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: Searching a user space

I have an xml document loaded into a user space and I want to find a
specific tag.  I can use the %Scan BIF but I'm looking for something that
will search the entire user space at one time without having to loop and
check 64k at a time.

Currently I'm trying to use the C strstr function but it keeps giving me a
pointer value when the search string doesn't exist in the user space.  I
have listed the associated code below.

If anyone sees a problem with my code or has a better way I'm all ears (or
eyes in this case).

      // Search for substring

     d SchStr          pr              *   ExtProc('strstr')
Error number     
     d                                 *   Const Options(*String)
String to search 
     d                                 *   Const Options(*String)
String to find   

      // XML string being worked on                            
     d XMLString@      s               *                       
     d XMLString       s          64000    Based(XMLString@)   
                                                               

     d TmpPtr          s               * 

      // Search constants                                
     d b_PDF           s              5    Inz('<pdf ')  

         TmpPtr = SchStr(%TrimR(XMLString) :b_PDF); 

Rick
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
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-2026 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.