SCOUG-HELP Mailing List Archives
Return to [ 02 |
September |
2003 ]
<< Previous Message <<
>> Next Message >>
Content Type: text/plain
=====================================================
If you are responding to someone asking for help who
may not be a member of this list, be sure to use the
REPLY TO ALL feature of your email program.
=====================================================
Harry Motin wrote:
>
> If you like, I can easily "upgrade" it as follows:
>
> (it only works under Object REXX.)
> 1. Work under Classical REXX, only (I have
> to "recompile" it under Classical REXX)
>
> (it only works on the first line of clipboard contents)
> 2. Work on the right or left sides of every line in
> the clipboard (multiple line clipboard contents)
Hi Harry,
Object Rexx is fine with me, but you may want to compile
a Classic Rexx version so everyone can use it. I just
switched to Object Rexx over the weekend (CodeAnalyzer
requires it). So far I haven't had any problems running
my Classic Rexx programs.
Rexx has a built-in LastPos() function which you can use
to quickly find each CR-LF and then Insert() a space
directly after each one.
I haven't tested the following but it might be close to
what's needed:
/* The following routine starts at the end of a string
/ and inserts a space after every line terminator.
/ It doesn't use the most efficient way of doing this
/ but the clipboard is limited to 64K (I think) so
/ the execution penalty is minimal. */
/* Note: when a line is empty (i.e. CRLFCRLF) add the space anyway. */
stClipboard = [the contents of the clipboard]
stLineTerminator = '0D0A'x /* CR-LF; some files use other line terminators */
/* Note: code sometimes does weird things with strings that are
/ "too short" so don't process strings of length 0 or 1. */
if Length( stClipboard ) > 1 then do
/* Note: start at length-2 so a space isn't added after a CRLF at very end */
iStartOfNewLine = Length( stClipboard ) - 2
do while iStartOfNewLine > 0
iStartOfNewLine = LastPos( stLineTerminator, stClipboard, iStartOfNewLine - 1 )
if iStartOfNewLine > 0 then
stClipboard = Insert( ' ', stClipboard, iStartOfNewLine + 1 )
end
end
Again, I didn't test the above (I'm real short on time this morning). If you want me to test it and then post "good code" let me know.
- Peter
> It's your call. I have to do it later tonight, however.
> HCM
>
> On Tue, 2 Sep 2003 03:47:51 PDT7, Peter Skye wrote:
>
> >=====================================================
> >If you are responding to someone asking for help who
> >may not be a member of this list, be sure to use the
> >REPLY TO ALL feature of your email program.
> >=====================================================
> >
> >Harry Motin wrote:
> >>
> >> Please try the attached VISPROREXX program.
> >
> >Harry, thanks a lot. I have attorney meetings coming up this morning
> >and I'll check this out later today.
> >
> >Thanks again,
> >
> >- Peter
> >
> >
> >=====================================================
> >
> >To unsubscribe from this list, send an email message
> >to "steward@scoug.com". In the body of the message,
> >put the command "unsubscribe scoug-help".
> >
> >For problems, contact the list owner at
> >"rollin@scoug.com".
> >
> >=====================================================
> >
> >
>
> =====================================================
>
> To unsubscribe from this list, send an email message
> to "steward@scoug.com". In the body of the message,
> put the command "unsubscribe scoug-help".
>
> For problems, contact the list owner at
> "rollin@scoug.com".
>
> =====================================================
=====================================================
To unsubscribe from this list, send an email message
to "steward@scoug.com". In the body of the message,
put the command "unsubscribe scoug-help".
For problems, contact the list owner at
"rollin@scoug.com".
=====================================================
<< Previous Message <<
>> Next Message >>
Return to [ 02 |
September |
2003 ]
The Southern California OS/2 User Group
P.O. Box 26904
Santa Ana, CA 92799-6904, USA
Copyright 2001 the Southern California OS/2 User Group. ALL RIGHTS
RESERVED.
SCOUG, Warp Expo West, and Warpfest are trademarks of the Southern California OS/2 User Group.
OS/2, Workplace Shell, and IBM are registered trademarks of International
Business Machines Corporation.
All other trademarks remain the property of their respective owners.
|