WDSC tips/Editor

From MidrangeWiki
< WDSC tips
Revision as of 00:10, 13 March 2008 by FKOL (talk | contribs) (Snippets)
Jump to: navigation, search

EDITOR

For keyboard shortcuts, see WDSC shortcuts

Editor Commands

original post [1] (Note the post mentions ?SEU, I found ?Editor to be also useful)

  • Type ?Editor on the command line
  • Click on 'Default editor commands' to see the commands
  • Click on the command for more info, including usage

Check LPEX commands.

  1. Note the Short Commands (see following small extract from the text)
/text Find the next occurrence of the specified text. 
-/text Find the specified text searching backwards from the current position. 
'text Find the next occurrence of the specified text.  The search is a case-sensitive search. 
-'text Find the specified text searching backwards from the current position.  The search is a case-sensitive search. 

(there is more info in the help text)

There is more find info at WDSC Find Tips

Return to TOP

WDSCi vs SEU F15=Browse options

ref [2]

original post [3]

  • To edit the same member, the method most analogous to the SEU F15 browse is Ctrl+2 to split view,
    • click on subroutine name in Outline View to position the new view to the subroutine,
    • do whatever,
    • Ctrl+0 to close the second view.

Note that new views opened this way can all allow editing, and you can have up to 5 views open on a single member, not just 2 as in SEU.

  • To edit/browse a different member, Ctrl+Shift+A (or open using any other method). Then drag the member name tab down or to the right until it turns into an arrow and release. This splits the screen (top/bottom or left right) for editing/browse. Does not work when in maximized mode.
  • Alternately,
    • just go to the subroutine by clicking on it in the Outline View,
    • do whatever,
    • then return to the Exsr by clicking on the line number where the subroutine is used.
  • A third way is to set a quick mark and return to it.
  • A fourth way is to set a named mark and return to it.
  • A fifth way (but the Outline View is easier) is to filter the source by the subroutine name
    • (either Ctrl+F, enter name, click All, or right click, Selected, Filter selected,
    • which can also be set up as a key combo if you like),
    • put the cursor on the Exsr or Begsr as you choose, and then Ctrl+W.

Note: If you have 6.0.0.1, you're too far behind - I believe you need 6.0.1.0 or higher to be able to open multiple views on the same member.

Position my cursor to where I need to key additional data. (On IBM rqmts list)

original post [4]

In SEU, when I hit enter, the editor will automatically position my cursor to where I need to key additional data? I know tab moves me to the next input position, but not whether it requires input. And by the time auto syntax checking informs me, I have spent time reading the message, relocating my cursor, etc.

  • There is no way to currently do this. It is on IBM's list of requirements.

Automatic cursor positioning can be configured by choosing 'Preferences' from the 'Window' menu.

  • In version 7, you are looking for Remote Systems -> Remote Systems LPEX Editor -> iSeries Parsers -> ILE RPG

Return to #TOP

Do I have to use the mouse to copy lines from one member to another?

original post [5]

Standard windows copy/paste keys can be used, along with a few extras provided in LPEX (check the Edit menu for selection options)

To copy X lines,

  • put your cursor is on the first line of the block you want to move,
  • press Home,
  • then hold Shift and press the down arrow X times.
  • Now press Ctrl+C,
  • then Shift+F6 (this is like Alt-Tab in windows, but for LPEX editor tabs) until you get to the target member.
  • Now find the line you want to insert at, and press Ctrl+V.

Another method not mentioned yet is to

  • mark the lines to copy using Alt-L,
  • then copy them into position using Alt-C.

The lines will be inserted beginning with the line after your cursor position. You should also explore the other Select/Selected functions, which are listed under the Edit menu with their keyboard shortcuts.

See list, WDSC_shortcuts.

Return to #TOP

How can I copy field names in to the member? (On IBM rqmts list)

original post [6]

  • This is on IBM's list of requirements.
  • I added a table to the Table View, I can see all my fields, but can't copy and paste from there.
  • Drag and drop from table view to RS LPEX is currently not available.
  • You can always open the DDS source and copy the names from there.
  • Be sure to have a look at the rectangle select - it may come in handy for this (alt-r, alt-c.)

Return to #TOP

Can I condition page ups and downs by cursor position?

original post [7]

  • Or at least jump the cursor to the top or bottom of the displayed view, then I could roll by line up or down.
  • Keys can be easily remapped to do other things - check the mailing list archives for discussions on this at length.
  • You'll also want to read the reference help for what LPEX actions are available/do (scrollTop, scrollUp come to mind)

Try this from the archives; How to set an Alt + xx key to position the current line to the top or bottom of your source window. [8]

  • I use the alt page up and down keys,
  • I also have alt + T set to put the current line at the top of the editor window.
  • Ctrl+T (v7) will put the line where the cursor is at the top of the screen.

Also check WDSC Workbench for more info on key remapping.

Return to #TOP

Do I have to continually save my work?

original post [9]

In SEU, when I hit <enter>, I know it has been saved, even if I lose my session.

  • Remote Systems LPEX Editor has an auto-save feature.
  • Default is set to every 5 minutes.
  • Check out Windows -> Preferences -> Remote Systems -> LPEX Editor

I save every PC document after every few lines.

Virtually all PC software recognises Ctrl-S as the 'Save' sequence.

Return to #TOP

Auto Marking Changes to the Source

ref FKOL, 3 January 2007 (CST)

Select Window -> Preferences -> Remote Systems -> Iseries -> LPEX Editor Parsers

  • Check the box with text 'Add signature to changed lines'
  • and enter your Change number in the Signature box.
  • Click OK

