Add a text search to Dictionary stack (was "How to find the 'blessed folder'")

James Droscha jdroscha at worldnet.att.net
Sun Feb 10 19:16:01 EST 2002


on 2/9/02 8:13 PM, use-revolution-request at lists.runrev.com at
use-revolution-request at lists.runrev.com wrote:

> Message: 5
> Date: Sun, 10 Feb 2002 00:11:10 +0000
> Subject: Re: How to find the "blessed folder"
> From: Ian Summerfield <iansummerfield at btconnect.com>
> 
> Thank you,  if the Revolution guys are reading this, I think the Transcript
> dictionaries "Find" command at the top of the window needs major
> improvements!  I entered "System Folder" and pressed return and it just
> beeped,  even though it's on that card!  Am I not using it correctly?  I
> just tried command-F to do the find too,  that didn't find it either.  How
> should I be looking this stuff up?

   In addition to the faboo tips Jeanne sent regarding getting at the
scripts in the well-armored (for good reason) Dictionary stack
(revlanguage.rev), I thought I'd share the first thing I did in Revolution,
which I have found a bit handier than using the built-in Edit > Find and
Replace menu item.  I added a rudimentary text search feature which behaves
very much like the Find feature in the Dictionary stack.  Here's how:

   First, I should mention that I did this using Rev 1.1 "Classic" under Mac
OS 9.0.4, just in case it doesn't work for you, there might be some subtle
difference under different environments.

1) Open Runtime Revolution
2) If it is not already open, open the "Application Overview" under the View
menu
3) Under the Help menu, choose "Transcript Dictionary"; this will open the
revlanguage stack (which I found in ".\Revolution 1.1
Classic\components\help\"... actually, I made a duplicate of the file and
archived it, just to be safe)
4) You should see "revlanguage.rev" appear at the bottom of the Application
Overview window with a little expander triangle next to it
5) Using the expander triangles, navigate down to "revlanguage.rev >
revDocsLauguageReference > Groups > Find"  (TIP: if you are short on RAM or
processor speed, avoid opening the group called "Cards" since there is a
card for each rev language element so doing so can put you in the penalty
box)
6) Double-click on the "Find" group; a dialog should appear that says "Stack
revDocsLanguageReference has its cantModify set to true.  Editing it will
unlock it.  Do you wish to continue?  [No]  [[Yes]]"; click the Yes button
7) You will see sort of a blank looking card that just contains the Find box
and label; select these two objects and Duplicate them (Apple-D)
8) Move your new objects over to the right side of the screen, but keep them
vertically parallel to the original Find box
9) Change the label to "Search" (or whatever you like)
10) Change the name of the field to "Search" (or whatever you like)
11) Open the script on this new Search box; on the third line of the
onReturnInField handler, you should see the line...
     mark cards where return & target is in the synonyms of this card --
find at start of word
change this to...
     mark cards where (field "Summary" contains target) or (field "Comments"
contains target)
12) Close the Properties window and switch to Browse mode (click the little
hand next to the arrow in the toolbox)
13) If your search box and/or label are overlapping other elements in the
stack, go back in through the Application Overview window and make the
needed adjustments
14) If you wish to set the cantModify of the stack back to true, use Apple-K
(although Object > Stack Properties is grayed out, it still works, which I
suppose is a bug, but a happy one)
15) Make sure you save the stack
16) Voila!  Now you can do a text search within the Summary and Comments
areas of the Dictionary stack, which I find useful; it makes a nice
companion to the Find feature that is already present

   I apologize if I misused any terms in the above instructions... I am very
new to Runtime Revolution, but am having a good time learning it.

Hope This Helps Someone,
James Droscha




More information about the Use-livecode mailing list