Line Lengths in Procedure Window... Editor

Clarion 11.1.13855
App Gen’ed
ABC

In the properties of a Window procedure you see something like this:

QuickWindow WINDOW('Update the Stores File'),AT(,,240,126),FONT('MS Sans Serif',8),RESIZE, |
          CENTER,GRAY,IMM,MDI,HLP('ViewStores'),SYSTEM
          SHEET,AT(2,1,238,122),USE(?CurrentTab),WIZARD,#ORIG(CurrentTab),#ORDINAL(1)
            TAB('General'),USE(?Tab:1),#ORDINAL(2)
              PROMPT('Store ID:'),AT(13,11,45,10),USE(?STO:StoreID:Prompt),TRN,#LINK(?STO:StoreID), |
                #ORIG(?STO:StoreID:Prompt),#ORDINAL(3)
              PROMPT('Store name:'),AT(13,25,45,10),USE(?STO:Store_name:Prompt),TRN,#LINK(?STO:Store_name), |
                #ORIG(?STO:Store_name:Prompt),#ORDINAL(4)
              PROMPT('Store address:'),AT(13,39),USE(?STO:Store_address:Prompt),TRN,#LINK(?STO:Store_address), |
                #ORIG(?STO:Store_address:Prompt),#ORDINAL(5)
              PROMPT('City:'),AT(13,53,45,10),USE(?STO:City:Prompt),TRN,#LINK(?STO:City),#ORIG(?STO:City:Prompt), |
                #ORDINAL(6)
              PROMPT('State:'),AT(13,67,45,10),USE(?STO:State:Prompt),TRN,#LINK(?STO:State), |
                #ORIG(?STO:State:Prompt),#ORDINAL(7)
              PROMPT('Zip:'),AT(13,81,45,10),USE(?STO:Zip:Prompt),TRN,#LINK(?STO:Zip),#ORIG(?STO:Zip:Prompt), |
                #ORDINAL(8)
              ENTRY(@s4),AT(65,11,40,10),USE(STO:StoreID),MSG('ID of store'),REQ,TIP('ID of store'), |
                #LINK(?STO:StoreID:Prompt),#ORIG(STO:StoreID),#ORDINAL(9)
              ENTRY(@s40),AT(65,25,164,10),USE(STO:Store_name),CAP,MSG('Name of store'),TIP('Name of store'), |
                #LINK(?STO:Store_name:Prompt),#ORIG(STO:Store_name),#ORDINAL(10)
              ENTRY(@s40),AT(65,39,164,10),USE(STO:Store_address),CAP,MSG('Address of store'), |
                TIP('Address of store'),#LINK(?STO:Store_address:Prompt),#ORIG(STO:Store_address), |
                #ORDINAL(11)
              ENTRY(@s20),AT(65,53,84,10),USE(STO:City),CAP,MSG('City of store'),TIP('City of store'), |
                #LINK(?STO:City:Prompt),#ORIG(STO:City),#ORDINAL(12)
              ENTRY(@s2),AT(65,67,40,10),USE(STO:State),UPR,MSG('State where the store ' & |
                'is located in'),TIP('State where the store is located in'),#LINK(?STO:State:Prompt), |
                #ORIG(STO:State),#ORDINAL(13)
              ENTRY(@s5),AT(65,81,40,10),USE(STO:Zip),MSG('Zipcode where the store is located in'), |
                TIP('Zipcode where the store is located in'),#LINK(?STO:Zip:Prompt),#ORIG(STO:Zip), |
                #ORDINAL(14)
            END
          END
          BUTTON('OK'),AT(9,103,45,14),USE(?OK),LEFT,ICON('WAOk.ico'),DEFAULT,FLAT,#ORIG(?OK), |
            #SEQ(2),#ORDINAL(15)
          BUTTON('Cancel'),AT(188,103,45,14),USE(?Cancel),LEFT,ICON('WAClose.ico'),FLAT,#ORIG(?Cancel), |
            #SEQ(3),#ORDINAL(16)
        END

Notice how the text is cutoff with the pipe character and then continued on the next line.

Is it possible, in the IDE, to make the line longer, or some other method, to prevent the line from being split into two lines?

Just curious.

Thank you!

1 Like
SV.IDE 
 Tools
  Options
   Text Editor
    Clarion Specific Options
      General
       Line of code width:

if I’m not mistaken that option only applies to the window/report formatters and presumably generated code

1 Like

If you are going to work in the Window… Editor you can use my AT() Sort Report Tool to flatten the Window code to be 1 Line per Control. Be sure to select “No Sort” as you do not want me reordering the controls.

