January 1, 2005

WinTask - StrCSpnI

'
' StrCSpn - search a string for the first occurrence of any of a group of characters.
'   note: the search is NOT case-sensitive
'

' Author: Joe Strazzere
'

 

dim ptr1 as unsigned
dim ptr2 as unsigned

 

ptr1=allocate(255)
ptr2=allocate(255)

 

' the string in which to search
PokeString(ptr1,"This is, a test",1)

 

' the group of characters to search for
PokeString(ptr2,"ABC",1)

 

' returns the number of characters before the found character
ret=External("shlwapi.dll","StrCSpnIA",ptr1,ptr2)

msgbox(str$(ret))