Page Index Toggle Pages: [1] 2  Send Topic Send Topic Print Print
Hot Topic (More than 10 Replies) quotes in Xlookups (Read 4312 times)
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
quotes in Xlookups
Sep 16th, 2004 at 11:26pm
Print Post Print Post  
Steve_in_Texas commented:
Quote:
I can't figure out when to use quotes, and when not to use quotes in an xlookup statement.
General guideline I have used.....if it's not in the current form, then the string gets quotes.  @FN gets no quotes because it is a function, not a string.

Now that I have noted my "general guideline" I am sure to get flooded with all of the exceptions. Roll Eyes
« Last Edit: Sep 17th, 2004 at 4:26am by Bob_Hansen »  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: quotes in Xlookups
Reply #1 - Sep 17th, 2004 at 12:07am
Print Post Print Post  
The rule is that the argument must resolve to string.

@FN returns a string.

"MyValue" in quotes is a string.

If you have a text element called Company, then you can pass Company without quotes, and Sesame will use the value in the Company element as a string.

If you actually want to pass the string "Company" rather than the element value, put it in quotes.

Etc.
  

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


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: quotes in Xlookups
Reply #2 - Sep 17th, 2004 at 4:25am
Print Post Print Post  
So simple!......

So my thing of @FN does not need quotes, not becauses it is a function, but because the function, that it is, returns a string.    I can buy that....such a deal! Grin
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: quotes in Xlookups
Reply #3 - Sep 17th, 2004 at 4:13pm
Print Post Print Post  
Thanks for the info, but how about in FormFieldValue (which I use a lot).

The second argument requires quotes, but refers to the form and field names, such as:

formfieldvalue("LineItems", "Item sold", 1, part number)

It seems that only the last argument follows the rules you mentioned above.

???

Steve
  
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: quotes in Xlookups
Reply #4 - Sep 17th, 2004 at 4:59pm
Print Post Print Post  
Hi Steve....

From your original comment, bold is mine. Quote:
I can't figure out when to use quotes, and when not to use quotes in an xlookup statement.

Did you forget to put XLU in front of FormFieldValue on your last message? 

Not sure which XLU function that FormFieldValue falls into. Roll Eyes
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: quotes in Xlookups
Reply #5 - Sep 17th, 2004 at 5:16pm
Print Post Print Post  
In SBasic, all of the LEs generate an LE reference. So if you have a form with a LE called "First Name" on it - there will be a LE reference made for SBasic. This lets SBasic use the LEs and the values in the LEs as though they were ordinary variables. In most cases that is how they are used. But there a few operations - such as @RGBColor that want to operate on the LE itself - not on the value in the LE.

There are also some functions that take the name (not the LE reference itself) of a LE as the argument. This usually happen on functions that can operate on LEs that are not on the current form. If a LE is not on the current form (the one containing the SBasic) there is no generated LE reference - thus its name, a string, is used to indicate which LE on the other form is needed.

You can use an LE reference in that case - but it will use the value in the LE as a string, as opposed to using the string of the LE's name (unless, the name as string, is the value of the LE).

  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: quotes in Xlookups
Reply #6 - Sep 17th, 2004 at 5:26pm
Print Post Print Post  
Quote:
Thanks for the info, but how about in FormFieldValue (which I use a lot).

The second argument requires quotes, but refers to the form and field names, such as:

formfieldvalue("LineItems", "Item sold", 1, part number)

It seems that only the last argument follows the rules you mentioned above.

???

Steve



It's the same rule. The argument must resolve to a string. For example, this will work.
Code
Select All
var vName as String

vName = "Item Sold"
formfieldvalue("LineItems",  vName,  1,  part number)
 


  

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


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: quotes in Xlookups
Reply #7 - Sep 17th, 2004 at 5:43pm
Print Post Print Post  
Bob, the formfieldvalue example is not part of an xlookup. It's used to 'post' data into a subform.

Mark, thanks for the explanation. It leads me to another question I have been wondering:

If I want to 'post' data to a field that is not visible on the form or subform, but IS a field in the current database I'm working in, MUST i use the xpost command or can I 'post' to it using a faster method?

For example, if I delete the "Item Sold" LE on the LineItems subform so it is not visible from the parent form, whats the easiest way to post data to that field from the parent form?

Steve
  
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: quotes in Xlookups
Reply #8 - Sep 17th, 2004 at 5:47pm
Print Post Print Post  
Erika,

I see it now!

Darn, I'm dense!

Steve
  
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: quotes in Xlookups
Reply #9 - Sep 17th, 2004 at 6:01pm
Print Post Print Post  
Quote:
Bob, the formfieldvalue example is not part of an xlookup. It's used to 'post' data into a subform.
I knew that Steve....I was making a attempt at humor, like "leaking pens"?....You were asking why the rule did not apply to a function that was not part of your original question, that's why I bolded xlookup..... Roll Eyes....enuf, back to work now, bye..........

  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: quotes in Xlookups
Reply #10 - Sep 17th, 2004 at 6:07pm
Print Post Print Post  
OOohhhh, sorry! Like I said, I'm dense!

And I thought no one caught my "leaking pens" joke.


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



Posts: 2530
Joined: Nov 22nd, 2002
Re: quotes in Xlookups
Reply #11 - Sep 17th, 2004 at 6:21pm
Print Post Print Post  
Quote:
If I want to 'post' data to a field that is not visible on the form or subform, but IS a field in the current database I'm working in, MUST i use the xpost command or can I 'post' to it using a faster method?

For example, if I delete the "Item Sold" LE on the LineItems subform so it is not visible from the parent form, whats the easiest way to post data to that field from the parent form?


Don't delete it. Make it invisible and access it as you ordinarily would.
  

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


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: quotes in Xlookups
Reply #12 - Sep 17th, 2004 at 6:36pm
Print Post Print Post  
Mark,

The LE's that I want to hide are in a subform in TABLE mode, so even though they are set to 'not visible', they still show up when viewed as a subform in table mode.

I guess I have to delete them from the form in order to hide them. So that means I can ONLY post to the field using xpost?

Thanks,
Steve
  
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: quotes in Xlookups
Reply #13 - Sep 17th, 2004 at 7:48pm
Print Post Print Post  
To "hide" subform fields in a TableView. make them narrow and put them at the end of the form.

Keep them on the subform, but move them to the bottom, and make them only a few pixels wide.  The position and the width you have on the subform is the sequence and width that will show up in the Table View. 

This will force those fields to the right in the Table View.  Now you can resize the subform to keep them out of sight.  You can also put a block on top of the scroll at the bottom, so no one knows that there is a scroll bar to those fields on the right that are out of sight.  Make the block the same color as the form background.
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: quotes in Xlookups
Reply #14 - Sep 17th, 2004 at 8:08pm
Print Post Print Post  
Bob,

I always knew this was possible, but never thought it to be 'professional' until you suggested it. I guess its going to be commonplace to avoid xposting to the subform.

I'll give it a try.

I'm a little confused about your suggestion for hiding the scroll bar. Are you saying to lay a colored box on the form overlapping the subform slightly so it will hide and prevent access to the scroll bar? Sounds interesting.

Steve
  
Back to top
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send Topic Send Topic Print Print