Monday, January 30, 2006

RB CodeHelper Lite: New "Better Beta" Available!

A new version of RB CodeHelper Lite is ready for people to beta-test, with some enhancements by Mark Nutter (read on!) and some bug fixes! I very much appreciate Mark's kind comments about the program as well as his his additions to the code.

Below are comments from two recent emails from him (the ">" indicates his quoting of my previous email, and ">>" indicates my quoting of his original email):

-------- Original Message --------
Subject: RB Code Helper Lite on Mac
Date: Thu, 26 Jan 2006
From: Mark Nutter
To: Barry Traver

Hi Barry,

I just downloaded RB Code Helper Lite, and since you asked for some
Mac vetting, I thought I'd send back some comments....

GUI issues: In the Source tab, the SourceTopGoButton does not look
right on my Mac--the font is distorted somehow due to being too big
to fit in the button. I changed the fontsize back to zero in the
IDE, and it looks much nicer on my system. Also the "Whole Word"
checkbox next to it was word-wrapping; I changed the width to 118
and it straightened out again.

I must say, though, it looks very good, and I'm very pleased with it.
I've been writing some articles for the RBLibrary, and I'm very
enthusiastic about having something like this around to help tidy up
and extract the source code listings for my articles. I did a bit of
playing around with the source code since you were kind enough to
include it, and I'm sending back a contribution, if you're
interested. I've shoehorned in an Acrobat-style bookmarks pane
beside the source code view, i.e., a hierarchical listbox that gives
all the objects in the source code, and underneath, if you click on
the disclosure rectangle, each of the methods in the object.
Double-clicking on any item takes you to the source code for that
item in the listing.

It's just a rough cut, but I thought it might interest you. It gave
me a few hours amusement :) I hooked it into your DoIndent method
and your GetCurrentX and GetCurrentS methods, and [it] wasn't too
hard once I figured out your code enough to keep track of where each
method was appearing in the final text buffer. It could use a nice
SplitPane control so it could be resized, but otherwise it seems to
be working fairly nicely now. Take the code and do with it as you
will, I am making it as a contribution in thanks/return for your own.

I also added Cut/Copy/Paste to the Edit menu and disabled the code
for hiding it, but that was just for my own personal utility so I
could cut and paste the code listings; hope you don't mind my messing
with that. I tried to mark all my code changes with "////// mn" so
hopefully you should be able to find everything by searching for that
particular string.

Thanks again for all the work you put into this, it looks like a
cool/clever/useful tool.

Cheers.

Mark

---End of Original Message ---

-------- Original Message --------
Subject: Re: RB Code Helper Lite on Mac
Date: Thu, 26 Jan 2006
From: Mark Nutter
To: Barry Traver

>... Incidentally, when downloading a text file from the Internet, RB
>CodeHelper Lite (RBCHL) can tell you after it is downloaded (and
>unzipped, if necessary) whether it's a Mac file, a Windows file, or
>a Linux file. It's commented out, but it's in the OpenXMLFile
>Method.

Cool, I'll have to check that out.

>>I must say, though, it looks very good, and I'm very pleased with
>>it. I've been writing some articles for the RBLibrary, and I'm very
>>enthusiastic about having something like this around to help tidy
>>up and extract the source code listings for my articles.
>
>Can I quote you on that?

Be my guest. :)

>Anyway, I share the source code ("warts and all") for almost
>everything I write, in the hope that people will share back, either
>source code for programs which they've written or comments on how
>my own source code can be improved. (By the way, what is the
>status of the source code of the program you sent? If (as I expect
>I will) incorporate the suggested changes in future versions of
>RBCHL, do you have any objections to my sharing the source code
>publicly?

It's yours to do with however you see fit. Credit would be
appreciated but is not required. It is intended as a contribution in
kind to thank you for making your code available.

>>I've shoehorned in an Acrobat-style bookmarks pane beside the
>>source code view, i.e a hierarchical listbox that gives all the
>>objects in the source code, and underneath, if you click on the
>>disclosure rectangle, each of the methods in the object.
>>Double-clicking on any item takes you to the source code for that
>>item in the listing.
>
>BRB. I just tried it out. Your description seduced me into
>stopping to take a look at what you did, and I love it! Can I share
>it with others and/or incorporate it as a permanent addition to the
>program?

Sure, whatever you like. I'm glad you like it. :)

[snip comments about internal format of RB XML files -- I definitely
want to keep that around for my records, I've poked around that
format myself and noticed some of the same *ahem* irregularities as
you, but I think you've gone farther than I in sleuthing them out.]

>RB CodeHelper Lite is a subset of a larger CodeHelper program,
>which includes some features that no longer work properly
>(although many do). One feature which may or may not now work
>is one that I found to be very helpful. Let me describe it.
>
>I hate setting initial values of control Properties within the RB IDE.
>Therefore I wrote for CodeHelper a routine so that you could
>_safely_ and _easily_ edit the initial values for control
>Properties. The only thing I hadn't (and haven't) worked out was
>(and is) the ability to handle control arrays, but most Projects
>don't use control arrays, and the routine made it easy for me to set
>the various control attributes in a very friendly fashion. (And if
>you did have control arrays, you could always do normal
>"unprotected" altering of the XML code.)
>
>When you chose to edit initial values for control properties, you
>were taken to the appropriate place in the XML display. You could
>edit what was between the ">" and the "<" but not move left or right
>over those symbols. You were confined to an appropriate field. If
>you pressed the down arrow, you were taken to the next appropriate
>field to edit (usually on the immediate line below, but occasionally
>you'd jump to the next control). (The up arrow worked in a similar
>fashion.)
>
>Does that sound like a useful feature to you? Or do you have some
>suggestions as to some useful features that you might like to see
>added?

Yes, that sounds like a good feature for a number of applications:
XML editor, HTML editor (with templates), as well as CodeHelper....

>>... I tried to mark all my code changes with "////// mn" so
>>hopefully you should be able to find everything by searching for
>>that particular string.
>
>RBCHL has its own particular special combinations for comment
>symbols, here and there. If you inspect the code, for example,
>you'll see that "///" is a marker for what might be called a
>"permanent comment," one that RB CodeHelper Lite is not supposed
>to remove.
>
>>Thanks again for all the work you put into this, it looks like a
>>cool/clever/useful tool.
>
>Again, can I quote you on that? Or would you be willing to write up
>a couple of sentences that you wouldn't mind my quoting? I've asked
>so many "stupid" questions on the RB mail lists that I'm not sure
>what credibility I have as a programmer, so a comment from
>someone like you could be helpful. (No pressure, however.)

You can quote me, and don't worry about credibility. Stupid questions
made me what I am today. :) When you can ask a question, get an
answer, and turn it into useful code, what else is there? I know a
lot of people that can get an answer and still can't write the code,
and I know even more who can't even ask the question!