This can be handy at times to work on it. You can do some things like align the AT() positions to see they are consistent. You can use the “Clean…” button to remove unimportant/unwanted things like #ORIG() and #LINK() that make lines longer and cause them to wrap e.g.

 PROMPT('Bill From Date:'),AT(139,21),USE(?BillCon:BillFromDate:Prompt),#LINK(?BillCon:BillFromDate), |
         #ORIG(?BillCon:BillFromDate:Prompt),#ORDINAL(24)
 ENTRY(@d1),AT(189,21,,10),USE(BillCon:BillFromDate),#LINK(?BillCon:BillFromDate:Prompt), |
         #ORIG(BillCon:BillFromDate),#ORDINAL(25)

! versus cleaned is shorter
 PROMPT('Bill From Date:'),AT(139,21),USE(?BillCon:BillFromDate:Prompt),#ORDINAL(24)
 ENTRY(@d1),AT(189,21,,10),USE(BillCon:BillFromDate),#ORDINAL(25)

AFAIK the #LINK() just helps when you Delete a Control to also delete related, i.e. deleting an ENTRY also deletes its PROMPT, so is always safe to remove. The #ORIG() used to be used to link Embeds, but that is now done with #ORIDINAL(). The #ORIG() is used by some control templates, so it is not removed if #SEQ() is present.


If you save and reopen it will be wrapped again at the IDE setting. Here’s your window flat and cleaned of Link and Orig:

QuickWindow WINDOW('Update the Stores File'),AT(,,240,126),FONT('MS Sans Serif',8),RESIZE,CENTER,GRAY,IMM,MDI,HLP('ViewStores'),SYSTEM
 SHEET,AT(2,1,238,122),USE(?CurrentTab),WIZARD,#ORDINAL(1)
 TAB('General'),USE(?Tab:1),#ORDINAL(2)
 PROMPT('Store ID:'),AT(13,11,45,10),USE(?STO:StoreID:Prompt),TRN,#ORDINAL(3)
 PROMPT('Store name:'),AT(13,25,45,10),USE(?STO:Store_name:Prompt),TRN,#ORDINAL(4)
 PROMPT('Store address:'),AT(13,39),USE(?STO:Store_address:Prompt),TRN,#ORDINAL(5)
 PROMPT('City:'),AT(13,53,45,10),USE(?STO:City:Prompt),TRN,#ORDINAL(6)
 PROMPT('State:'),AT(13,67,45,10),USE(?STO:State:Prompt),TRN,#ORDINAL(7)
 PROMPT('Zip:'),AT(13,81,45,10),USE(?STO:Zip:Prompt),TRN,#ORDINAL(8)
 ENTRY(@s4),AT(65,11,40,10),USE(STO:StoreID),MSG('ID of store'),REQ,TIP('ID of store'),#ORDINAL(9)
 ENTRY(@s40),AT(65,25,164,10),USE(STO:Store_name),CAP,MSG('Name of store'),TIP('Name of store'),#ORDINAL(10)
 ENTRY(@s40),AT(65,39,164,10),USE(STO:Store_address),CAP,MSG('Address of store'),TIP('Address of store'),#ORDINAL(11)
 ENTRY(@s20),AT(65,53,84,10),USE(STO:City),CAP,MSG('City of store'),TIP('City of store'),#ORDINAL(12)
 ENTRY(@s2),AT(65,67,40,10),USE(STO:State),UPR,MSG('State where the store is located in'),TIP('State where the store is located in'),#ORDINAL(13)
 ENTRY(@s5),AT(65,81,40,10),USE(STO:Zip),MSG('Zipcode where the store is located in'),TIP('Zipcode where the store is located in'),#ORDINAL(14)
 END
 END
 BUTTON('OK'),AT(9,103,45,14),USE(?OK),LEFT,ICON('WAOk.ico'),DEFAULT,FLAT,#ORIG(?OK),#SEQ(2),#ORDINAL(15)
 BUTTON('Cancel'),AT(188,103,45,14),USE(?Cancel),LEFT,ICON('WAClose.ico'),FLAT,#ORIG(?Cancel),#SEQ(3),#ORDINAL(16)
 END

If you “Alignt AT()” it can help see positions, sizes and other attributes are consistent:

