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



Jim,

The question is actually does the string "" contain the substring "Hi
there"... and that's definitely not the case.  However, when an empty string
is involved they both bomb.

Your case can be argued about, but my example should definitely return 0 in
my opinion.

Kind regards,
Paul

-----Original Message-----
From: Jim Langston [mailto:jlangston@celsinc.com]
Sent: 21 March, 2002 19:43
To: 'rpg400-l@midrange.com'
Subject: RE: %Scan (Again...)


Well, tell me, does the string "Hi there" contain the substring "" ?  Kinda
like dividing by 0, there is no real answer.  Any string could be considered
to contain a null string, or could it?  Depends on your point of view.

I wouldn't mind searching for a null string to bomb out, as I wouldn't mind
a divide by zero bombing out.  Any result a divide by zero gives could be
considered wrong.  Is it 0 or infinite?  Null contained in a string, is it
the first position, all positions or no positions?

That is something that should be checked in code, not the function.

Regards,

Jim Langston

-----Original Message-----
From: Nicolay, Paul [mailto:paul_nicolay@merck.com]

Hi Barbara,

I just opened a problem report if that is of any help.

As far as the 'needle' is concerned... why not return 0 as well ?

Kind regards,
Paul
_______________________________________________
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 ...


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.