18.01.2013 Views

VBScript Reference Manual for InduSoft Web Studio

VBScript Reference Manual for InduSoft Web Studio

VBScript Reference Manual for InduSoft Web Studio

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>VBScript</strong> <strong>Reference</strong> <strong>Manual</strong> <strong>InduSoft</strong> <strong>Web</strong> <strong>Studio</strong><br />

InStrB<br />

Description Returns an integer indicating the byte position of the first occurrence of one string within a string<br />

containing byte data.<br />

Usage intVal = InStrB([start, ]string1, string2[, compare])<br />

Arguments start<br />

Optional. Is any valid non-negative numeric expression that indicates the starting position <strong>for</strong><br />

each search. Non-integer values are rounded. If omitted, search begins at the first character<br />

position. The start argument is required if compare is specified.<br />

string1<br />

Required. String expression being searched.<br />

string2<br />

Required. String expression searched <strong>for</strong>.<br />

compare<br />

Optional. Numeric value indicating the kind of comparison to use when evaluating substrings.<br />

See Settings section <strong>for</strong> values. If omitted, a binary comparison is per<strong>for</strong>med.<br />

Settings The compare argument can have the following values:<br />

Constant Value Description<br />

vbBinaryCompare 0 Per<strong>for</strong>m a binary comparison. (default)<br />

vbTextCompare 1 Per<strong>for</strong>m a textual comparison<br />

Return An integer value indicating the byte position.<br />

The InStr function returns the following values:<br />

If InStr returns<br />

string1 is zero-length 0<br />

string1 is Null Null<br />

string2 is zero-length start<br />

string2 is Null Null<br />

string2 is not found 0<br />

string2 is found within string1 Position at which match is found<br />

start > Len(string2) 0<br />

Remarks The InStrB function is used with byte data contained in a string. Instead of returning the character<br />

position of the first occurrence of one string within another, InStrB returns the byte position. If<br />

start contains Null, a runtime error occurs. If start is larger than the length of string2<br />

(start>Len(string2)), 0 will be returned.<br />

See Also InStr, InStrRev<br />

140 <strong>InduSoft</strong>, Ltd.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!