Thursday, December 22, 2005

Language Reference Utility1 for RB Browser/Editor

Suppose you are in the RB IDE consulting the Language Reference. Suppose further that you're on a particular page and you would like to add your own comment to that page.

Well, with the RB Browser/Editor for Language Reference (see yesterday's post), you can indeed add your own comment to that page. But there's a problem: how do you know which of the thousands of files that make up the HTML version of the Language Reference is the one you want to annotate?

It would be nice if you could know from within the RB IDE which file it is that you are looking at, but the RB IDE does not have an "address bar" you can consult to find out. Is there a solution to this problem? Certainly! Just edit the Language Reference files so that at the top of each file the name of the file is displayed.

"Sure," I hear you saying cynically, "the 'solution' is for me to edit thousands of HTML files. That would take forever!" Nope, it can be done in minutes, and you can let the computer do the work for you. That's why I wrote Language Reference Utility 1 (LR-Util1.rbp is the source code for it).

First, you need to find where on your computer the three folders are that need changing: Language Reference, Categories, and Topics. (Categories and Topics are subfolders under Language Reference.) Here's where the default installation puts the Language Reference folder in Windows:

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

(I'm not sure where the RB installation puts it on the Mac or in Linux.)

Second, you run LR-Util1.rbp and process each of the three folders. To confirm that it has worked, go into the RB IDE and consult the Language Reference, and at the top of each page now should be displayed the HTML filename for that page, making it simple to write down the filename and use it when you run the RB Browser/Editor to annotate that page in the Language Reference.

Incidentally, I like the older Language Reference format better in one way: it was easier for me to choose things from an alphabetical list rather than trying to guess what category something might be placed in. I've been thinking of preparing a new index page set up alphabetically which could be accessed through (or, if desired, even take the place of) the normal starting page (index.html) for the Language Reference.

Has anyone done anything like that yet? Would you have any interest in its being done? (Or am I the only one who prefers to look up something alphabetically?) Or do you have any other suggestions of ways the Language Reference can be modified?

The nice thing is that if you don't like something, you can change it. For example, suppose you want to look up "FileOpenFolderItem." You select "Files" and then "Input/Output," but where is "FileOpenFolderItem"? It should be in that third column, right along with "FileSaveFolderItem," but it isn't. So add it yourself!

If you've run LR-Util1.rbp, you know that the file that needs to be changed is 31.html. You can also easily find that "GetOpenFolderItem" is discussed in 913.html. So you make the following change in 31.html , from this:

<p><a href="../Topics/908.html">GetFolderItem</a></p>
<p><a href="../Topics/920.html">GetSaveFolderItem</a></p>

to this:

<p><a href="../Topics/908.html">GetFolderItem</a></p>
<p><a href="../Topics/913.html">GetOpenFolderItem</a></p>
<p><a href="../Topics/920.html">GetSaveFolderItem</a></p>

inserting the new entry in the appropriate location. Save the result to disk, and you're all set. It's that simple!

Barry Traver



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

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

0 Comments:

Post a Comment

<< Home