Hot Topic (More than 10 Replies) Memory Menu for the Retrieve Spec? (Read 1936 times)
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Memory Menu for the Retrieve Spec?
Dec 16th, 2008 at 7:59pm
Print Post Print Post  
Does anything similar to the Memory Menu exist for use in the Retrieve Spec?
  

**
Captain Infinity
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Memory Menu for the Retrieve Spec?
Reply #1 - Dec 16th, 2008 at 8:08pm
Print Post Print Post  
Can you be more specific?
  

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


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Memory Menu for the Retrieve Spec?
Reply #2 - Dec 17th, 2008 at 6:32pm
Print Post Print Post  
My dispatcher tells me he finds himself entering the same retrieve values several times a day (though the exact values change every day).  For instance, he'll look up a customer a couple of times a day.  He's asked me if the program can offer him a picklist of the last 10 or so values he's used in a spec.  I know the memory menu does this during add or update, but I'm not sure if such a thing can be done for the retrieve spec.  It's not like I can create a saved spec, because the lookup values would be dynamic, and could be in a number of fields.  Am I making sense?
  

**
Captain Infinity
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Memory Menu for the Retrieve Spec?
Reply #3 - Dec 17th, 2008 at 8:30pm
Print Post Print Post  
Pressing Alt-Enter will give you the last 10 things typed in a text element, even in search mode. But it will also give you the partial values as well and may not be useful for what you are looking for.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Memory Menu for the Retrieve Spec?
Reply #4 - Dec 17th, 2008 at 8:57pm
Print Post Print Post  
Thank you for that hint, that's useful.  But it ignores wild card search specs, such as "..johnson..".
  

**
Captain Infinity
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Memory Menu for the Retrieve Spec?
Reply #5 - Dec 17th, 2008 at 9:20pm
Print Post Print Post  
OK, how about this? The example retains the search values used in the field called First. My example uses SetAutocomplete, but you can use a popupmenu or the memory menu or whatever method you want. If you want, you can even send the list to a GlobalValue so it sticks between runs.

GLOBAL CODE
-----------------
Code
Select All
#include "sbasic_include.sbas"

stat sSearchVals as String

	sSearchVals = ""
 



Form:: On Form Entry
Code
Select All
var vVal as String

	If @Mode() = FORM_MODE_UPDATE
	{
		// Get the search criteria
		vVal = @Attribute(First, ATTR_ID_TEMPORARY_VALUE)
		If vVal <> ""
		{
			If @FindStringArray(sSearchVals, vVal) = -1
			{
				sSearchVals = @AppendStringArray(sSearchVals, vVal)
				sSearchVals = @SortStringArray(sSearchVals, 0)
			}
		}
	}
 



Form: On Retrieve Spec Open
Code
Select All
	SetAutocomplete(First, sSearchVals)

 

  

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


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Memory Menu for the Retrieve Spec?
Reply #6 - Dec 18th, 2008 at 12:27pm
Print Post Print Post  
Thanks Erika, I'll experiment with that.  I have autocomplete turned off for my application, so I'll try one of the other methods, probably a popup menu.  I think I might make an element to specifically hold these values, offer them to the user when he selects the arrow, and then populates the field when he chooses one (he's told me he would like it specifically for the Company name field in the Customer database.)  Any advice that might help guide my progess before I begin designing?  Thanks again for your help.
  

**
Captain Infinity
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Memory Menu for the Retrieve Spec?
Reply #7 - Dec 18th, 2008 at 12:48pm
Print Post Print Post  
Actually, it looks like a PopupMenu would be better suited, on a command button
  

**
Captain Infinity
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Memory Menu for the Retrieve Spec?
Reply #8 - Dec 18th, 2008 at 1:25pm
Print Post Print Post  
Your code and a @PopupMenu command button is working perfectly.  Thanks so much Erika!
  

**
Captain Infinity
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Memory Menu for the Retrieve Spec?
Reply #9 - Dec 18th, 2008 at 1:32pm
Print Post Print Post  
Infinity wrote on Dec 18th, 2008 at 1:25pm:
Your code and a @PopupMenu command button is working perfectly.  Thanks so much Erika!


You're welcome.  Smiley
  

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


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Memory Menu for the Retrieve Spec?
Reply #10 - Dec 18th, 2008 at 3:48pm
Print Post Print Post  
My dispatcher loves this and now, of course, he's asking for more and better.  Please guide me a little bit on how I can make the list of values static between openings and closings of the retrieve spec. GlobalValue, is it?  I'm not very practiced with GlobalValues.

Would the list retain values used by every user?  Would it keep growing and growing?  If so it could get out of hand.  I'd probably need a way to clear it once a day, maybe.  Maybe I could create separate static variables for each user to have a list.  And a button so they can clear it if it gets too unweildly.    Just brainstorming here.
  

**
Captain Infinity
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Memory Menu for the Retrieve Spec?
Reply #11 - Dec 18th, 2008 at 5:16pm
Print Post Print Post  
Infinity wrote on Dec 18th, 2008 at 3:48pm:
My dispatcher loves this and now, of course, he's asking for more and better.  Please guide me a little bit on how I can make the list of values static between openings and closings of the retrieve spec. GlobalValue, is it?  I'm not very practiced with GlobalValues.


To put the list in a GlobalValue called CompanySearchList:
GlobalValue("CompanySearchList", sSearchVals)

To get it out so you can offer it to the user:
sSearchVals = @GlobalValue("CompanySearchList")

Quote:
Would the list retain values used by every user?  Would it keep growing and growing?  If so it could get out of hand.  I'd probably need a way to clear it once a day, maybe.  Maybe I could create separate static variables for each user to have a list.  And a button so they can clear it if it gets too unweildly.    Just brainstorming here.

Yes, it is available to all users. Yes, you can use separate GlobalValues for each user (TomSearchList, JaneSearchList). Yes, it will keep growing. If you want to limit it, use @CountStringArray to check if it is getting too large and decide how you want to remove/replace values if it is.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged