List Format Parser - Split Columns into Lines for View, Edit, Compare also List Previewer

On Friday Clarion Live #604 showed my List Format Parser tool at 37 minutes in.

What it does is split the Format into one Column per Line which makes it easy to view and understand. This is formatted to paste into the Window… Editor over the ,FORMAT(), as shown below. In this case I wanted to review all the @n numeric pictures to be sure they were big enough and add commas by removing the leading “_”.

I also noticed the three [ Groups ] had a (Size) defined (73) (74) (73). That can happen dragging columns in the List Formatter. I delete those so the Group is the size of the columns it contains.

This one column per line code format also works much better for source comparison to see what column changed. There is an example in the GitHub Readme.

3 Likes

Since Friday I added Data Rows to my LIST Preview window. I highlight modifiers. Colored * cells are Red. Z Styles Teal and Y Styles are Green on Yellow, not sure about those choices… suggestons? Icons and Trees show.

I wanted Numeric Pictures to show the maximum size of the picture that can be displayed retaining 1000s grouping commas e.g. @n13.2 shows “1,234,567.12”. trying to make it easy to see if the format allows enough digits.

This is a crazy large List Format someone posted on Discuss SV that was getting an Invalid Format error. I used this tool to guess the columns with [1] [2] [3] in the heading were the problem. Being able to Preview and see his LIST was interesting …

A use for this is you see a LIST changed in source control. You can paste it into this tool and display a preview to see the actual LIST, both before and after if you run it twice.

If you try the Previewer and have some comments about how you would like the data displayed, or run into any problems, please post here?

2 Likes

A Source Comparison example from today. The below LIST Format was changed by another developer. Impossible to understand in source format wrapped.

Split into lines can easily see a [ Group ] “Employee Information” was added around existing fields, which had their heading changed. The Group has a (size) (208) I like to remove.

You can preview both before and after to visually see the LIST Format. The bottom is the newer LIST with the first 5 columns in a new Group.

2 Likes

You are a tool producing machine.

2 Likes

Ctrl+Shift+F1 true time saver.
Thank you Carl.

Thank you! You are talking about my Window Preview Class that was also shown in #604. I use it so much I wonder how I lived without it.

The name is kind of confusing. It originally was just for Window Preview but then I realized it would be useful at runtime on a “live” window. I’m thinking of renaming it “Window 411 Class” as in 411 = Slag for Information. In presentations I can use other hip slag like “let’s use Window 411 to give you the Low Down on this List Control”

Or perhaps “WnFrlvn” for Bruce :slight_smile:

Gosh im sure the code is huge!

Carl,

Thank you very much for your contribution! I use it from time to time and found it useful.

BTW I have a close question. In Clarion there is a “List Format Manager” feature. It works based on BRWFORMATS table that has 2 important columns: FORMAT and VARLINE. First looks like a standard Format string and can be parsed using your parser (I suppose) but the second one (VARLINE) is a list of Browse variables used that Format.
The problem is that sometimes when you add a new column in the Browse (in Clarion List Designer) next time you run your app you will get the messy columns list box because the Clarion format manager is used old info re columns and there is no way to sync it with a new one (only by deleting all Format Lists from BRWFORMATS and manager will recreate it again). Also, a problem is that columns can be “reordered” for different List Formats.

So my question is do you have something to manage this kind of issue in the “List Format Manager”?

Sorry I have nothing.

I had a template to Save the User’s Format to an INI, just the column widths since that’s all he could change. That had a version number it also stored. If the INI had an old Version it was Not used, so he lost his format. Now anytime I changed the Format then I had to remember to go change the Version number or it would be the mess you describe.

A safer way would probably be to simply save the Original design time Program format string in the INI and compare that instead of a version number.

1 Like

This is what my solution does. Save the original list format from the program. Compare that when the program runs and if it has changed, do not restore the user saved format.

1 Like

I used a SaveColumnWidthsToIni function. Worked pretty well.

Saving a format string in a way that someone not familiar with Clarion formats could edit it seemed dangerous.

What it saved was just a long string of concatenated widths at @n04 or @n05, which made it easy to parse.

I agree. I was only saving the PROP:Format to use to compare to the current compiled PROP:Format. If they do NOT match then assume the format changed so to be safe do NOT use the saved column Widths.

Edit: And I see this is what Rick said…

1 Like

Thank you, Carl. I see. Will check it out.

This looks like a great tool to have. How do you compile it? I’m using Clarion 10.

In the IDE use File Open Project and pick the CwProj. Once open click Build Solution

You can open the CLW files to change the code.

Hi Carl,

I attempted to do that but there were a couple of errors

Your release of Clarion 10 does not have that PROP:MsgMode feature, so comment that line out.

I’ll wrap it in a compile directive, or the quick method is to use the Hex value.

Thanks Carl, that took care of it.