Normal Topic @XLookupSourceListAll not working for me (Read 751 times)
Rod Weston
Member
*
Offline



Posts: 25
Joined: Aug 22nd, 2016
@XLookupSourceListAll not working for me
Sep 20th, 2016 at 4:02pm
Print Post Print Post  
When I do this, it successfully returns all the records in formula.db...
Code
Select All
vFileName = "Z:\Sesame\Data\ICD\Formula.db"
vkey = @XResultSetSearch(vFileName, "Databaseula", SEARCH_MODE_AND, SEARCH_SYNTAX_QA, "!Formula0=..") 



But this code returns no results...
Code
Select All
vFormula = Formula
vFileName = "Z:\Sesame\Data\ICD\Formula.db"
vFormulaList = @XLookupSourceListAll(vFileName, "vFormula", vFormula, "Formula0,Description") 



I have tried replacing variables with hard-coded values to no avail. What am I missing?
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: @XLookupSourceListAll not working for me
Reply #1 - Sep 20th, 2016 at 4:30pm
Print Post Print Post  
This:
"Formula0,Description"

Should be this:
"Formula0;Description"

Note the semicolon separator.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: @XLookupSourceListAll not working for me
Reply #2 - Sep 20th, 2016 at 4:45pm
Print Post Print Post  
In addition to what Erika said;

Your second argument is your key value used for matching unless you are searching for the literal value of "vFormula", you do not want quotes around it.

The third argument is the external element name. This either needs to be in quotes or have a variable that evaluates to the element name. Looking at your previous code, you want "Formula0" in this spot.

Code
Select All
vFormula = Formula
vFileName = "Z:\Sesame\Data\ICD\Formula.db"
vFormulaList = @XLookupSourceListAll(vFileName, vFormula, "Formula0", "Formula0;Description") 



Also one thing to note is the XLookup family of commands are Form based commands so they use the ELEMENT names where as the XResultSet family of commands are Database based commands so they use the underlying FIELD names. So if the above does not work, make sure you are using the ELEMENT names and not the FIELD names.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Rod Weston
Member
*
Offline



Posts: 25
Joined: Aug 22nd, 2016
Re: @XLookupSourceListAll not working for me
Reply #3 - Sep 20th, 2016 at 4:50pm
Print Post Print Post  
Thank you. I actually had one other problem with my code - it now reads as
Code
Select All
vFormulaList = @XLookupSourceListAll(vFileName, vFormula, "Formula0", "Formula0;Description") 



but it works now. I so much did not want it to be some silly simple problem like commas instead of semi-colons, but there you go.
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: @XLookupSourceListAll not working for me
Reply #4 - Sep 20th, 2016 at 4:54pm
Print Post Print Post  
Rod Weston wrote on Sep 20th, 2016 at 4:50pm:
I so much did not want it to be some silly simple problem like commas instead of semi-colons, but there you go.


Oh, you so do want those problems. As a coder, I pray for my bugs to be stupid syntax issues that can be easily fixed.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Rod Weston
Member
*
Offline



Posts: 25
Joined: Aug 22nd, 2016
Re: @XLookupSourceListAll not working for me
Reply #5 - Sep 20th, 2016 at 5:17pm
Print Post Print Post  
Good point. Thanks.
  
Back to top
 
IP Logged