I have a file that contains the names of customer specifications called "Customer Specs". From another file called "Work Instructions", using the programming below, I search all the records in Customer Specs and select only those records that match the beginning of the "Customer" element in Work Instructions. I only use the first four characters of the Customer element for my search.
When I try to use more characters, the programming doesn't work correctly if there is a space in the name. For example, I find all the records for a customer named "Jet Parts" when I use the left-most four characters. If I expand to 6 characters, nothing is selected and the list is blank. I believe the space between "Jet" and "Parts" is causing a problem.
This can cause some confusion because I have different customers that start with "Jet", for example, "Jet Parts", "Jet Avion", "Jet PMA", etc.
Is there a better way to create this list that avoids this problem?
Any help would be greatly appreciated.
Var str1 as string Var str2 as string var vTemp as Int var vPos as Int var vName as string var vName2 as string
vName=Customer vName2=Customer
vName=@Left(vName,4) vName2=@Left(vName2,7)
// change vName to FISHER for EMERSON name
if vName2="EMERSON" then vName="FISH"
vName=vName+".."
PopupSelectPosition(6, @XPos(ThisElement), @YPos(ThisElement))
STR1=@XLookupSourceListAll(@fn,vName,"CUSTOMER SPECS!CSPECS","CSpecs;Revision")
STR1 = @replace(STR1,";"," ~ Rev: ")
STR1 = @replace(STR1, @Chr(10), ";")
STR1 = @SORTSTRINGARRAY(STR1, 0)
STR2=@PopupChoiceList(STR1,"SELECT A SPECIFICATION")
STR2 = @Left(STR2,@Instr(str2, "~")-1)
If @Len(STR2) > 0 { vTemp = @ASynchShell("F:\Sesame docs\ts doc Customer Specs\"+STR2) }
|