Page Index Toggle Pages: [1] 2  Send Topic Send Topic Print Print
Hot Topic (More than 10 Replies) Program Execution in Search Mode (Read 1614 times)
SpencerWulwick
Senior Member
Members
*****
Offline



Posts: 677
Location: Wilton Manors, Florida
Joined: Jan 16th, 2005
Program Execution in Search Mode
Mar 5th, 2005 at 10:36am
Print Post Print Post  
Hi -

I have a field called "Search" which is a keyword field.  I find it a nuicance to have to press F10 to get my results so I entered this programming in the Search LE, on element exit.

Code
Select All
var success as int

success = @SelectTreeItem("Search Menu!Search Commands!Retrieve New Results (F10)") 



When I exit the field, I simply move to the next layout element.  It occurred to me that perhaps programming doesn't work in search mode; however, I know that my command buttons work. 

Any suggestions?
  

- Spencer

    ** Practice random kindness & senseless acts of beauty!
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Program Execution in Search Mode
Reply #1 - Mar 5th, 2005 at 1:36pm
Print Post Print Post  
There are two kinds of events that run on a Retrieve Spec (search mode):
1. The On Retreive Spec Open event
2. The On Element Entry event for a command button

No other programming runs on a retrieve spec. Otherwise, you would have to wrap every line of your existing code in a mode check to prevent it from running.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
SpencerWulwick
Senior Member
Members
*****
Offline



Posts: 677
Location: Wilton Manors, Florida
Joined: Jan 16th, 2005
Re: Program Execution in Search Mode
Reply #2 - Mar 5th, 2005 at 5:47pm
Print Post Print Post  
Erika -

This raises a couple of "points" for me.  Since I use the "Search" element for most searches, I thought I could at least make use of the On Retrieve Spec Open Event by placing the "cursor" in that element.  I was not able to accomplish what I want.  

I tried several programming statement for the On Retrieve Spec Open Event, including:

Code
Select All
goto Search 


and when that didn't work

Code
Select All
ThrowFocus(Search) 


and when that didn't work

Code
Select All
If @mode() = 2 Then goto Search
 


and when that didn't work

Code
Select All
If @mode() = 2 Then ThrowFocus(Search) 


Unfortunately, nothing seemed to work, hence my question.

When, precisely are you in a "Retrieve spec (search mode)?  I presumed that when I pressed F7 and went into search mode that's when I would be in the On Retreive Spec Open event.  I would appreciate help if what I want is "doable."

Since there are at least these two events that can execute programming in Search Mode - and since I think it would be very helpful to execute other programming in search mode - I have a suggestion for a product enhancement and that is to provide for programming in search mode.

Quote:
Otherwise, you would have to wrap every line of your existing code in a mode check to prevent it from running.

In this case, why couldn't the "reverse" occur.  Allow programming in Search Mode but only if it is prefaced with either a special "symbol" or:

Code
Select All
If @mode() = 2 Then ... etc. 


I think this would be a great feature.  Thanks!

« Last Edit: Mar 5th, 2005 at 9:25pm by SpencerWulwick »  

- Spencer

    ** Practice random kindness & senseless acts of beauty!
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Program Execution in Search Mode
Reply #3 - Mar 5th, 2005 at 7:34pm
Print Post Print Post  
Spencer,

You may find one of these useful:

1) Place this code into the On Retreive Spec Open event
Code
Select All
var success as Int
success = @SelectTreeItem("Search Menu!Search Commands!Universal Search") 

This will open the Universal Search dialogue, where you can type the search spec to match any of the TEXT type elements, then press the enter key once to move focus to the "Accept" button, and a second time to start the search.

2) Place @Macro() in the On Retreive Spec Open event calling a macro that either:

    a) presses tab to move focus from the command tree to the form (and possibly more tabs to move to other elements) or...

    b) contains a mouse click to put focus in the element where you want it.

EDIT: See next post below.

« Last Edit: Mar 6th, 2005 at 2:14am by Carl Underwood »  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Program Execution in Search Mode
Reply #4 - Mar 6th, 2005 at 2:15am
Print Post Print Post  
I just discovered a flaw with part of my previous post:

If you go with the @Macro() technique, the "b" (mouse click) version may be the best. Because if you are in update mode and press F7 to get back to the retreive spec, a "tab" macro will advance you to the next element. Plus, if you again press F7 after getting to the retreive spec, the cursor ends up in the record number indicator at the top of the Sesame window.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
SpencerWulwick
Senior Member
Members
*****
Offline



Posts: 677
Location: Wilton Manors, Florida
Joined: Jan 16th, 2005
Re: Program Execution in Search Mode
Reply #5 - Oct 4th, 2005 at 6:50pm
Print Post Print Post  
Carl et. al.

I kinda hate reopening this "old thread" however, I started using Carl's suggestion about having my database open with the universal search "box" open.  (This negates my "old" method of using a keyword search field - and works great).

I have one concern, however, and that is that the cursor does not appear in the search field of the universal search box; I have to click on the field before I can start typing. Any way of having the cursor just BE in the universal search box when the database is opened?

Thanks!
  

- Spencer

    ** Practice random kindness & senseless acts of beauty!
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Program Execution in Search Mode
Reply #6 - Oct 5th, 2005 at 2:55am
Print Post Print Post  
Spencer,