Cheers.

Mark

---End of Original Message ---

Important: RB CodeHelper Lite is still in beta-test format, so additional feedback would be much appreciated, especially from people with Macs. (For a demo of just one of its seventy-seven or more features, go to http://traver.org/ss/.)

Barry Traver



Home Page for This Blog: http://traverrb.blogspot.com/

Programs and Files Discussed in the Blog: http://traver.org/traverrb/

Sunday, January 29, 2006

diffpatch124: Not much improvement over diffpatch114?

A couple of days ago I indicated that my diffpatch program (diffpatch114) did what it was intended to do, but it was neither user-friendly nor optimized for speed. Well, diffpatch124 is a slight improvement, but not much of one.

Here's how I described the the program and its deficiencies:

"diffpatch has two parts: "The diff [part] compares two versions of a document, generating a set of differences that reflect the changes that need to be applied to the old document to make it identical to the new document.... By running the patch [part], the document contents can be updated to the new version...."

"The major problem with diffpatch114 is two-fold: (1) it takes a l-o-n-g time for the program to process long files, and (2) the user is given no visual clue that the program is still at work. It is possible at this point that the user (at least in Windows) can "break" the program by clicking and reclicking the File menu to try to determine if the program is "alive." Rather than doing that, such a process itself may cause the program to "lock up" and "fail to respond" (again, at least in Windows)."

Well, diffpatch124 now uses a progress bar to show that the program is busy at work creating the differences file, but the process is still very l-o-n-g. The problem is not with the "patch part" of the program (that works almost instantaneously), but with the "diff" part of the program.

If anyone has any suggestions on how the program can be significantly speeded up (the diff part, not the patch part), I'll be glad to hear them. In the meantime, you'll have to take the program "as is." It does what it claims to be able to do, but it doesn't do it in the most efficient fashion.

I haven't yet found the RB program I wrote that is able to apply UNIX-format difference files, but I did find an RB program I wrote that will apparently convert a UNIX-format file into a Traver-format file as well as convert an Edit Pad Pro "compare files" differences fil into a Traver-format file. (I had forgotten that I had written such a program.)

Although our Abyssinaian, Ruby, doesn't like it when I use this metaphor, I'm too old a dog to change now: "There's more than one way to skin a cat." If the diff part of my diffpatch program cannot be greatly improved in speed, is there another (and faster) way that I can create a Traver-format differences file automatically?

Specifically, is it possible to write an RB program to automate a Windows Unix-style diff program (or a Mac UNIX-style diff-program) from RB so that the UNIX-style diff program will create the UNIX-style differences file (which it can do fairly quickly) _and then_ (this part is already done relatively efficiently in the new RB program I discovered) the RB program will covert that UNIX-style differences file to a Traver-format differences file?

Or (to mention a similar theoretical possibility) is it possible to write an RB program to automate my Edit Pad Pro (a Windows program) from RB so that Edit Pad Pro will produce the Edit Pad Pro "compare files" differences output (which it can do fairly quickly) _and then_ (this part is already done relatively efficiently in the new RB program I discovered) the RB program can convert that Edit Pad Pro "compare files" differences output to a Traver-format differences file?

I don't know the answers yet (I'm just thinking out loud, so to speak). The only point at this point is that in programming there is usually more than one way to accomplish a particular task and the "best" solution is not automatically the "most direct" or "obvious" approach (although that may be most often the case).

In programming, there is always room for innovation, ingenuity, creativity, and invention (especially necessary when the required technical expertise may not be there?).

Barry Traver

P.S. Stay tuned. In the next entry, I'll be discussing my RB CodeHelper Lite program as enhanced by Mark Nutter!



Home Page for This Blog: http://traverrb.blogspot.com/

Programs and Files Discussed in the Blog: http://traver.org/traverrb/

Saturday, January 28, 2006

RB Browser/Editor enhanced by Steve Garman

If you've been finding my RB Browser Editor for the Language Reference (RB-BE-LR) useful, you'll be glad to hear that a version enhanced by Steve Garman (RB-BL-LPsg) using code by Mars Saxman as a foundation is now available.

The feedback I got on my program indicated that some people thought it would be nice if it had a Splitter so that the amount of space given to the browser and the editor could be adjusted. At my request, Steve Garman added such a feature.

Here are recent relevant emails I received from Steve:

-------- Original Message --------
Subject: Splitter
Date: Tue, 17 Jan 2006
From: Steve Garman
To: Barry Traver

Barry,

In the end, I decided not to mess around with a general-purpose splitter.

I've taken out most of the resizing code and added a canvas called
horizSplit.

Hope this is the sort of thing you were looking for.

Regards,
Steve
--
Steve Garman
Using REALbasic 2006r1 Professional on Windows XP Pro
-----End of Original Message -----

-------- Original Message --------
Subject: Re: Splitter
Date: Fri, 27 Jan 2006
From: Steve Garman
To: Barry Traver

In a message regarding Re: Splitter dated Fri, 27 Jan 2006,
Barry Traver said that ...

> Thanks. It seems to work fine. Do you have any objection to my
> releasing it publicly (including source code)? And how do I word the
> acknowledgement? Did you write the Splitter, or should I give someone
> else credit for that (and simply give you credit for incorporating it
> into the program)?

Barry, you're very welcome to publish the code.

It's dignifying my addition to call it a splitter, it's just a canvas
dragged onto the window which takes advantage of the new MouseDrag event.

There's really no need to give me credit.

The code in the Paint event that draws the handle was copied from Mars Saxman's splitter control at http://www.redplanetsw.com/realbasic/. It would probably be polite to mention that.

--
Steve Garman
Using REALbasic 2006r1 Professional on Windows XP Pro
-----End of Original Message -----

For the sake of those unfamiliar with the program (download RB-BR-LR for the original version or download RB-BE-LRsg to get Steve's enhanced version), RB Browser/Editor for the Language Reference not only makes it easy to add your own annotations and code snippets to the Language Reference files so that your additions can be accessed from within the RB IDE, but also makes it easy to add links to relevant outside materials in HTML. (See http://snurl.com/lc4o for a general description of the program and see http://snurl.com/lc4p for a decripiton of a related utility.)

Enjoy!

Barry Traver

P.S. Make sure you've downloaded RB-BE-LR2.zip and RB-BE-LR2sg, which are replacements for the RB-BE-LR.zip and RB-BE-LRsg.zip files I uploaded earlier. The new versions include two bug fixes, one of which which prevented internal links from working properly.



Home Page for This Blog: http://traverrb.blogspot.com/

Programs and Files Discussed in the Blog: http://traver.org/traverrb/

Thursday, January 26, 2006

Learning Better Programming from diffpatch114?

I wrote diffpatch114 about two years ago, when I was a complete novice in REALbasic. Although the program in one sense seems to work flawlessly, in another sense it is a good example of bad programming, an illustration of what to avoid (and hence, I hope, a step toward better programming).

diffpatch has two parts: "The diff [part] compares two versions of a document, generating a set of differences that reflect the changes that need to be applied to the old document to make it identical to the new document.... By running the patch [part], the document contents can be updated to the new version...."

The major problem with diffpatch114 is two-fold: (1) it takes a l-o-n-g time for the program to process long files, and (2) the user is given no visual clue that the program is still at work. It is possible at this point that the user (at least in Windows) can "break" the program by clicking and reclicking the File menu to try to determine if the program is "alive." Rather than doing that, such a process itself may cause the program to "lock up" and "fail to respond" (again, at least in Windows).

Let's talk about the second problem first. My CodeHelper solves such a problem by using three techniques to let the user know that the program is "working" on a task: a progress bar is ... well, making visible progress, the mouse cursor is changed to indicate that the computer is busy, and the word "working" is displayed in colorful big bold print. Of these, the progress bar is the most important. So a progress bar should be added to diffpatch114.

The first problem may involve some exploration. In order to speed up the process, I need to find out what part of the process is taking up the most time or an unnecessarily long time. One way I can do that is insert MsgBoxes at appropriate points in the process (MsgBox "1", MsgBox "2", MsgBox "3", etc.) to see what steps seem to take unduly long. For example, if there's a long time between MsgBox "4" and MsgBox "5", I then know what portion of my code needs to be examined (viz., the code between MsgBox "4" and MsgBox "5").

When placing the MsgBoxes, of course, it is ordinarily best not to place them within any loops (Do/Loop, For/Next, etc.). MsgBoxes are how I learned with RB 5.5.x that - although Split worked seemingly instantaneously, Join could take a long time for large arrays (i.e., arrays with tens of thousands of elements in them). (I haven't tested RB 2005 or RB 2006 to see whether Join has been improved, but a while back on one of the RB mail lists Walter Purvis gave me an excellent replacement for "Join" which is called "MyJoin" but works the same way, but only faster.

I just used diffpatch with two file versions, each of which was approximately 20,000 lines long, so I know that the diff part works and I know that the patch part works, because I was able to create a differences file that I was able to apply to the original file to (re-)create the revised version of the file. (I used the "Compare Files" feature of Edit Pad Pro to compare the two files, and Edit Pad Pro told me that they were "identical.")

Anyway, I hope to make an improved version of diffpatch available in the near future. In the meanime, use the bad programming in diffpatch114 as an example of what to avoid and as a step toward better programming. Keep your user informed as to what is taking place (using a progress bar, etc., where appropriate), and don't be content to just get your code working dependably: optimize it!

Barry Traver


Home Page for This Blog: http://traverrb.blogspot.com/

Programs and Files Discussed in the Blog: http://traver.org/traverrb/

Wednesday, January 25, 2006

diffpatch: An Alternative to the Unix Programs

First, some background:

"The standard Unix tools diff and patch are used to find the differences between text files and to apply the differences. These tools operate on a line by line basis using well-studied methods for computing the longest common subsequence (LCS)."
--http://diffxml.sourceforge.net/

My own diffpatch program in REALbasic (written about two years ago) does not use "well-studied methods for computing the longest common subsequence (LCS)," but it can be "used to find the differences between text files and to apply the differences" and it does "operate on a line by line basis."

Here's a description of "How diff and patch Work":

"The diff program compares two versions of a document, generating a set of differences that reflect the changes that need to be applied to the old document to make it identical to the new document.... The set of differences can be transported to someone who has the original copy of the document. By running the patch program, the document contents can be updated to the new version...."
--http://snipurl.com/lwx8

The output of a diff program may have a variety of formats, but the three most common are normal, context, and unified. I wrote a REALbasic program that can handle (not the creating of, but) the applying of at least two of those three UNIX-style formats. That is, I wrote a program that is a patch program in RB: it requires a UNIX-style program to create the file indicating the differences, but once that file has been created, it can apply that file to the original document to update the contents of that document.

I wrote these two programs primarily as an RB novice because (rightly or wrongly) I understood someone to be telling me that I couldn't do it. He was correct in that I knew nothing about the "well-studied methods for computing the longest common subsequence (LCS)," but even though I didn't know enough to be able to write a really efficient diff program, it was simple to write a patch program to update documents using those UNIX-style difference files and fun writing my own diffpatch program with my own format.

How does my format (used in diffpatch) differ from the UNIX files? The significant thing (if there is any) is that my format does not include any lines from the original document. What this means is that if the original document is copyrighted by someone else, then I can publicly post my own updates and modifications without getting into trouble for violation of copyright. (Text files that can be updated, for example, include HTML files - such as are found in the Language Reference - and XML files - such as the format in which RB Projects can be saved.)

I haven't tracked down my patch program yet (the one that handles at least two of the UNIX formats), but I have made available my diffpatch program (look for it in the usual place). It is rather limited in its practical usefulness, but it was an interesting program to write, and you may find it to be of interest also, even if only as a "curiosity piece."

Barry Traver



Home Page for This Blog: http://traverrb.blogspot.com/

Programs and Files Discussed in the Blog: http://traver.org/traverrb/

Tuesday, January 24, 2006

TraverToy4: Extracting Source Code from XML

TraverToy4 is very similar to TraverToy1. The difference is that TraverToy1 removes blank lines from source code, while TraverToy4 extracts the source code from the XML file and allows you to save it as a text file. (Important: No indenting is done. I hope to return to that topic sometime in the future.)

XML is similar to HTML. In fact, an XHTML file is an XML file. The most important thing to realize is that important pieces of data are surrounded, left and right, by angle brackets discribing the data.

For example, take this line of XHTML:

C.S. Lewis's <b>most</b> popular children's book is <i>The Lion, the Witch, and the Wardroble</i>.

The <b> and </b> "bookends" indicate that the word "most" is to be put in bold type. The <i> and </i> "bookends" indicate that "The Lion, the Witch, and the Wardrobe" is to be put in italic print. (Note, by the way, that the right closing tag has a right slash ("/") immediately after the first angle bracket.)

Similarly, in REALbasic's XML format, <SourceLine> and </SourceLine> are the "bookends" used to enclose REALbasic source. Extract from the file what you've got between those two tags, and you have all the source code. It's as simple as that.

To use TraverToy4, Open an XML file, Process the file, and save the result as a TXT file. If you want to take a look at how indenting can be done, you can download RB CodeHelper Lite (RBCHL), but hold off on doing that until tomorrow (Wednesday, January 25, 2006),by which time I hope to have available an improved version, with some features added and some bugs removed.

TraverToy4 should work equally well on a Mac as in Windows, but I don't have a Mac myself (yet), so I can't guarantee that it will work properly "as is" on the Mac. If you as a Mac user have to make any minor modifications, I hope you'll let me know, so that I can pass the information for the benefit of other Mac users of REALbasic. (For example, I'm not quite sure how the Mac handles FileTypes, but I know it works a bit differently from the way it works in Windows.)

Barry Traver



Home Page for This Blog: http://traverrb.blogspot.com/

Programs and Files Discussed in the Blog: http://traver.org/traverrb/

Saturday, January 21, 2006

Looking Back: Index for the Past Month

Sorry about the delay in posting a new entry, but I've kept my promise about trying to put up a new entry for every other day on the average. Here's the evidence:

Saturday, December 17, 2005
REALbasic (RB): A Cross-Platform Language

Sunday, December 18, 2005
TraverToy1 and Removing Blank Lines

Tuesday, December 20, 2005
TraverToy2 and Platform Determination

Tuesday, December 20, 2005
CardTrick for Windows Only

Wednesday, December 21, 2005
RB Browser/Editor for Language Reference

Thursday, December 22, 2005
Language Reference Utility1 for RB Browser/Editor



Saturday, December 24, 2005
XML: All You Need to Know in One Easy Lesson

Sunday, December 25, 2005
What's Planned for the Future for This Blog?

Tuesday, December 27, 2005
Method "Overload" Example: A Debugging Aid

Thursday, December 29, 2005
Method "Overload" Comments: Further Discussion

Friday, December 30, 2005
Intro to RSS and Some RB News Feeds

Wednesday, January 04, 2006
RB CodeHelper and RB CodeHelper Lite

Friday, January 06, 2006
More Info on What CodeHelper Lite Can Do

Saturday, January 07, 2006
Now Available: "Alpha" Index for RB 2005 LR

Sunday, January 08, 2006
More Info on "Alpha" Lists for RB 2005 LR

Monday, January 09, 2006
Still More on What RB CodeHelper Lite Can Do

Wednesday, January 11, 2006
RB CodeHelper Lite: Finishing Up the Features

Thursday, January 12, 2006
TraverToy3: RB Code Indenter

Sunday, January 15, 2006
RB CodeHelper Lite: Now Available But....

Tuesday, January 17, 2006
RB CodeHelper Lite: Just Thinking Out Loud

So that's twenty entries for the past month. As you can figure out from the blog entry titles, I also made available seven programs (RB Browser/Editor for the Language Reference, Utility for the RB Browser Editor, RB CodeHelper Lite, TraverToy1, TraverToy2, TraverToy3, and the Windows CardTrick) and four files (long and short "Alpha" indexes for RB 2005 and RB 2006). I'll see if I can do better than that this month, starting with a new (but simple) TraverToy with the next entry.

Barry Traver



Home Page for This Blog: http://traverrb.blogspot.com/

Programs and Files Discussed in the Blog: http://traver.org/traverrb/

Tuesday, January 17, 2006

RB CodeHelper Lite: Just Thinking Out Loud

I've made available an updated version of RB CodeHelper Lite. It had worked fine on other Projects which I had tried it on, but did not work properly with Thomas Tempelmann's helpful RB Project Tool.

I think I've fixed CodeHelper for now, but - because of RS's lack of full documentation of their XML format - working with XML is like "the scientific method," complete with its disadvantages which result in "temporary truth" at the best. I'm not an Einstein, but it's like progressing in the same way that Newtonian science "progressed" to Einsteinian physics.

That is, rather than being able to use the deductive method, which - given the proper premises - can provide "true truth," you have to be content with the inductive method, which provides at best "probable truth" or "temporary truth," which only works until something better comes along. Specifically, like F = ma my method of obtaining information on RB controls worked fine until Thomas Tempelmann's program came along (just like Newton's laws worked fine until they confronted the situation of particles moving at speeds close to the speed of light, where mass could no longer be considered a constant but was obviously related to speed and/or acceleration, hence e = mc squared).

