I have not worked with creating my own functions, I will have to work on this one a bit.
I do think the split command is the answer.
I just needed the first 2 positions for now and did it using MID, LENGTH, INSTR command.
I know there must me a shorter/simpler coding method but works for now.
Patrick
IF
Mid({BAQReportResult.InvcHead.SalesRepList},1,
Length({BAQReportResult.SalesRep.SalesRepCode}))
= {BAQReportResult.SalesRep.SalesRepCode} then 1
Else IF
Mid({BAQReportResult.InvcHead.SalesRepList},
Instr({BAQReportResult.InvcHead.SalesRepList},"~")+1,
Length({BAQReportResult.SalesRep.SalesRepCode}))
= {BAQReportResult.SalesRep.SalesRepCode} then 2
Else 0
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com]
Sent: Tuesday, September 09, 2014 10:01
To: vantage@yahoogroups.com
Subject: [Vantage] Re: 9.05.702 - Crystal Syntax for finding the position of an item in a string.
Good Morning,
I use a custom function in crystal and call it. I know there are 5 members in array and I get the member out by:
Function (StringVar SplitRepList, numbervar ListMemberNum)
If ListMemberNum=1 then if Split(SplitRepList,"~")[1]<>"" then Split(SplitRepList,"~")[1]
else if ListMemberNum=2 then if Split(SplitRepList,"~")[2]<>"" then Split(SplitRepList,"~")[2]
else if ListMemberNum=3 then if Split(SplitRepList,"~")[3]<>"" then Split(SplitRepList,"~")[3]
else if ListMemberNum=4 then if Split(SplitRepList,"~")[4]<>"" then Split(SplitRepList,"~")[4]
else if ListMemberNum=5 then if Split(SplitRepList,"~")[5]<>"" ; then Split(SplitRepList,"~")[5]
This email and any attached files are confidential and intended solely for the intended recipient(s). If you are not the named recipient you should not read, distribute, copy or alter this email. Any views or opinions expressed in this email are those of the author and do not represent those of the Specialty Screw Corporation company. Warning: Although precautions have been taken to make sure no viruses are present in this email, the company cannot accept responsibility for any loss or damage that arise from the use of this email or attachments.