If one of the needles is in the haystack, I want to know its position. For example, if the haystack is:
Hi!
... I assign the position of the needle to 3.
The way I came up with to determine the position of the needle gets the job done, but it's klunky, as it involves replacing the needle with a nonsense "word":
Code: Select all
If (InStr(Clipboard,".") || InStr(Clipboard,"?") || InStr(Clipboard,"!")) ; If Clipboard contains !?.
{
LenClip := StrLen(Clipboard)
x := Clipboard
x := StrReplace(x, ".", "&*^$#@")
x := StrReplace(x, "?", "&*^$#@")
x := StrReplace(x, "!", "&*^$#@")
Pos := Instr(x, "&*^$#@")
Offset := LenClip - Pos
}
}