Finding a character in a string

Hi

Is there a special function in LotusScript with wich I can find the position of the 12th, e.g., semicolon ( or another character) in a large string?

Regards

Subject: Finding a character in a string

Use Instr() and interate through the string

Subject: RE: Finding a character in a string

Hi

That is a wat to do it. But there must be a easier and better way to do it. I am trying to use the @Explode function in the Evaluate function in LotusScript like this:

dim vascores as variant

varScores = Evaluate({@Explode(LPScores, “#”) } , docThis)

But the code gives an error at the evaluate line. What is wrong with my code?

Regards

Subject: *Are you sure that LPScores is not already a multi-value list?

Subject: Change “,” to “;” i.e…

varScores = Evaluate({@Explode(LPScores; “#”) } , docThis)

Subject: *Good catch.

Subject: RE: Finding a character in a string

Instead of using Evaluate and @Explode, can you not use the Split function available with LotusScript?

Subject: Yes you can. The @Explode will work if you have any R5 clients left over though.

Subject: RE: Finding a character in a string

How about this InstrAll() function, which returns an array of numbers at which the search string occurs:

Sub Initialize

s="hey,who,made,,food,,,in,the,garden,,"

a=InstrAll(s,",")

End Sub

Function InstrAll(s,t)

i=0

p=Instr(s,t)

Done=p<=0

While Not Done

	Redim Preserve a(i)

	a(i)=p

	p=Instr(p+Len(t),s,t)

	If p>0 Then i=i+1 Else Done=True

Wend

InstrAll=a

End Function