Hot Topic (More than 10 Replies) XUSERSELECTR (Read 2233 times)
Peter
Member
*
Offline


No personal text

Posts: 22
Joined: Jan 7th, 2004
XUSERSELECTR
Jan 7th, 2004 at 11:49am
Print Post Print Post  
Hi

Still playing with the trial version as I await delivery in the UK...

I like to use the XUSR function to form a pick list from a partially completed field (perhaps I should now say element). If typing the name of someone already in the database I could, with Q&A,  type the 1st three letters and hit a carriage return to produce a list of all those beginning with those letters. I can't seem to get this to work with Sesame. If I set the start and end fields with letters in inverted commas, no problem. If I then reprogramme and use the same (partially completed) element as my start and end I get no values at all unless I leave the element blank. If I set start as my partially completed element and the end as "Z" I get a list from my partially completed element onwards.

Any help would be appreciated.

Peter
  
Back to top
 
IP Logged
 
Alec
Lanticans
*****
Offline



Posts: 200
Location: Ascot, England, UK
Joined: Nov 22nd, 2002
Re: XUSERSELECTR
Reply #1 - Jan 9th, 2004 at 7:49pm
Print Post Print Post  
Quote:
... I could, with Q&A,  type the 1st three letters and hit a carriage return to produce a list of all those beginning with those letters. I can't seem to get this to work with Sesame. ... If I use the same (partially completed) element as my start and end I get no values at all

Hello Peter -
Yes, I get exactly what you describe.  Where QA5 allows you to to use the same field reference for both start and end parameters in XUserSelectR, Sesame does not currently accept that. The two parameters must be different, to define a range. Q&A more readily accepts an implicit range.

This works:
 XUserselectR ("DATA\Keyword.dtf", "Surname", "Key", field1, "Z", field3)

but this doesn't:
 XUserselectR ("DATA\Keyword.dtf", "Surname", "Key", field1, field1, field3)

This is logged as a bug and we'll look into it.
Good catch!

  

Alec
Back to top
IP Logged
 
Peter
Member
*
Offline


No personal text

Posts: 22
Joined: Jan 7th, 2004
Re: XUSERSELECTR
Reply #2 - Jan 9th, 2004 at 8:29pm
Print Post Print Post  
Thanks for that Alec. I'm glad I'm not going mad!!

Best wishes

Peter
  
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: XUSERSELECTR
Reply #3 - Jan 9th, 2004 at 10:26pm
Print Post Print Post  
Quote:
If typing the name of someone already in the database I could, with Q&A,  type the 1st three letters and hit a carriage return to produce a list of all those beginning with those letters.


I did not use Q&A 5 (used QA4), so I am not familiar with XuserselectR commands or functions, but from whatever you have described, it seems to be very useful for data entry.  Is there anyway it can display more than one columns of data with Sesame using XUSR command or function but it selects the data from one specified column only, in the data field you are working on?

Thanks to all of you for sharing your expertise with this novice.

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



Posts: 2530
Joined: Nov 22nd, 2002
Re: XUSERSELECTR
Reply #4 - Jan 10th, 2004 at 3:27pm
Print Post Print Post  
This is one of those areas where the developers had to make a decision - be backwards compatible or forward thinking. Frankly, it had to be one or the other. Sesame uses the same rules and query mechanism as regular form based queries when performing the "X" commands (XLookup, XPost, XUserSelect, etc...).

While that does make Sesame's "X" commands very mildly incompatible with the same commands in Q&A, it does provide a great deal of flexibility and expansion. This is also the reason why, in ranged operations, specifying the same string for the upper and lower boundaries of the range can only find an exect match. In Sesame, setting both the lower and upper range as "R", tells the query engine to find all the records where the field is greater than or equal to "R" AND where the field is lesser than or equal to "R". The only value that can match that exact condition is one equal to just "R".

The advantage of this is that it allows a "true" range operation. In Sesame, if you set the lower boundary to "R" and the upper to "Rob", you will get all the records that start with "R" but not those alphabetically beyond "Rob", such as "Robert" or "Run". In Q&A , it is impossible to limit the selection in this way. For example, in Q&A the range "RAAA" to "RC" will match (incorrectly) "RCDDD".

Sesame also provides the ability to use the entire query syntax in any of the "X" subroutines and functions in any of the key or range fields, because it doesn't attach an "implied" wildcard onto either. That make its very easy to test a range operation usng the form itself:

>=lower & <=upper


If you want to get all the records that start with "R" - set the lower boundary to "R" and the upper to "Rzzzzzzzz".
  

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


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: XUSERSELECTR
Reply #5 - Jan 22nd, 2004 at 11:52pm
Print Post Print Post  
Quote:
If you want to get all the records that start with "R" - set the lower boundary to "R" and the upper to "Rzzzzzzzz".


Mark: Taking the hint from you, I tried to emulate the list display using xuserselectr command. It works fine except one little glitch. "Space" Problem !!!

xUserSelectr commands and functions seems very useful for entering data. It helps to limit the choice when list is very long. So, I decided to work on it taking your hint. The following is the programming I am using...

vStart, vFieldName and vEnd all are string variable.

If @in (vFieldName, "..")  > 0 then
      {    
                  vStart = @left (vFieldName, @in (vFieldName, "..") - 1)
              vEnd = @left (vFieldName,   @in (vFieldName, "..") - 1) + "zzzzzzz"
        }

Keeping with Sesame and QA tradition, whenever one enters say "blu..", It will make upper and lower limit to be  bluzzzzzzz and blu respectively and display all the values starting with "blu".  That is all fine.

The problem is the space... 

If I place Blue.. in the field, it would not enlist Blue Cross.  Does the space has more value than "z"? How to overcome this problem?

Where would we go without your help and input?

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



Posts: 2530
Joined: Nov 22nd, 2002
Re: XUSERSELECTR
Reply #6 - Jan 23rd, 2004 at 9:08pm
Print Post Print Post  
This is fixed in release 1.0.1 - the upcoming release. In meantime, if you alter your code to read:

If @in (vFieldName, "..")  > 0 then
{      
    vStart = @left (vFieldName, @in (vFieldName, "..") - 1) + @chr(1)
    vEnd = @left (vFieldName,   @in (vFieldName, "..") - 1) + "zzzzzzz"
}

It should start to work. Let me know.
  

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


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: XUSERSELECTR
Reply #7 - Jan 23rd, 2004 at 9:56pm
Print Post Print Post  
Thank you Mark,   It works perfectly well now.
  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: XUSERSELECTR
Reply #8 - Jan 28th, 2004 at 7:45pm
Print Post Print Post  
To Bharat and all interested parties, this problem has been fixed in 1.0.1, which is now available for download by licensed customers.
  

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


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: XUSERSELECTR
Reply #9 - Jan 28th, 2004 at 8:50pm
Print Post Print Post  
Thank you Mark. I already downloaded the new version and everything is working fine.  I believe, we will have to wait until next version to delete @chr (1) from the Code !!! Not a big deal.  Thanks again.
  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: XUSERSELECTR
Reply #10 - Jan 28th, 2004 at 9:08pm
Print Post Print Post  
Bharat, I think you should have the fix for the problem in 1.0.1 - try removing the "@chr(1)". I believe it is no longer necessary. Just using:

v_start = LE_name
v_end = v_start + "zzzzzzzzz"

is working well for me here - using 1.0.1.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged