Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Not sure what is occuring in this code

Status
Not open for further replies.

vb89

MIS
Aug 21, 2008
47
US
Can somone please explain to me what is happening in this code...

Code:
If InStr(iTeamID,"lg") Then
	  		iLeagueID = Replace(iTeamID,"lg","")
	  		iTeamID = ""
	  		tTeamName = ""
		Else
			iLeagueID="9"  'All players (I-A and I-AA)
		End If
 
The InStr() function find strings within strings so the first InStr is looking at the string contained in iTeamID and seeing if it contains the value "lg". If it find it, then the second function Replace() is run and in the string contained in iTeamID, it is replacing "lg" with an empty (blank) string value "".
Else it sets the iLeagueID to 9.

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top