The
Pos(SubStr, SrcStr)
will not find the first occurance of the set of characters and stop. And you cannot use a set of characters. It will only search for 1 designated character and stop.
Say I got this:
String := '123143567'
Now say I do this:
Value := Pos('3', String)
Its going to give me the position of the first 3. Now say that is what I want only if the string doesnt contain any other of the characters I'm looking for.
The reason for this is because of a Calculater Type program I want to build. The Calculator must follow the Order of Operations (PEMDAS).
Say it searches and finds a * symbol. I can't use the symbol until im sure that the character before and after it don't contain anything but numbers. The LastDelimiter command will work for finding if it works on the left hand side of the symbol but I don't have anything for the right hand side.
I would just do a:
TempStr := RightStr(String, Length(String)-Pos(LastDelimiter('*/+-', String), String))
Since LastDelimiter is returning the position of the last character occurance then there will for sure be no symbols in that string if i use a right string.
Not so easy going left.
If you have any suggestions let me know.
Thanks,
The Lone Programmer
"Is The Juice Worth The Squeeze"
-The Girl Next Door