Good idea to easily reduce code the designer must load into memory.
The wizard generates code like below (I took out the #ORDINAL() added in C7):
PROMPT('&First Name:'),AT(7,20),USE(?STU:FirstName:Prompt),#LINK(?STU:FirstName), |
#ORIG(?STU:FirstName:Prompt)
ENTRY(@S20),AT(47,20,84,10),USE(STU:FirstName),#LINK(?STU:FirstName:Prompt), |
#ORIG(STU:FirstName)
PROMPT('&Last Name:'),AT(7,34),USE(?STU:LastName:Prompt),#LINK(?STU:LastName), |
#ORIG(?STU:LastName:Prompt)
ENTRY(@S20),AT(47,34,84,10),USE(STU:LastName),#LINK(?STU:LastName:Prompt),#ORIG(STU:LastName)
...
BUTTON('OK'),AT(12,185,45,14),USE(?OK),DEFAULT,#ORIG(?OK),#SEQ(4),#ORDINAL(37)
BUTTON('Cancel'),AT(61,185,45,14),USE(?Cancel),#ORIG(?Cancel),#SEQ(5),#ORDINAL(38)
With the consistent USE(?STU:FirstName:Prompt) it would be easy to search :Prompt) and replace with :Pmt) reducing memory a little (3 bytes per).
Much less memory if you do as Rick said and changed the entire ?STU:FirstName:Prompt to ?pmt#. I would write a little program to do that. You can just change them all to ?pmt without a unique number and the IDE will add a unique :# so its ?pmt:1, ?pmt:2 etc.
You can delete the #LINK(?xxx) attributes. AFAIK those are only used when deleting controls to delete related controls. That would save a lot. If you change all the PROMPT(?xxx:prompt) then the #LINK will be broken and not do anything.
You can delete most #ORIG(?xxx) as long as there is no #SEQ(#). SEQ indicates a Control or Extension template. Sometimes the template uses the #ORIG() to find its control so if you delete #ORIG you will lose that connection, that changes generated code.
@JimA using the Window… editor you can break your connection between Controls and Templates or Embeds, so take the below few steps to backup and check your work.
- BEFORE you start check the Embeds for Orphaned Embeds (last in the list). Either delete or move those.
- BEFORE make Backup your App. You can also export the procedure to TXA.
- BEFORE save the Original generated CLW to compare afterward.
- Each time you open the Window… Editor save the original code in another editor so you can refer to it if you accidentally delete something.
- After editing Window… check the Embeds tab for Orphaned Embeds. If you see any you messed up. You can try to fix it. Failing that cancel.
- After editing generate/build then compare the CLW to the one you saved. You should see no changes or you messed up.
For those doing this in C7 and after you have to be concerned with the #ORDINAL()'s. They connect controls to embeds. Don’t delete them. Remember they get renumbered each time you save the Window so you usually cannot paste them in from a saved copy.
My At Sort Tool will flatten the Window code making it easier to edit. For Windows be sure to select “Not Sorted”. It has a Clean button that will remove all the #LINK() and #ORIG(). As I noted above have backups and check your work.
You could modify it and add a button to replace all your PROMPT()s with a ?Pmp#.