Now whenever you change a line of source code, the 'signature' will be placed in pos 1-5 of the source line.

also see Record/Playback for Signature marks

Return to #TOP

How do I shift a block of text left/right?

ref Starbuck5250, 5 November 2007 (CST)

Select the block of text by putting the cursor on the upper left corner of the block.

Press Alt-R.  
Move the cursor to the lower left corner.  
Press Alt-R again.  
Do NOT use Windows copy/paste (ctrl-c/x/v)  
You now have a block of text selected.  
  • An alternate way to select is
Alt-L (line) 
and then hold down the Shift key while using the cursor keys to continue highlighting lines.
  • You can also Alt-L on the first and last lines of the block.

You can shift it left/right with alt-f7/alt-f8 If you remap the keys, the action is blockShiftLeft and blockShiftRight

  • You can shift it via the menu Edit, Selected>Shift selection
  • You can uppercase or lowercase it with alt-k/alt-i or via the menu
  • You can move it: position the cursor where you want the upper left corner to end up and press alt-m or use the menu
  • You can copy it with alt-c
  • You can delete it with alt-d

Remember that Alt-U de-selects the block.

  • Note the following will shift the entire line of code, not just a section or block.
You can use SEU mode line commands LL and RR typed over the sequence number area.
LLnn will shift left nn columns.

See list of other keyboard shortcuts: WDSC_shortcuts.

Return to #TOP

Vertical line in WDSCI editor

original post [10]

Select Window -> Preferences -> LPEX Editor -> User commands

  • Click on the drop down arrow in Class Name box,
  • select com.ibm.lpex.samples.HairlineCommand
  • Click Set apply OK
  • Then in the LPEX command line I enter
  • 'hairline cursor' or 'hairline off', to turn on and off.

Return to #TOP

Prevent Enter generating a new line

original post [11]

  • Window -> Preferences -> LPEX Editor -> User Key actions
  • Map Enter to action 'home' or 'end'

Note if Automatic structure completion is on then 'Enter' will always generate a new line.

Helpful Keys to edit lines
CTRL-Enter         Generate an empty Line
CTRL-Backspace     Delete a line
CTRL-Delete        Field Exit 
Home               Position cursor to beginning of line
Home then SHFT-Tab Position cursor in Line Numbers

See list of other keyboard shortcuts: WDSC_shortcuts.

Return to #TOP

To Print RPG Indented Source

original post [12]

  • You can print using the command line below the editor window
  • press Esc when you are in the source. Or just click in it.
  • Type ? print - you will see all the options.
  • To get the entire source use
print tokenized off lineNumbers off
  • To print only what you've selected, use
print block tokenized off lineNumbers off
  • If you want line numbers and/or shading of elements, make the obvious changes.
  • The print command works even if the File->Print option is disabled - as it is for indented source.

Return to #TOP

To show dates for source lines:

original post [13]

  • 1. Open source in LPEX
  • 2. Right click on the source pane, select SOURCE, then SHOW DATE AREA.

To filter source line by date:

  • 1. Open source in LPEX
  • 2. Right click on the source pane, select FILTER VIEW, then DATE.
  • 3. Enter the date (or range) and selection criteria on the popup.

Return to #TOP

See SQL HOST variables in OUTLINE view. (is not possible)

original post [14]

  • I've long wished that SQL host variables would be part of the outline.
  • And file references in SQL statements - they CAN be parsed, after all, otherwise they could never be run by the system.
  • So it is not impossible, just not in scope, it seems.

See Find Field usage (for SQL where OUTLINE doesnt work) for a work around.

Return to #TOP

Downloading source to PC to work offline

original post [15]

  • Select all the members that you want to download,
  • right click,
  • select Make available offline.
  • Select Yes to the next dialog box.

WDSC will download all the selected members to a iSeries project (named in my version as the CONNECTIONNAME_WINUSERNAME).

  • You can also travel with this project by exporting it,
  • right click on project name and selecting Export.
  • Then select Project Interchange,check off your project,
  • name a zip file to store it in, click finish.

You can then put the zip on a mem-stick and take it home (if that's what you want to do with your time off).

  • You will need to have WDSCi installed on your home PC.
  • In Iseries Project Navigator you need to Import the zip file, reverse the Export steps above. You may need to create a project. File > New > Iseries Project

Be aware of the issue with Iseries Projects in the RPG source was not being saved tip.

Return to #TOP

Fast Open another Source

original post [16]

Use Ctrl Shft A

Check WDSC shortcuts

Return to #TOP

Record/Playback for Signature marks

original post [17]

You can also record the key strokes by using the start and stop recording icons ( small squares) on the toolbar.

  • Press the start recording icon, insert your signature once, then stop the recording.
  • Everytime you want to insert the signature,
  • press the Playback recording (green arrow beside the two squares).

also see Auto Marking Changes to the Source

Return to #TOP

Field Exit

original post [18]

Ctrl-Del works like Field Exit.

Return to #TOP

Automatic structure completion

original post [19]

In Window -> Preferences -> Remote Systems -> iSeries -> LPEX Editor Parsers -> ILE RPG

Check the 'Automatic closure of control block' and select your style.

You may need to 'Check' the 'Repeat previous specification type' to see the 'Automatic closure of control block'

Return to #TOP

Enter Key not Working

original post [20]

  • The profile had been changed to LPEX.
  • Changed it back to Seu.
Windows > Preferences > LPEX Editor______and change the Editor Profile to SEU

FWIW My setting is LPEX and enter key is OK.

Return to #TOP

Snippets

Check SNIPPETS

Return to #TOP