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



This is UNTESTED, but if you absolutely, positively, unconditionally, must remove leading blanks from a field in CL, this will probably do it, although I would be surprised if there isn't a better plan....

ChgVar &Blank (' ')
ChgVar &Length (---the length of &string1---)

DoFor Var(&Posn) From(1) To(&Length) By(1)
If ( %Sst( &string1 &Posn 1 ) *NE &Blank ) Then(Leave)
EndDo
Chgvar &String2 ( %SST( &String1 &Posn ( &Length - &Posn + 1 ))


I did a similar DoFor (way back before DoFor of course) routine at one point to find the length of any data area for a generic routine I wrote in a CL, way before the days I discovered the joys of using the APIs.

--Alan





On 14/01/2009, at 8:55 AM, Wintermute, Sharon wrote:

(' ' *BCAT &MYSTRING) ?

I think this is what he meant.


That won't work either. It will simply discard the literal blank, insert a blank, and concatenate whatever is in &MYSTRING. Does no one bother to read the description of these operators? NONE of them affect the right-hand string.

Regards,
Simon Coulter.
--------------------------------------------------------------------
FlyByNight Software OS/400, i5/OS Technical Specialists

http://www.flybynight.com.au/
Phone: +61 2 6657 8251 Mobile: +61 0411 091 400 /"\
Fax: +61 2 6657 8251 \ /
X
ASCII Ribbon campaign against HTML E-Mail / \
--------------------------------------------------------------------





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.