Ron
2008-08-23 06:52:02
DFM Form Parser v.26c Beta by Ron
Screen Shot:

Description:
When you make a form using the form editor in scar and save the file. You create a DFM file. This DFM file can be translated into SCAR code using the SCAR's "load form" option, but compared to this, it's obsolete. Check out the features!
Features:
* Automatically create the entire form's code with safe statements!
* FreeForm() to dissolve any memory leaks.
* Change the form name in the DFM form easily in case you made a mistake.
* Able to make your form popup in the center of your screen.
* For those advanced users, you can see how long it takes for your form to compile.
* To improve performance and decrease the size of your scar file, you can convert the statements into a WITH Statement!
* If you don't like how the SCAR window stays in the background when your form pops up, no worries, you can set it to generate the code to minimize it and then display your form!
* Able to copy code to clipboard and paste it somewhere else.
* Resize window to better see the code.
* Saves all settings including height and width of form.
* Disable resize.
* Disable maximize/minimize.
* Disable system menu.
* Force the form to stay on top of all other windows.
* Able to see only safe procedures and vars code.
* Try/Except error checking option.
* Able to see how many lines of code and how many characters total.
* ReadOnly ability.
* Variables shown as Label1, Label2, Label3 : TLabel; and the like.
* Replace width and height with clientwidth and clientheight.
* Browse button for easy file location.
* Save the code to a .scar file.
* Break down long variable lists of the same type.
* StatusBar to show you detailed information about the generated code.
* Choose from converting DFM code to SCAR code or the other way around.
Changelog:
Script is attached. If you download this script or find a bug or have a suggestion, please comment on this topic! Remember, because of lack of time, I had to release this script in beta. I've been trying to release this script for the passed 6 months, but have been fixing, modifying, and doing what I can to improve it.
~Ron :)
Screen Shot:

Description:
When you make a form using the form editor in scar and save the file. You create a DFM file. This DFM file can be translated into SCAR code using the SCAR's "load form" option, but compared to this, it's obsolete. Check out the features!
Features:
* Automatically create the entire form's code with safe statements!
* FreeForm() to dissolve any memory leaks.
* Change the form name in the DFM form easily in case you made a mistake.
* Able to make your form popup in the center of your screen.
* For those advanced users, you can see how long it takes for your form to compile.
* To improve performance and decrease the size of your scar file, you can convert the statements into a WITH Statement!
* If you don't like how the SCAR window stays in the background when your form pops up, no worries, you can set it to generate the code to minimize it and then display your form!
* Able to copy code to clipboard and paste it somewhere else.
* Resize window to better see the code.
* Saves all settings including height and width of form.
* Disable resize.
* Disable maximize/minimize.
* Disable system menu.
* Force the form to stay on top of all other windows.
* Able to see only safe procedures and vars code.
* Try/Except error checking option.
* Able to see how many lines of code and how many characters total.
* ReadOnly ability.
* Variables shown as Label1, Label2, Label3 : TLabel; and the like.
* Replace width and height with clientwidth and clientheight.
* Browse button for easy file location.
* Save the code to a .scar file.
* Break down long variable lists of the same type.
* StatusBar to show you detailed information about the generated code.
* Choose from converting DFM code to SCAR code or the other way around.
Changelog:
{ Change Log - From v.25 to v.26c - 25 listed changes ]
[ * All of the changes increased the # of lines by 700. This is the ]
[ largest update ever to the DFM Parser in 1 version and may be the ]
[ last. I hope you enjoy it. ]
[ - FEATURE: SCAR code to DFM code is experimental, but is so far, ]
[ working. It's been tested with as many DFM files tranlasted into ]
[ SCAR code and back. It's worked w/ and w/o WITH statements. You may ]
[ also check a few settings to modify the generated DFM. Enjoy! :) ]
[ - Added: Erase button. ]
[ - Added: Tabs of SCAR and DFM code. ]
[ - Added: Prompt if the user wanted to ignore the picture data or ]
[ keep the lines of code in SCAR. Constant modified slightly. ]
[ - Added: Tons of debug comments and Debug boolean const. ]
[ - Fixed: When saving, it now checks if the file already exists. If ]
[ it does, it prompts the user if he/she wants to overwrite it. ]
[ - Fixed: To prevent future problems, I created a TextBetw function ]
[ which replaces all instances of the Between() function. Since I'm ]
[ normally looking for the pos of text outside of single quotes, I ]
[ need to use a form of the Between() function accordingly. ]
[ - Fixed: SaveDialog used a default filename of the .dfm file parsed ]
[ but it also added the .dfm ext by mistake. ]
[ - Fixed: You are allowed to have blank variable names in dfm files. ]
[ This caused the parser to print out unneeded, uncompilable code. ]
[ - Fixed: The TForm and the following object would be parsed ]
[ as a TForm. And we only want the 1st object to get parsed that way. ]
[ - Fixed: Parser now ignores Parent, Top, and Left properties from ]
[ TTimer, TOpenDialog, TSaveDialog, TFontDialog, TColorDialog, ]
[ TFindDialog, and TReplaceDialog. ]
[ - Fixed: If with statements feature is on, and there aren't any ]
[ properties such as with invisible components, it won't show the ]
[ with code. ]
[ - Fixed: If you checked the 1st box, changed the name of the form ]
[ to a 3 letter name, and ran the code. The code would be messed. ]
[ - Fixed: Form Name allowed you to put in SCAR globals/types which ]
[ would make the script unable to be compiled. ]
[ - Removed: Extraneous Object Name prefix when WITH is checked for ]
[ *.Strings. ]
[ - Removed: Replace function and decided to use built-in function ]
[ even though the built-in one is a ReplaceAll function. ]
[ - Changed: Objects to ObjName. ]
[ - Changed: ObjType from String to Array of String. ]
[ - Changed: Form name from frmDFM_Parser to frmParser. ]
[ - Misc: Seperated finding vars from the generated code procedure ]
[ to clean it up a little and make debugging the main code easier. ]
[ - Misc: Changed TextBetw name to PosBetw, because PosBetw is a more ]
[ accurate name. TextBetw is now a completely different function. ]
[ - Misc: PosBetw with CheckIn False now returns the position. ]
[ - Misc: GenerateDFMCode, GetProperty, TextBetw, InvisComp function. ]
[ - Misc: You are now not allowed to make the Form Proc name blank. ]
[ - Misc: Recreated NumCom function. Much faster now. }
Script is attached. If you download this script or find a bug or have a suggestion, please comment on this topic! Remember, because of lack of time, I had to release this script in beta. I've been trying to release this script for the passed 6 months, but have been fixing, modifying, and doing what I can to improve it.
~Ron :)