I am still doing a lot of experiments with Sesame. Having a problem with creating a dynamic @XLU command.
The next line is a good line, correct value is returned to HRLYRATE:
Quote:HRLYRATE = @XLU(@FileName,COMPANY,"frmRates!txtKey","curOnSiteRate")
Trying to duplicate the above command with variables:
Quote://1. Declare variables:
var vgQuote as String
var vgSourceDB as String
var vgKeyElement as String
var vgSourceKeyElement as String
var vgSourceElement as String
var vgLU as String
//2. Set variable values:
vgQuote = @CHR(34)
vgSourceDB = "@FileName"
vgKeyElement = "COMPANY"
vgSourceKeyElement = "frmRates!txtKey"
vgSourceElement = "curOnSiteRate"
//3. Set value of vgLU, and confirm with WriteLn:
vgLU = "@XLU("+vgSourceDb+","+vgKeyElement+","+vgQuote+vgSourceKeyElement+vgQuote+","+v
gQuote+vgSourceElement+vgQuote+")"
WriteLn(vgLU)
//WriteLn value = desired string:
@XLU(@FileName,COMPANY,"frmRates!txtKey","curOnSiteRate")
//4. Get value by making HRLYRATE equal to variable:
HRLYRATE = vgLU
// or
//5. Get value by using variables inside @XLU command:
HRLYRATE=@XLU(vgSourceDb,vgKeyElement,"vgSourceKeyElement","vgSourceElement")
The final line in step 4 should be (and is) the same as the original line that is good. But it does not function as an XLU statement, no value is returned (Type=Money), and no @ERROR message returned.
Conclusion: It looks like I can replace parameters within the XLU statement, but even though I could normally assign a value to an element by using a variable, I cannot use a variable to reproduce a command. So forget about step 4 as a method.
The optional final line in step 5 does function as an XLU statement, but generates @ERROR message. I have also tried using vgSourceDB = @FileName (without the quotes) to get the value vs. using the string @FileName. And I have tried modifying the @XLU command, both using and eliminating the quotes around the first parameter: "vgSourceDb". No success. All four variables do come back with the correct values.
Conclusion: I have been spending too much time on this and can no longer see the obvious! Why can't I make an @XLU work with variables in all parameter fields?
Once again, I am not suggesting that this is a bug. I am just looking to understand what I did wrong, or an explanation of the internal Sesame logic that prevents this process from working. I suspect it has to do with generating the quotes around the external source references.