Although my method worked with all previous cases, when Thomas Tempelmann's program came along I had to work out a different approach which would encompass both the earlier programs and Thomas's as well, which broke the earlier "rules" and showed them to be inadequate (just as the inductive statement "all bears are brown" is "true" until once comes across the first polar bear).

RS's way of phrasing the situation is this: "The XML produced by REALbasic is well-formed, but it cannot be "validated" because it does not include a 'document type declaration.'" What this means is this: "We won't tell you the rules. All we'll do is tell you that there are rules, and it's up to you to infer them as best you can." It makes it fun to work with XML because of the intellectual challenge, but it's also true that you don't know when you're going to meet your first polar bear. That is, the best I can say is that CodeHelper at a certain stage can handle all of the programs it has met thus far, but that is no guarantee that it can handle some program it hasn't met yet.

One other consideration to deal with: RS doesn't tell you the rules, because it changes the rules. Load an old program into RB 5.5.x, and save it as an XML file. Load the same program into RB 2005 or RB 2006 and save it as an XML file. Now compare the two XML files. The differences are considerable (e.g., the RB 2005 or RB 2006 XML file may be a hundred lines _shorter_ than the RB 5.5.x file!). Will my induced rules work with the new format? Maybe yes, but maybe no.

Fortunately, most of them seem to continue to work (including all of those in RB CodeHelper Lite, now that I've fixed the problem with handling Thomas Tempelmann's program), but they cannot be "validated," because RS does not make available a "document type declaration" (even though that is fairly standard procedure with XML formats). Let me give two examples of where what worked before no longer works.

Example #1: When you print out the source code from within the RB IDE, it ordinarily does NOT print out in alphabetical order. With RB 5.5.x, I worked out a way to manipulate the XML file so that it would put the Properties and Methods into alphabetical order when printed out from the RB IDE. That way no longer works.

Example #2: For some reason, RB will from time to time introduce empty event procedures in the XML file. They don't affect the running the program, but they are extraneous and unnecessary. (Essentially you'll have a Function line and an End Function line with nothing between them except perhaps a blank line.) With RB 5.5.x I worked out a way to remove those "empty" event procedures. That way no longer works.

How do I handle such situations? For the time being, I am not trying to put out two different versions of CodeHelper, but one version containing only those routines which work with all versions of RB from 5.5.x. on. If something works only with the 5..5.x version of XML, then that feature is removed (at least for now) from CodeHelper.

Programming can be an interesting endeavor and a real challenge at times....

Barry Traver



Home Page for This Blog: http://traverrb.blogspot.com/

Programs and Files Discussed in the Blog: http://traver.org/traverrb/

Sunday, January 15, 2006

RB CodeHelper Lite: Now Available But....

RB CodeHelper Lite (described previously in this blog) is now available, but...

It has NOT been extensively beta-tested. In particular, it has not been adequately tested on the Mac. If you have a Mac, use it at your own risk. In addition, your downloading it is conditional upon your wilingness to supply some feedback as to whether it works properly.

