If you're a WDSc user and you use the jLpex editor to modify your RPG programs, you may find some of the keystroke mannerisms annoying. For example, when you hit enter, it doesn't split the line at the cursor position. Instead, it creates a blank line following the current line. The developers of WDSc knew that there would be many different opinions on how the next generation of RPG editors should work, so they included a utility that lets you modify your key actions. The utility is called User Key Actions and can be found by opening WDSc and clicking on the following options, as shown in Figure 1: Window -> Preferences -> LPEX Editor -> User Key Actions.
The first thing that threw me for a loop on the User Key Actions window (and on almost every other WDSc screen!) is that to find out more information, don't look for a 'Help' button. Instead, follow your green-screen instincts and press F1. If you place your cursor in the "Key" field and press F1, it will give you a brief description of what the field is for and will also provide you with a link to more information, as shown in Figure 2. Since you don't know the valid values of this field, click the "Defining key actions" link at the bottom of the pop-up window. Good job! Go and help yourself to the candy dish at the cube next door while WDSc's help loads! (It can take some time.) When you come back to your chair, you will see that the page for defining allowable values for the keyAction parameter is displayed, as shown in Figure 3. Peruse through the list of valid keys and modifiers and note that "enter" is a valid value for the key parameter.
To modify the enter key's behavior so that it splits the current line based on where the cursor is, go back to the User Key Actions window and type the word "enter" in the Key field. To specify the action that you want to take place when the enter key is pressed, place your cursor in the action field, press F1, and select the "Default editor actions" link at the bottom of that pop-up window. This brings up the "Default editor actions" WDSc help screen. Scroll down to the "splitLine" action and read the description shown in Figure 4.
Exit the help screen and return to the User Key Actions window. Type "splitLine" in the action field. In the upper right corner of the screen, click the "set" button. You have now created your own User Key Action that will show up in the list of actions defined, as shown in Figure 5. Open an RPG program and test the new functionality by moving the cursor to the middle of a line of code and hitting enter.
One obvious improvement to this process would be to have a dropdown window for both the Key and Action fields so you don't have to switch between screens to make sure you entered the correct values. You may also notice that sometimes it doesn't work the first time you set it up and try it out in your code. The fix to this, as dumb as it sounds, is to delete that User Key Action and create it again. The moral of the story: when in doubt, do it twice and it is bound to work. A better explanation can be found here: http://www.outpost9.com/reference/jargon/jargon_17.html#TAG128 [1]
Figure 1 http://www.iseriesnetwork.com/ClubTech/images/ctpt_20040819_1.jpg [2]
Figure 2 http://www.iseriesnetwork.com/ClubTech/images/ctpt_20040819_2.jpg [3]
Figure 3 http://www.iseriesnetwork.com/ClubTech/images/ctpt_20040819_3.jpg [4]
Figure 4 http://www.iseriesnetwork.com/ClubTech/images/ctpt_20040819_4.jpg [5]
Figure 5 http://www.iseriesnetwork.com/ClubTech/images/ctpt_20040819_5.jpg [6]
The above article was written by Aaron Bartell. If you have any questions about this article, contact Aaron at mailto:clubtechtip@mowyourlawn.com [7].
Links:
[1] http://www.outpost9.com/reference/jargon/jargon_17.html#TAG128
[2] http://systeminetwork.com/ClubTech/images/ctpt_20040819_1.jpg
[3] http://systeminetwork.com/ClubTech/images/ctpt_20040819_2.jpg
[4] http://systeminetwork.com/ClubTech/images/ctpt_20040819_3.jpg
[5] http://systeminetwork.com/ClubTech/images/ctpt_20040819_4.jpg
[6] http://systeminetwork.com/ClubTech/images/ctpt_20040819_5.jpg
[7] mailto:clubtechtip@mowyourlawn.com