Thursday, July 12, 2007

Xedit or ISPF : Xedit !?

I still had to come up with the second part of my little comparison between the ISPF editor and Xedit. Last time I focused on the strong points of ISPF, making Xedit looking a bit of a poor editor. I must immediately say, this is certainly not the case. There’s lots of things I really like about Xedit.

First and foremost there’s ‘profile xedit’. This is a macro which is executed each time you open a file in xedit. You might compare it to an initial macro in ISPF though that is on PDF level, whereas ‘profile xedit’ can treat files with a certain filetype but it can just as easily treat one single file. What’s the purpose : you can put up some settings and vary them according to the file you’re editing. (By the way, there’s e.g. also the lesser known ‘profrlst xedit’ that can influence the way you open a file in your reader, but I divert). I’ve seen ‘profile xedit’ files with a couple of lines, but I’ve also seen them with hundreds of line. And this doesn’t seem to have much influence on the speed of opening the file. It allows you e.g. to put your settings in upper case when you’re editing a JCL or a COBOL file and to set your case mixed, when you’re opening a text file.

First thing I do when ‘tuning’ this macro is – I must admit – put some settings (scale, command line) so that I have more or less the same look and feel as in ISPF. But there’s more than this. Here’s some of the settings I use – and you don’t find them in ISPF :
- ‘span’ : this allows you to look for a string across line boundaries
- ‘wrap’ : the file wraps around when you do a find or e.g. use PF8. Open a file, tap twice on the PF7 and you’re at the bottom of the file.
- varchar’ : no matter how many blanks are between two words, when you try to find e.g. ‘second life’, you’ll find ‘second life’ but also ‘second life’, and in combination with ‘span on’ even if they’re on two different lines.

Another nice command is ‘ALL’. It gives you all the lines containing a certain string and exludes all other lines. In ISPF you’ll need a macro. You can choose whether you still see an indication of the excluded lines or not. Deleting all the displayed lines, does not affect the excluded lines. I just love this – and ISPF reacts otherwise . . . In ISPF you’ll need a little macro for this command.

Split-Join (SPLTJOIN) assigned to a PF-key lets you split a line from the cursor position onwards if there are characters following. It joins lines when nothing follows : easy as pie. In ISPF you’ll need TS ànd TF.

There’s also an alternative use of the split screen I like. You can split your screen (horizontally or vertically) and open the same file at two different places in order to e.g. compare certain parts.

Another strong point, just to finish it off, is that you can combine search arguments with operators like AND, OR and NOT. So you can look for all lines with ‘second’ AND ‘life’.
Only one of the arguments can cross the line border. Otherwise, this wouldn’t have much sense when e.g. combined with the span setting.

So what’s my favourite editor : I must say I just don’t know. I think over the years you start writing little macros in the one that compensate for functions only found in the other, so you cover all functions you use in both editors. If I was forced to make a choice I think I’d go for Xedit, because I personally find it somewhat more flexible, but hey, that's just a personal choice !?

No comments: