PDA

View Full Version : Just for fun - Code Size


ABC123

CALocklin
01-14-2004, 07:55 AM
Just for the fun of it, I created a routine to count lines, words, and characters in a script/function or all scripts/functions in your database. There was actually a reason for checking one script (I needed it for my Script_Formatter code) but once I figured out how to do it, I decided to make a standard routine for it.

The attachment is the code itself but the easiest way to install it is to download the installation file from my website at http://www.aimsdc.net/Programs.htm. (This site probably doesn't need another 1/4 MB file.) This will install the addin ready to use - 1 AEX file and 2 Control_Panel_Addin files. See the Readme in the installation routine for usage instructions.

Name: AIMS_Code_size()
Lines: 383
Words: 1,805
Characters: 12,030

If you find it interesting, please let me know. Hearing nothing will encourage me NOT to do things like this in the future.

(In case anyone wonders why I keep putting AIMS in front of the 'stuff' I produce, it isn't vanity, it's laziness. When v5 came out I had to change a bunch of function names because I had used the same name as some of the new v5 functions. Somebody (foolish) might come out with another Code_size() function but they probably won't come out with another AIMS_Code_size() function!)

Peter.Greulich
01-15-2004, 04:30 PM
In case anyone wonders why I keep putting AIMS in front of the 'stuff' I produce, it isn't vanity, it's laziness

No apology needed. There is nothing wrong w. marketing a brand name - esp. from someone who has a lot to contribute.

CALocklin
02-15-2004, 05:39 AM
I just updated the installation file today. The original version counts the scripts/functions using W_count() which means that the count will be too high if you leave blank spaces in your script or function names. I simply changed the command to Line_count() in two places.

The line count, word count, and character count were not affected by this problem.