When I use the code from my last post in this thread, the 'Universal Search' box opens, and I start typing - no need to use the mouse to put the cursor there - works great.

I have noticed that the cursor does NOT blink in the Universal Search box, even though I have the "-blink" startup switch in my shortcut. (The cursor does blink correctly in the form.)

Have you tried typing without first clicking in the box with the mouse?

If it still does not work for you, you could probably use a macro to record 1 mouse click in the search box, and place @Macro just after the command that opens the search box.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
SpencerWulwick
Senior Member
Members
*****
Offline



Posts: 677
Location: Wilton Manors, Florida
Joined: Jan 16th, 2005
Re: Program Execution in Search Mode
Reply #7 - Oct 5th, 2005 at 2:58am
Print Post Print Post  
Hi Carl -

I should have been more clear.

It only happens when I OPEN the database.  Once I'm working within the database the cursor is where it belongs.

Sorry I didn't make the point clearer.
  

- Spencer

    ** Practice random kindness & senseless acts of beauty!
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Program Execution in Search Mode
Reply #8 - Oct 5th, 2005 at 3:01am
Print Post Print Post  
I'm not sure I understand. Do you want the Universal Search box to open as soon as you load the application?
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
SpencerWulwick
Senior Member
Members
*****
Offline



Posts: 677
Location: Wilton Manors, Florida
Joined: Jan 16th, 2005
Re: Program Execution in Search Mode
Reply #9 - Oct 5th, 2005 at 3:04am
Print Post Print Post  
Yes!

And, I am doing that.  BUT, if you start typing, it will not go into the box.  You first have to click in the box in order to be able to start typing in it.   Smiley
  

- Spencer

    ** Practice random kindness & senseless acts of beauty!
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Program Execution in Search Mode
Reply #10 - Oct 5th, 2005 at 3:07am
Print Post Print Post  
I would try the macro method I mentioned earlier.

Let me know if you need more details.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
SpencerWulwick
Senior Member
Members
*****
Offline



Posts: 677
Location: Wilton Manors, Florida
Joined: Jan 16th, 2005
Re: Program Execution in Search Mode
Reply #11 - Oct 5th, 2005 at 4:55am
Print Post Print Post  
Well, Carl -

Using a macro sounded easy enough except for one thing.  It won't let me.

While the universal search box is open, I can't select anything else.  There are only 3 places for me to click:

1)  In the criteria portion of the box (where you type your spec) - or

2) On the "Accept" option - or

3) On the "Cancel" option

Waaah!

  

- Spencer

    ** Practice random kindness & senseless acts of beauty!
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Program Execution in Search Mode
Reply #12 - Oct 5th, 2005 at 12:03pm
Print Post Print Post  
Spencer,

Well, I was going to tell you to use Shift-F2 to start and stop recording the macro. But I just tested it, and Sesame will not respond to Shift-F2 while the Universal Search box is open.  ???

I wonder why I can simply type when the Universal Search box opens, but you cannot.

Do you have the @SelectTreeItem("Search Menu!Search Commands!Universal Search") command in the "On Retrieve Spec Open" event?

Do you have any Goto or Throwfocus commands in the same event?
« Last Edit: Oct 5th, 2005 at 8:52pm by Carl Underwood »  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
SpencerWulwick
Senior Member
Members
*****
Offline



Posts: 677
Location: Wilton Manors, Florida
Joined: Jan 16th, 2005
Re: Program Execution in Search Mode
Reply #13 - Oct 5th, 2005 at 3:20pm
Print Post Print Post  
Carl -

I thought perhaps you were on to something because I did find an "old" throwfocus statement that I neglected to remove (cuz I fergot it was there - lol).  But I have now removed it and it made no difference.

Here is the only "on retrieve spec open event" coding I have in the database

Code
Select All
var success as Int
success = @SelectTreeItem("Search Menu!Search Commands!Universal Search")   



To be absolutely certain, I exported the programming and searched for any code "on retrieve spec open event" and with regard to "throwfocus."  There is nothing left that should conflict.

My understanding is that the element I put the code into should have no bearing, but is there a chance that it could?

Once again, please remember that it is ONLY an issue when I first OPEN the database. After that when I switch between modes, the cursor is indeed in the criteria area.
  

- Spencer

    ** Practice random kindness & senseless acts of beauty!
Back to top
IP Logged
 
SpencerWulwick
Senior Member
Members
*****
Offline



Posts: 677
Location: Wilton Manors, Florida
Joined: Jan 16th, 2005
Re: Program Execution in Search Mode
Reply #14 - Oct 5th, 2005 at 4:50pm
Print Post Print Post  
FINALLY!

Thanks to your "suggestions" Carl --- and trying to reason everything out from our dialogue --- I figured out the problem.

What I was missing was proramming in the Application Manager.  When I added this programming to the "on application open" event, it works perfectly - WITH the cursor where it belongs.

Code
Select All
var success as Int
success = @SelectTreeItem("Middle Villagers!Forms!Search/Update!Main!Middle Villagers")  



Now, I is happy and thank you for all your efforts.
  

- Spencer

    ** Practice random kindness & senseless acts of beauty!
Back to top
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send Topic Send Topic Print Print