× 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 could use a template. Go to Window->Preferences. Type template in the search bar, and select Remote Systems->Remote Systems LPEX Editor->ILE RPG->Templates.

You can add what is essentially a snippet without replacement variables. So I added a snippet that looks like this:

Name: //--
Context: FREE-FORM
Description: procedure header
Content:
// ------------------------------------------
// ${cursor}
// ------------------------------------------


Now I can type // ctrl+space, and a popup is displayed with all the templates starting with //. I select the one I want, and it is added. Since I only have one, the entire sequence is // ctrl+space enter.

That ${cursor} bit tells RDi where to put the cursor after the template is inserted.

If you use both RPGLE and SQLRPGLE, you will have to create duplicate templates, one for FREE-FORM, and one for SQLFREE-FORM contexts.

Ages ago, I used a programmer editor named Brief. It had a very powerful macro language in which I created many templates like snippets on steroids. Not only could I have replacement variables, but I could conditionally include or exclude boilerplate code based on questions and answers provided during the script run. I wish eclipse had such a scripting language.

Mark Murphy
STAR BASE Consulting, Inc.
mmurphy@xxxxxxxxxxxxxxx


-----Craig Richards <craig@xxxxxxxxxxxxxxxx> wrote: -----
To: "Rational Developer for IBM i / Websphere Development Studio Client for System i & iSeries" <wdsci-l@xxxxxxxxxxxx>
From: Craig Richards <craig@xxxxxxxxxxxxxxxx>
Date: 08/12/2016 02:26AM
Subject: [WDSCI-L] Inserting specific text with an Editor Action or Command


Hi All,

In my pre-RDi days, I wrote an SEU exit program that allowed me to perform
things like:

- Insert a comment with a horizontal line across the full source width (
as an aid to make it easier to see subprocedure / subroutine boundaries
- Insert comment metadata ( either a double slash (//) or a carefully
positioned asterisk (*) followed by a hex control character ( usually x'20'
) to make the comment highlighted.

Although I do perform most of my development using RDi these days - I still
keep with the habit of inserting horizontal line separators and inserting a
hex character at the beginning of comment text to help it stand out when
view via SEU which doesn't auto-colour comments.

I have never really found an easy way to do this in RDi, mostly I scroll
about and select and copy what I need from another place in the source ( I
usually have one, even the simplest programs I write usually start life as
a copy of another program )

I did at one point create some snippets with bits of text in I could insert
but I think they only worked on CALC lines and if you tried to insert
partway along a new line, the text would insert at the beginning of the
line, not where the cursor/carat was positioned ( which of course I
understand, the line doesn't automatically get blank filled up to the
insertion point )

I think I decided that there wasn't an existing Action or Command that I
could use for this purpose and I didn't get very far on my only attempt at
trying to write my own.

Does anyone have an easy way of doing this?

In it's simplest form I guess I'd like to be able to get a predefined
character inserted at the current carat position by pressing a shortcut key.

Does anyone have a way of doing this or something similar they could point
me at?

thanks kindly,
Craig

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.