I do not (yet) own a Mac, so - although RB CodeHelper Lite (RBCHL) seems to work fine in Windows - it may or may not run well (and perhaps may not run properly at all) on a Mac. I hope I made appropriate adjustments for the differences between Windows and the Mac, but I have no way of testing that for myself to make sure.

Here are some of the differences that could affect the running of RBCHL:

(1) EndOfLine is different for the Mac, Linux, and Windows. For the Mac, the EndOfLine marker is Chr(13); for Linux, it is Chr(10); but for Windows, it is Chr(13) + Chr(10). But that's not all. Unlike the Mac and Linux (where the same EndOfLine marker is used consistently), Windows uses a different EndOfLine marker in an EditField than it does elsewhere. Specifically it uses Chr(13) rather than Chr(13) + Chr(10).

(2) Not having a Mac, I'm not able to test whether or not I've set up the FileTypes to work correctly on a Mac. I'm not sure, for example, what to indicate for "MacType" and "MacCreator." Nor do I really know what to put down for the settings for "MinimumMemory" or "SuggestedMemory" on the Mac. It could be that incorrect settings here could prevent the program from running properly on a Mac.

(3) In RB CodeHelper Lite, I load the entire XML file (sometimes 15000+ lines) into an EditField, and I've had no problems. I have been told by a couple of Mac users, however, that it is not a good idea to load that large a string into an EditField on a Mac. It has caused me no trouble at all in Windows, but it may not be as safe on a Mac.

If you do download RB CodeHelper Lite, I would greatly appreciate hearing from you as to the results, particularly if you're using a Mac. You may want to start with smaller Projects and perhaps stay away from the XML tab entirely (although the contents of the EditField on the Source tab can also be fairly large).

Here's the basic eight-step procedure for testing RB CodeHelper Lite:

(1) From the RB IDE, load in a Project and use File --> Save As with "File as type:" set to "XML Project (*.xml)" to save the Project as an XML file.

(2) Exit RB, Run RB CodeHelper Lite, and use File --> Open XML File to load in the file you just saved.

(3) Try some simple things, such as changing the line spacing, displaying a list of controls in the Project, or adding an automatic procedure header or footer to each Method. The Main Menu Tab is where you tell RB CodeHelper Lite what to do. Rather than use the PushButton at the bottom of the page, you can double-click a category to expand it or on an item to perform the task.

