WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Strings

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

StrSubWild Problem


Question:

I am using StrSubWild to extract a substring matching wildcarded text from within a larger string. However I keep getting a null string as the result yet my wildcard string should match some text in my larger string.
string = "name:!new_account!:98765:12345:Tipical AUser:/home/paul:/bin/csh" 
wildcard = ":!*:" 
result = StrSubWild( string, wildcard, 1 )

Answer:

The problem seems to be that the 'pattern' doesn't match at the specified 'start' position. StrIndexWild can be used to locate the start position.
string = "name:!new_account!:98765:12345:Tipical AUser:/home/paul:/bin/csh" 
wildcard = ":!*:" 
start = StrIndexWild( string, wildcard, 1 ) 
result = StrSubWild( string, wildcard, start ) 
Mesage( "StrSubWild Result", result )
exit

Article ID:   W17269
File Created: 2007:07:03:14:29:08
Last Updated: 2007:07:03:14:29:08