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



On Fri, 2004-09-10 at 13:57, Ewart Desouza wrote:
> How about the reverse of getdateCYMD like getdateISO  i.e. input date = 7,0
> & output = yyyy-mm-dd.

I'm not sure I understand... you mean send the 7,0 variable and get the
ISO string back?

> If possible getWeekNo for a given date eg: getweekno(%date())

I've considered adding a week number routine before... I'll look into
it...

> I haven't tried it yet but does your replaceString( string : removeString :
> {replacementString} : {ignoreCase} ) procedure remove even blanks ???
> If not then if removing blanks from in between the string is required very
> often. Eg: before: A B C D  after: ABCD. The V5R1 version of the %replace
> BIF from IBM does not remove imbedded spaces from a string it is only
> possible to replace a character.

Yes, replaceString() will remove embedded blanks.  %replace() works by
position location, so if you want to remove a blank, you need to know
what the position of that blank is, and then replace it with '':

/free
    pos = %scan( ' ' : %trim( string ) );
    string = %replace( '' : string : pos : 1 );
/end-free

If you want to remove ALL occurances of embedded blanks, you'll need to
process this in a loop, constantly resetting pos:

/free
    pos = %scan( ' ' : %trim( string ) );
    dow pos > 0 ;
      string = %replace( '' : string : pos : 1 );
      pos = %scan( ' ' : %trim( string ) );
    enddo ;
/end-free

And DO NOT forget to %trim() the variable, or you'll put this into an
endless loop (unless "string" is varying).  You'll also put this into
and endless loop if you receiver variable is not the same as your
original string.

I like replaceString because it handles the looping and all those minor
issues for me.

Joel
http://www.rpgnext.com


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