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



You need to open the source not in LPEX. The RegEx functionality is one
line only. I have explored via RSE to the remote temp version or
created a i[Series] Project and then opened with the text editor.

I have not attempted to insert extra lines but this find and replace in
the text editor is different from the LPEX tool.

If you open in text editor you have to insert sequence and date values
for new lines yourself.

Thanks, Matt

-----Original Message-----
From: wdsci-l-bounces@xxxxxxxxxxxx [mailto:wdsci-l-bounces@xxxxxxxxxxxx]
On Behalf Of Paul Bailey
Sent: Friday, July 15, 2011 3:10 AM
To: WDSCI-L@xxxxxxxxxxxx
Subject: [WDSCI-L] Help converting to /FREE with find/replace

Hi,

I am converting source members to /FREE as I go. Some of the existing
source was probably written in the days of the first RPG version, and if
they were ever updated the newer RPG code was added and the older RPG
code remained, so you can end up with condition indicators, the program
cycle, BIFs and SQL all in the same 10 line program (for example).

RDP's /FREE conversion doesn't handle everything from the older versions
of RPG, but it is possible to run several complex regular expression
Find/Replaces before the /FREE convert to change a lot of the parts that
wouldn't normally work.

My problem is that opcodes such as LOOKUP, or lines with conditional
indicators often require more than one source line. Does anyone know how
I can place a newline into the "replace" text so that I can turn a
single line into more than one?

E.g., using find (CTRL-F) with regular expressions:
FIND: ^(.....)C\s{3}(\d{2})\s{14}ITER\s*$
REPLACE: $1C IF \*IN$2 = *ON\\n$1C
ITER\\n$1C ENDIF

That example works perfectly, but I have to search for the "\n"s, delete
them and use ALT-s (action split) to put the code lines on three
separate lines.

Can anyone tell me how to get the REPLACE text to have newlines in it?
Don't worry about mentioning other tools that convert to /FREE more
successfully, as I can only work with the tools I have.


Cheers,
Paul.


------------------------------------------------------------
Important

This email transmission and any files with it are strictly
confidential to the intended recipient and may be legally
privileged. Any views or opinions presented are solely
those of the author and do not necessarily represent those
of BHSF. If you are not the intended recipient, you must
not copy, disclose or distribute its contents in any way.
If you have received this e-mail in error, please notify
the sender and delete the e-mail from your system.

We have taken steps to ensure this e-mail and attachments
are free from any virus but do not accept any
responsibility once this e-mail has been transmitted. You
should scan any attachments for viruses.

No contract may be concluded on behalf of BHSF Limited by
e-mail.

Registered Office:
BHSF Limited
Gamgee House, 2 Darnley Road, Birmingham B16 8TE.

www.bhsf.co.uk

Registered in England number 35500.

BHSF is authorised and regulated by the Financial Services
Authority.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.