(4) If you've done something that modifies the program (rather than just analyzes the data), you can see the result of what you've done on the Source Tab or XML Tab (but, as I said, you may want to avoid doing that if it's a large file and you have a Mac "classic").

(5) If desired, in RB CodeHelper Lite you can use File --> Save XML File to save the result to disk. (As long as you keep a copy of your original .RB or .RBP file, you're safe even if RB CodeHelper Lite should mess up the XML file. I don't expect that to happen, but CodeHelper is still insufficiently tested, particularly on the Mac, so it's possible.)

(6) Then, if you like, you can use File --> Open with "Files of type:" set again to "XML Project (*.xml)" to load the XML file into RB 5.5.x or RB 2005 to look at the code or to run the program to confirm that it still runs as before.

(7) Then, if you're pleased with the result, you can use File --> Save As with "Files of type:" set to "REALbasic Project (*.rbp, *.rb)" to save the Project as a normal (.RB) REALbasic program file.

(8) Finally (and this is a really important step), you need to let me know the results, particularly of any problems you may have encountered.

Incidentally, I've decided to set up a special blog specifically for REALbasic users who are running RB in Windows. You'll find it at this address:

http://traverrbw.blogspot.com

Enjoy!

Barry Traver



Home Page for This Blog: http://traverrb.blogspot.com/

Programs and Files Discussed in the Blog: http://traver.org/traverrb/

Thursday, January 12, 2006

TraverToy3: RB Code Indenter

Something that may be surprising is that the XML file for an RB Project contains no information on the indenting of the code. If you, for example, simply extract the source code information, everything is "flush" with the left margin, i.e., there is no indenting.

So if you want to have properly indented code from the information in the XML files, you'll have to add the formatting yourself, according to the rules that REALbasic itself uses. As far as I know, that information is nowhere documented, but it is not that difficult to figure out.

Here are the rules, discovered from observation. If a line begins with "Case," "Do," "Else," "ElseIf," "Exception," "For," "Select Case," or "While," the following line is indented one level. If a line begins with "Case," "Else," "ElseIf," "End Function," "End Select," "End Sub," "Loop," "Next," or "Wend," that line is outdented one level. If a line begins with "If" and ends with "Then," the following line is indented one level. And if the preceding line end with a "_" (a line continuation character), that linje is indented some extra spaces (but more than one level). That's about all there is to it.

TraverToy3 is able to do three things: (1) Open an XML file and show you the source code with no indents, (2) Open an XML file and show you the appropriate indents, or (3) Open an XML file and (for testing purposes) show you the appropriate indents with the indent level indicated by a number. Thus if you look at all the 1's or all the 2's or all the 3's, etc., you should see related lines (e.g., associated lines beginning with "If," "ElseIf, "Else," and "End If" belonging to the same If/ElseIf/Else/End If statement) having the same number at the beginning of each line.

TraverToy3 is also able to save the results to disk. In Windows, you can also use Copy and Paste to put the EditField text into a plain text editor (such as Notepad for Windows or its equivalent on the Mac) and save the text to disk from there (but I've had mixed reports as to whether that also works on the Mac).

TraverToy3 is a subset extracted from RB CodeHelper Lite, with an additional routine added (the testing routine). It is my hope that the code is "clean," not containing anything extraneous, but it's possible that I may have missed something, so please be tolerant of that.

TraverToy3 contains some useful Methods. For example, MyJoin (which is NOT "My" Join, but Walter Purvis's) is an improvement over the Join contained within REALbasic. You may also want to take a look at routines such as BetweenTags, ConvertHex, CutOffRight, HowMany, IsSource, Mid1, MinNonZero, OutsideQuotes, Rpt, StartsWith, CheckForXMLFile, GetSourceAndComment, GetWholeLine, and ResizeIt, most of which I hope to take a look at in future blog entries.

IMPORTANT: I make no claim that my code is the best way to perform these particular tasks, but simply that it is a way to accomplish certain goals. If you have improvements to sugest, please do so. Just as I hope that you will learn something from this blog, I'm hoping to learn something from this blog as well.

Barry Traver



Home Page for This Blog: http://traverrb.blogspot.com/

Programs and Files Discussed in the Blog: http://traver.org/traverrb/

Wednesday, January 11, 2006

RB CodeHelper Lite: Finishing Up the Features

Previous blog entries have discussed some of the things that RB CodeHelper Lite can do. This entry attempts to consider briefly most of the other features (but be aware that although RB CodeHelper has seventy-seven different tasks it can perform, RB CodeHelper is expected to have even more: about twice that number!).

RBCHL can display (properly indented) source code on the screen for the entire Project or for a particular Method. The code can be saved to disk or printed out if so desired. The size of the indentation can be increased for greater readability (or reduced to the normal amount). And a search feature (including "whole word" search) is also available.

Some programs contain deadwood, such as Properties that are defined but never used or Variables that are DIMensioned but never used. RB CodeHelper Lite can tell you if you have any such in your Project, and can also tell you if you've used the same name for a Property and Variable (not good programming practice!).

You can have some fun "obfuscating" and "unobfuscating" your source code. The fuller CodeHelper program has a number of ways to do this (switching existing names, using randomly created meaningless names, randomizing upper/lower case). RB CodeHelper Lite has simply one example: switching the names of controls around (so that what was called EditField1 may now be perhaps called PushButton2, and so on). This feature has no practical usefulness that I can see, but it can be fun to pass along the "obfuscated" source code of a program and watch someone struggle to try to make some sense out of it.

RB CodeHelper Lite also makes it easy to change the name of a control, method, property, variable, etc., throughout a Project. It can do other miscellaneous tasks, including checking nested For/Next loops for the same counter name used on different levels. You can combine partial source lines (i.e., those which make use of the "_" line continuation character). And you can remove all highlighting, placing the cursor in the top left corner of each Method (thus avoiding the risk of accidentally deleting selected code).

You can remove comments or comment symbols, and differentite between the different types of comments, using different symbols for different purposes. (RB CodeHelper Lite does have one arbitrary convention: it regards comments preceded by "///" to be "permanent" comments and thus will not remove them.)

Finally, you can use RBCHL to work with Dim statements in various ways. You can put individual Dim statements on separate lines, you can alphabetize Dim statements after you have separated them, and you can combine adjacent Dim statements (same kind or different kinds). (If they are not already adjacent, RB CodeHelper can arrange for that as well.)

I'm still looking for some people willing to beta-test RB CodeHelper Lite, which I expect to be releasing shortly (if I can get some beta-testers) as freeware or perhaps "donationware," with source code included. (If you are willing to try it out and provide me with some feedback, no further donation is needed: you've already donated your time!) I'm also looking for people to test the fuller RB CodeHelper, which will probably be released as shareware. (Beta-tester who provide me with helpful feedback will be entitled, of course, to a free copy.)

If you are interested, please send me a private email My address is rb at ix dot netcom dot com (with the appropriate symbols substituted for the "at" and the "dot").

Barry Traver



Blog Home Page: http://traverrb.blogspot.com/

Programs and Files Discussed in the Blog: http://traver.org/traverrb/

Monday, January 09, 2006

Still More on What RB CodeHelper Lite Can Do

Today we look at some other things that RB CodeHelper Lite can do.

In an earlier entry, I explained how "Comment OLut Source and Add MsgBox" could be helpful if you wanted to create a Project that was a subset of an existing Project. "Comment Out Entire Source" can be useful if you need to build a new Project "from scratch," but want the code from an earlier Project to be easily accessible in case some of it can be reused. (You can restore it with "Uncomment Entire Source.") Important: when "Comment Out Entire Source is used, the original indenting is preserved (or, more accurately, is re-created).

"Comment Out MsgBox Statements" can be useful if you make frequent use of MsgBoxes when debugging and then want the Program to run without being interrupted by the MsgBoxes. (You can bring them back with "Uncomment MsgBox Statements.") If you use different types of comment symbols for different purposes, you can "Remove Comment Symbols" of different types separately.

Both "Add Procedure Headers" and "Add Procedure Footers" know the Method in which they are being placed. Thus the procedure header can provide the name and location of the method, and youcan add other information (*e.g., programmer's name, purpose of Method, date of Method, etc.) later, and the procedure footer can include an exception handler that can indicate the Method in which the exception occurred. "Remove Procedure Headers" and "Remove Procedure Footers" remove these haders and footers.

Some people like to have no unnecessary spaces between characters ("Remove Unnecessary Spaces" does this); while others (I'm one of them) like to have spaces for readability, such as spaces around symbols for math operators such as "+," "-," "*." "/,." "^," "=," "<>," "<=," or ">=" ("Put Spaces Around Symbols for Math Operators"), spaces after commas ("Put Spaces After Commas"); spaces around, inside, or outside Parentheses ("Put Spaces Around Parentheses Symbolls," "Put Spaces Only Inside Parentheses Symbols"); "Spaces Only Outside Parentheses"); or all or the preceding ("Add Extra Spaces of All Types").

Those who want to save paper when printing out source code will appreciate "Remove Blank Lines"; those who want more "white space" for readability (or room to write and annotate) will appreciate "Double- (or Triple- or Quadruple-)Space the code or perhaps "Separate Logical Units," which puts a blank line before an "If" line and after an "End If" line, before a "For" line and after a "Next" line, etc.

Since I prefer order to disorder, I like to see standardization of use of upper/lower case. REALbasic doesn't care, but I care. Ir you care, RB CodeHelper Light can ensure that you have standardization in case, using "Reform Constants," "Remove Contorls," Reform "Line Labels," "Reform Methods," "Reform Modules," "Reform Properties,," "Conform REALbasic Keywords," and "Conform Variables." For example, the pattern that RB CodeHelper Lite uses is that which is used in the Dim staatements for that variable.

You can also have RB CodeHelper Lite list all the names used in a Project ("Display All Words Used in Source", "Display Constants Used in Project", "Display Controls Used in Project," "Display Event Handlers Used in Project," "Display Functions Used in Project," "Display Line Labels Used in Project", "Display Menu Items Used In Project," "Display Methods Used in Project," "Display Modules Used in Project," "Display Properties Used in Project," "Display REALbasic Keywords Used in Project," "Display Subs Used in Project," "Display Variable Names Used in Project," "Display Variables by Location," and "Display Variables by Name" provide such lists).

I'll see if I can finish up the list of RB CodeHelper Lite's features in a future blog entry., but at least now you have hopefully a better understanding of some of the things the program can do. (If you are willing to be a beta-tester and supply me with feedback, please let me know. Thanks!)

Barry Traver



Blog Home Page: http://traverrb.blogspot.com/

Programs and Files Discussed in the Blog: http://traver.org/traverrb/

Sunday, January 08, 2006

More Info on "Alpha" Lists for RB 2005 LR

Now two versions of index.html. are available!

One is a short version (with 700+ lines and links); the other is a long version (with 3000+ lines and links). Take your choice. The short version is very similar to the "Alpha" list in REALbasic 5.5.x; the long version is a complete list, with links to all of the 3000+ files in the Topics folder.

I think the addition of the "alphabet bar" to the long version makes it much less "overwhelming." Click on a letter, and jump immediately to the appropriate section. Click on the red letter at the start of any section, and jump immediately back to the top. That cuts down tremendously on the scrolling involved.

Thus you have all the advantages of a complete list, but minimal disadvantages. (Plus you have links to REAL Software, the RB Forums, RBGarage, RBSource, and my RB blog!) And you still have the simplicity of a single Web page (rather than needing twenty-six or twenty-seven, with a separate letter on each).

To install involves two simple steps:

(1) Change name of "index.html" in the "Language Reference" folder to "index2.html."
(2) Put my "index.html" file in that same directory.

That's all there is to it. As long as you do step (1) before step (2), you should be fine!

If you're running Windows, you'll probably find the Language Reference folder here:

C:\Program Files\REAL Software\REALbasic 2005r4\Resources\Language Reference

If you're running a Mac, you may find the following comments from a Mac user helpful:

"It took me quite a time to find out where the Language Reference folder is - Spotlight searches for "Language reference" and"Index.html" did not help - but I found it eventually....
I have a Mac G5 running OSX 10.4.3. The LR is a part of the RB app. package. To get at it, one has to right click (or control-click) the RB app. itself, choose "Show Package Contents " then navigate to the "Resources" folder. There is no other method, as far as I am aware. As already mentioned, none of my search utilities was able to locate the file. Spotlight is the highly acclaimed search tool built into Mac OS X Tiger."

Once the new file is installed, you can still use the original home page for LR, but it will take two clicks to get there (Home button and "Language Reference Original Starting Point" link).

To uninstall, follow these two steps (in that order):

(1) Delete my index.html file from the "Language Reference" folder.
(2) Change the name of "index2.html" in that same folder to "index.html."

Incidentally, I did not assemble this file by hand. I wrote a program (in REALbasic, of course) to read through all the HTML files in the Topics folder, to extract the necessary information, to sort the entries, and to put together the new index.html file.

If I find time, I may improve the file so that it makes use of a Table (or the CSS equivalent of a Table) in order to have multiple columns. For now, however, you'll have to be content with a single-column "Alpha" index (which is essentially how it was done in RB 5.5.x).

Enjoy!

Warm regards,

Barry

P.S. Someone complained that my index.html file is "very complete" to the extent that it is "overwhelming," and he is probably right. It is "very complete," because I let the computer make the list for me. Feel free to "trim it down" or customize it as you desire (I may come out with a shorter version myself). The hard work has been done. It's easier to have too many links and have to decide what ones to cut than it is to have too few links and have to find out what "missing links" to add. So, yes, be forewarned: the file is (needlessly?) long and can be much improved, either by omitting needless links (e.g., subitems under a class) or by putting the links into a multi-column table.

Incidentally, this particular index.html file works only with RB 2005. It will not work correctly, I'm told, with the Language Reference files for RB 2006.

Barry Traver



Blog Home Page: http://traverrb.blogspot.com/

Programs and Files Discussed in the Blog: http://traver.org/traverrb/

Saturday, January 07, 2006

Now Available: "Alpha" Index for RB 2005 LR

Attention: RB 2005 Users!

Do you miss the alphabetical ("Alpha") index that you had available to you in REALbasic 5.5.x for the Language Reference? Do you dislike having to select (guess?) a Category and after that to select (guess again?) a Topic in order to find the information that you want to find? Then I have good news for you!

I've prepared a 3000-line HTML file that will make an extensive alphabetical index available to you once more from within the RB IDE. If interested, act now. This offer is not available in stores.

The file has an A - Z alphabet at the top. Click on a letter, and jump immediately to that section. Click on any red letter at the top of a section, and jump immediately back to the top. That is a real time-saver. (Otherwise you would be doing a lot of scrolling!)

You can still get to the original home page for LR, but it will take two clicks to get there (Home button and "Language Reference Original Starting Point").

Here's all you have to do to install the "Alpha" index:

1. Change the name of the "index.html" file in the "Language Reference" folder to "index2.html."
2. Put my "index.html" file in that same folder.

That's all there is to it.

There is very little danger of your breaking anything (unless you do step 2 before step 1 ). If you don't like the my "Alpha" index, then you can easily restore the earlier setup by doing these two steps (in order):

1. Delete my "index.html" from the "Language Reference" folder.

2. Change the name of the "index2.html" file in that same folder back to "index.html."

What's the cost? Nothing. It's freeware (or, to be more accurate, adware, because the "Alpha" index page contains a link to my RB blog at http://traverrb.blogspot.com, but you can always edit the file to remove that link if it bothers you).

Incidentally, I did not assemble this file by hand. I wrote a program (in REALbasic, of course) to read through all the HTML files in the Topics folder, to extract all the necessary information, to sort the entries, and to put together the new index.html file.

If I find time, I may improve the file so that it makes use of a Table (or the CSS equivalent of a Table) in order to have multiple columns. For now, however, you'll have to be content with a single-column "Alpha" index (which is essentially how it was done in RB 5.5.x).

Warm regards,

Barry Traver

P.S. Someone complained that my index.html file is "very complete" to the extent that it is "overwhelming," and he is probably right. It is "very complete," because I let the computer make the list for me. Feel free to "trim it down" or customize it as you desire (I may come out with a shorter version myself). The hard work has been done. It's easier to have too many links and have to decide what ones to cut than it is to have too few links and have to find out what "missing links" to add. So, yes, be forewarned: the file is (needlessly?) long and can be much improved, either by omitting needless links (e.g., subitems under a class) or by putting the links into a multi-column table.

Note well: this file is for RB 2005 users only. This particular index.html file works only with RB 2005. It will not work correctly, I'm told, with RB 2006.

To get this particular file, send your request as a private email to the following address: rb@ix.netcom.com.

Barry Traver



Blog Home Page: http://traverrb.blogspot.com/

Programs and Files Discussed in the Blog: http://traver.org/traverrb/

Friday, January 06, 2006

More Info on What CodeHelper Lite Can Do

Last time I provided a list of the seventy-seven tasks that CodeHelper Lite can perform. In this entry, I will provide more of an explanation concerning some whose usefulness may perhaps be less obvious.

Sometimes it is difficult to follow the logic or keep track of what's going on in long nested For/Next loops or complicated and lengthy If/End If statements. By the time you get to the "Next" line, you may hve forgotten what the matching "For" line said. Or, if you have nested If/End If statments in your code, when you get to an "Else" line or an "End If" line you may have forgotten what the original "If" statement said and/or whether that condition still applies to the section of code you are working on.

To help you keep track of where you are, CodeHelper can "Add Automatic Comments" to lines that begin with "Next" or "Else" or "End If." Here are an example taken from CodeHelper:
 For XMLLineNumber = 0 To UpperBoundXML
... [more code here] ...
If IsSource(XMLLine) Then
... [more code here] ...
If RightTemp = "_" Then
... [more code here] ...
ElseIf Temp <> "End Sub" _
And Temp <> "End Function" Then
... [more code here] ...
For Counter = 1 To NumberOfBlankLines
... [more code here] ...
Next Counter '/ For Counter = 1 To NumberOfBlankLines
... [more code here] ...
Else '/ (Caution: at least one ElseIf in this statement)
... [more code here] ...
End If '/ (Caution: at least one ElseIf in this statement)
End If '/ If IsSource(XMLLine)
Next XMLLineNumber '/ For XMLLineNumber = 0 To UpperBoundXML
Note the automatic additions to the "Next," "Else," and "End If" lines. Here's another example:
  If Temp1 = "As" Then
... [more code here] ...
If Regexmatch1 = Nil Then Exit
... [more code here] ...
If Temp1 = "New" Then
... [more code here] ...
If Regexmatch1 = Nil Then Exit
... [more code here] ...
Else '/ If NOT (Temp1 = "New")
... [more code here] ...
End If '/ If NOT (Temp1 = "New")
End If '/ If Temp1 = "As"
"Comment Out Source And Add MsgBox" was used in the making of CodeHelper Lite from CodeHelper. Running this routine comments out the entire source code but puts MsgBoxes in Methods so that the MsgBox indicates the Method it is in.

I then chose which features in CodeHelper I wanted to include in CodeHelper Lite, and uncommented those Methods (and removed the related MsgBoxes). Then I ran the program, and the MsgBoxes which appeared showed me which additional Methods needed to be uncommented (and MsgBoxes removed).

Finally, after I was fairly sure that all of the routines I wanted were working, I removed those unnecessary Methods that were still commented out (and thus had not been called). (If I made a mistake and deleted something that was really needed, RB's syntax chedcking would let me know of that fact, so that I could put it back.) As I went along, I removed from the menus those features I had decideed not to include in CodeHelper Lite, so the end result was a program that was a working subset of the fuller CodeHelper program.

We'll come back to CodeHelper and CodeHelper Lite later, but I'll be switching to a different topic temporarily in the next blog entry. And more files will be available soon. Hang in here!

Barry Traver



Blog Home Page: http://traverrb.blogspot.com/

Programs and Files Discussed in the Blog: http://traver.org/traverrb/

Wednesday, January 04, 2006

RB CodeHelper and RB CodeHelper Lite

I'm still looking for volunteers who would be willing to give me some feedback on a program I've been working on called CodeHelper. The program is still in the "development" stage, so you shouldn'texpect to see the final product yet. ("Development"-testing comes before "alpha"-testing, and that comes before "beta"-testing, so there's a way to go yet.) If you're interested, let me hear from you.

What is RB CodeHelper? Well CodeHelper is a REALbasic programming utility to help programmers with their code. Some of the routines are merely cosmetic (e.g., changing the line spacing or character spacing to make the code more readable), but some do serve more directly useful purposes (e.g., checking to see whether your projects include any properties or variables that you have defined but never actually used, or changing the name of a control, method, property, variable, etc. throughout an entire project).

Ready for "development"-testing is CodeHelper Lite, which includes the ability to perform the following seventy-seven tasks (the full CodeHelper will be able to perform perhaps twice as many):

ADD AUTOMATIC COMMENTS
Add Automatic Next Comments
Add Automatic Else Comments
Add Automatic End If Comments
ADD COMMENT SYMBOLS
Comment Out MsgBox Statements
Comment Out Entire Source
Comment Out Source And Add MsgBox
ADD HEADERS OR FOOTERS
Add Procedure Headers
Add Procedure Footers
CHANGE CHARACTER SPACING
Remove Unnecessary Spaces
Add Extra Spaces Of All Types
Put Spaces After Commas
Put Spaces Around Parentheses Symbols
Put Spaces Only Inside Parentheses Symbols
Put Spaces Only Outside Parentheses Symbols
Put Spaces Around Symbols For Math Operators
CHANGE LINE SPACING
Remove Blank Lines
Separate Logical Units
Double-Space Source Code
Triple-Space Source Code
Quadruple-Space Source Code
CONFORM IN CASE
Conform All (may take a while)
Conform Constants
Conform Controls
Conform Line Labels
Conform Methods
Conform Modules
Conform Properties
Conform REALbasic Keywords
Conform Variables
DISPLAY LIST OF NAMES
Display All Words Used in Source
Display Constants Used in Project
Display Controls Used in Project
Display Event Handlers Used in Project
Display Functions Used in Project
Display Line Labels Used in Project
Display Menu Items Used In Project
Display Methods Used in Project
Display Modules Used in Project
Display Properties Used in Project
Display REALbasic Keywords Used in Project
Display Subs Used in Project
Display Variable Names Used in Project
Display Variables by Location
Display Variables by Name
DISPLAY SOURCE CODE
Display Source Code For A Particular Method
Display Source Code For Entire Project
INCREASE OR DECREASE INDENTATION
Increased Indent of 1
Increased Indent of 2
Increased Indent of 3
Remove Increased Indentation
LOCATE UNNECESSARY DEFINITIONS
Check Variables And Properties For Duplicates
Display Unused Properties
Display Unused Variables
OBFUSCATE BY SWITCHING NAMES
Obfuscate Controls by Switching Names
PERFORM MISCELLANEOUS TASKS
Change a Particular Name
Check Nested For/Next Loops For Duplicate Counters
Combine Partial Source Lines
Remove Highlighting
REMOVE AUTOMATIC COMMENTS
Remove Automatic Next Comments
Remove Automatic Else Comments
Remove Automatic End If Comments
REMOVE OTHER COMMENTS
Remove All Comments
Remove // Comments
Remove ' Comments
Remove Rem Comments
REMOVE COMMENT SYMBOLS
Remove // Comment Symbols
Remove ' Comment Symbols
Remove Rem Comment Symbols
Uncomment MsgBox Statements
Uncomment Entire Source
REMOVE HEADERS OR FOOTERS
Remove Procedure Headers
Remove Procedure Footers
UNOBFUSCATE BY SWITCHING NAMES
Unobfuscate Controls by Switching Names
WORK WITH DIM STATEMENTS
Put Individual Dim Statements on Separate Lines
Alphabetize Separated Dim Statements
Combine Adjacent Dim Statements (same kind)
Combine Adjacent Dim Statements (different kinds)

The only feature in the preceding list that I've discussed here so far in this blog is how to "remove blank lines" from the source code. See the discussion of TraverToy1 at the following URL:

http://snurl.com/lajw

In the next entry, I'll explain more about what the program does (some of the features are obvious in purpose, but some are not).

In the meantime, if you're willing to help out by trying things out and supplying some feedback, please send a private email to the following email address:

rb@ix.netcom.com.

Thanks!



Blog Home Page: http://traverrb.blogspot.com

Page for Programs and Files: http://traver.org/traverrb/


Barry Traver



Blog Home Page: http://traverrb.blogspot.com/

Programs and Files Discussed in the Blog: http://traver.org/traverrb/