HTBasic Help
×
Menu
Index

POS

Returns the position of one string within another.
 
 POS( search-string, match-string )
 
Usage:
I=POS(A$,B$)
IF POS(A$,B$(5)) THEN Start
P=POS(A$,"PN")
Hyphen=POS(Txt$,"-")
ON POS(Fk$,Key$) GOSUB 1000,2000,3000
 
Example:           POS.BAS
 
Description:
POS returns the character position in the search-string of a match-string. A value of zero is returned if the match-string is not found in the search-string or if the match-string has a zero length.
 
If a sub-string is specified for the search-string, the position returned is the position from the beginning of the sub-string not from the beginning of the full string.
 
See Also: