Normal Topic String Variables question (Read 391 times)
FlipGilbert
Full Member
***
Offline


Running Ver 2.6.4

Posts: 236
Location: Sandy Eggo
Joined: Mar 8th, 2005
String Variables question
Nov 10th, 2010 at 9:47pm
Print Post Print Post  
Hello,
I think the best way to start is to give this some background.
I'm looking for the best way to compare one field with another that contains a word that is common in both fields.
example
 
If (vField = "Vendor..") Then....

Its in a data base that looks up Vendors with the same name but different locations like "Vendor - San Diego"  and " Vendor - Los Angles"
the common word is "Vendor" How do I us the ".."  

or am I going about this all wrong?

Thank you for any help.
Flip

ver 2.5.2
  

It's not what a man says that matters or how he says it, but what he does and how he does it.
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: String Variables question
Reply #1 - Nov 11th, 2010 at 3:16pm
Print Post Print Post  
Hello Flip,

If you are using an X Command to get information from all the different locations, such as @XLookupSourceListAll or @XResultSetSearch, both of those accept retrieve spec syntax in the Key argument.

If the elements are all on one form, say "Vendor - San Diego" in Element1  and " Vendor - Los Angles"  in Element2 you could do something like

If @Left(Element1, 6) = "Vendor" Then....
If @Left(Element2, 6) = "Vendor" Then....

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
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: String Variables question
Reply #2 - Nov 11th, 2010 at 11:09pm
Print Post Print Post  
I use following to detect if the field contains the word...

If @IN (Element1, "Vendor") > 0 then....
If @IN (Element2, "Vendor") > 0 then...

This way it does not really matter if word "Vendor" is anywhere in the element, in the beginning or at the end or somewhere in the middle.

Bharat
  
Back to top
 
IP Logged