Funny formatting with :index

Posted by Thomas Mercer-Hursh on 10-Aug-2008 12:41

It isn't consistent, but I am finding that OEA spontaneously takes lines like

Index_Feature = objNode:Index.

and turns them into:

Index_Feature = objNode:

Index.

I am presuming this happens during reformatting. Anyone else encountering this? I think it might happen only once per file so that once I fix it, it sticks.

All Replies

Posted by Simon de Kraa on 10-Aug-2008 13:14

I don't think I'm having this problem...

All my Index properties are on the same line with the class itself...

Posted by Thomas Mercer-Hursh on 10-Aug-2008 13:18

What are your settings for insert spaces/tab and the number of spaces for an indent. I am at indent spaces and 2 and there is a rather significant rearrangement that occurs when it gets around to doing a bulk reformat. I am pretty sure that is when it is happening.

Posted by Thomas Mercer-Hursh on 10-Aug-2008 13:26

I just looked at the original files and they have tab characters instead of spaces, so I think this must be happening on the reformat.

Posted by Simon de Kraa on 10-Aug-2008 16:30

Don't know. Can't seem to find where you set these preferences...

(So I am using the default settings )

Posted by Thomas Mercer-Hursh on 10-Aug-2008 17:18

Windows->Preferences-OpenEdge Architect->Editor

Posted by Simon de Kraa on 10-Aug-2008 18:05

Ah, I was so focused on the General, Editors section somehow I missed the other OE settings altogether.

Posted by Simon de Kraa on 10-Aug-2008 18:07

Ah, I was so focused on the General, Editors section somehow I missed the other OE settings altogether.

Posted by Simon de Kraa on 10-Aug-2008 18:12

Ah, I was so focused on the General, Editors section somehow I missed the other OE settings altogether.

Posted by Thomas Mercer-Hursh on 10-Aug-2008 18:28

I see you got caught in the long pause too ... only I was on the way to composing a post, not trying to post one already written.

Posted by Thomas Mercer-Hursh on 11-Aug-2008 12:41

Well, until this morning, I thought I was getting a handle on this. Quite consistently, I would open the file from which I had stripped the excess ^Ms, stick in a using for the path, add the path to the class name, and save. Sometime during that interval, the screen would shimmy like an earthquake, and the file would reformat from 4 space indents to 2 space indents. Checking behind the scenes it also turned out that the tabs were being replaced by spaces. Since the outline was being refreshed at the same time, I suspected that this might have something to do with the AST refresh.

After that initial shift, which broke any :Index references, it would usually stay fixed, but a couple of times I have had it re-break the :Index references, perhaps because it is a file that required more edits than most.

Today, I can't get it to reformat at all. I am trying to come up with a test case for TS and doing what seems like the same things, but it is staying with the four space indents.

I don't suppose anyone knows a way to force a reformat?

Posted by GregHiggins on 23-Oct-2008 22:16

^F

In find put \t

In Replace put 2 spaces (or more of the perverse among us )

Check wrap search and regular expressions then choose Replace all.

Then ^A

Right click

Choose Source -> Correct indentation

Posted by GregHiggins on 23-Oct-2008 22:21

This fixes everything expect OEA's very annoying habit of putting do: on a new line.

You can tell that this is a feature installed by people who are not professional developers.

No sane developer would put "do:" on a line by itself (unless creating a standalone do block); every such instance forces an additional click when stepping through code with the debugger.

Since progress doesn't allow assignments in a logical test (unlike, for example, C), the values of variables at the do are the same as the values on the line preceding a do.

Posted by jmls on 24-Oct-2008 01:09

No sane developer would put "do:" on a line by itself

(unless creating a standalone do block);

quess this confirms what TMH already thinks - I am insane.

Posted by jmls on 24-Oct-2008 01:10

however, I could say with certainty that I must be one of the few who has never used the debugger to debug code

Posted by GregHiggins on 24-Oct-2008 05:19

however, I could say with certainty that I must be

one of the few who has never used the debugger to

debug code

At a recent job, I found a bug no one knew existed with just one pass through a tool routine with the debugger. It was important because performance was one of their issues, and the tool was taking twice as long as was needed to perform its task. I wasn't looking for a bug in the tool, merely passing through it on the way to finding a bug in a different procedure.

I use the debugger all the time; I use it when I'm not debugging, sometimes just to walk through a process to ensure it works the way I think it works.

Posted by GregHiggins on 24-Oct-2008 05:54

Is it possible you spend most of your debugging time looking at code you wrote or code written by people trained by you.

Posted by jmls on 24-Oct-2008 06:06

nah, I just take the Progress corporate line : it's not a bug, it's a feature

That way I don't need to debug ...

Posted by Thomas Mercer-Hursh on 24-Oct-2008 11:21

FWIW, this bizarre behavior I was seeing was eventually tracked down as a bug by Tech Support. I don't know if the fix made it into drop 2, but it was an actual bug ... just very hard to put a box around.

Posted by Thomas Mercer-Hursh on 24-Oct-2008 11:24

I think I'm on Julian's side on this one. I can't say that I do it, but I don't know that it is insane. Some people like to put their THEN at the end of the IF line, which would tend to make the next line a naked DO. I prefer a THEN DO, myself, but I don't think the other standard is insane.

This thread is closed