QuickWindow WINDOW('Update the Stores File'),AT(,,240,126),FONT('MS Sans Serif',8),RESIZE,CENTER,GRAY,IMM,MDI,HLP('ViewStores'),SYSTEM
 SHEET,                   AT(  2,  1,238,122),USE(?CurrentTab              ),WIZARD,#ORDINAL(1)
 TAB('General'),USE(?Tab:1),#ORDINAL(2)
 PROMPT('Store ID:'),     AT( 13, 11, 45, 10),USE(?STO:StoreID:Prompt      ),TRN,#ORDINAL(3)
 PROMPT('Store name:'),   AT( 13, 25, 45, 10),USE(?STO:Store_name:Prompt   ),TRN,#ORDINAL(4)
 PROMPT('Store address:'),AT( 13, 39        ),USE(?STO:Store_address:Prompt),TRN,#ORDINAL(5)
 PROMPT('City:'),         AT( 13, 53, 45, 10),USE(?STO:City:Prompt         ),TRN,#ORDINAL(6)
 PROMPT('State:'),        AT( 13, 67, 45, 10),USE(?STO:State:Prompt        ),TRN,#ORDINAL(7)
 PROMPT('Zip:'),          AT( 13, 81, 45, 10),USE(?STO:Zip:Prompt          ),TRN,#ORDINAL(8)
 ENTRY(@s4),              AT( 65, 11, 40, 10),USE(STO:StoreID              ),MSG('ID of store'),REQ,TIP('ID of store'),#ORDINAL(9)
 ENTRY(@s40),             AT( 65, 25,164, 10),USE(STO:Store_name           ),CAP,MSG('Name of store'),TIP('Name of store'),#ORDINAL(10)
 ENTRY(@s40),             AT( 65, 39,164, 10),USE(STO:Store_address        ),CAP,MSG('Address of store'),TIP('Address of store'),#ORDINAL(11)
 ENTRY(@s20),             AT( 65, 53, 84, 10),USE(STO:City                 ),CAP,MSG('City of store'),TIP('City of store'),#ORDINAL(12)
 ENTRY(@s2),              AT( 65, 67, 40, 10),USE(STO:State                ),UPR,MSG('State where the store is located in'),TIP('State where the store is located in'),#ORDINAL(13)
 ENTRY(@s5),              AT( 65, 81, 40, 10),USE(STO:Zip                  ),MSG('Zipcode where the store is located in'),TIP('Zipcode where the store is located in'),#ORDINAL(14)
 END
 END
 BUTTON('OK'),            AT(  9,103, 45, 14),USE(?OK                      ),LEFT,ICON('WAOk.ico'),DEFAULT,FLAT,#ORIG(?OK),#SEQ(2),#ORDINAL(15)
 BUTTON('Cancel'),        AT(188,103, 45, 14),USE(?Cancel                  ),LEFT,ICON('WAClose.ico'),FLAT,#ORIG(?Cancel),#SEQ(3),#ORDINAL(16)
 END

You should change FONT('MS Sans Serif',8)' to 'Microsoft Sans Serif' as it is a True Type font not bitmapped so will appear smoother. Do it in the Window… editor. If you do it in Designer it will try to recalc the AT() DLUs and move things when they work as it. It’s good to preview the Window to see it looks fine, sometimes an AT() width needs adjustment.

2 Likes

Nifty little tool Carl! Thank you!

1 Like

Wasn’t it originally done because the parsers couldn’t handle the entire length of the statement?

You didn’t quote what you were referring to … so I guess its why were the Window lines continued and wrapped rather than being left one lone line ?

I would think its just traditional that the code was kept at about 80 character lines so it was all visible without horizonal scroll.

You can run into limits with a LIST control having a long FORMAT() and #FIELDS(). I would not exceed 1024 bytes …or maybe better said my tool cannot because it uses a TEXT control which I think is limited to 1024 over which PROP:LineCount and {PROP:Line,X} don’t work right. I think @ArnorBld has posted about that.

@RZaunere if you’re reading I’d like you to enhance the Window… Editor to have a Flatten button that does what my tool does removing continuations. An Align AT() would also be very useful as I showed above. Also make Collapse and Expand work so a SHEET, TAB, OPTION or GROUP can be folded, currently they do not show at all versus in the full Embeditor they do.

Simply asking a question. Back in the day I seem to recall that the folding was done because of an internal limitation - I’m referring to versions before 7… but I’m old so what the hell do I know?!

I don’t recall a limit on the FORMAT() itself, but there was a limitation in the PUTINI/GETINI that I ran into in Xplore for browses with a LOT of columns and the string was > 1024 characters it would get chopped in PUTINI. I ended up implementing API and I think I used a 4K buffer for it and the problem was solved.

It would be REALLY nice to have code folding in the structure editor and alignment of AT() with ALL the numbers formatted as @n_3 or @n_4 so it’s easy to line up/sort. When dealing with old, complex, windows it can help a lot to be able to reformat the code on the fly.

I was talking about the 1024 limit on lines in a TEXT() control.

It can be handy to toss some text into a TEXT() and use LOOP X=1 TO ?{PROP:LineCount} ... TextOf1=?{PROP:Line,X}. I mention FORMAT because it can make a LIST can go over 1024.

INI files have a documented limit of 1024 bytes … I think for the Value but it might be for the whole line of Label=Value.

I know, but I don’t recall running into that… Only limit I remember was the INI file, but - memory is not what it used to be

I THINK that was increased at some point, maybe to 2 or 4K. Maybe C10ish? Can’t find it in the version .txt files, so maybe not…

I think what was increased was the total file capacity, but an entry can only be 1023.

1 Like

Yes, you’re correct. WAY back the text editor used the text mode that was limited to 80 Characters. That limitation has just been carried forward.