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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Equality/Comparison

Status
Not open for further replies.

DANZIG

Technical User
Mar 8, 2001
142
US
Can somebody see what is missing in the snippet below?
Code:
InitLine = "17, some_text_string"
InitArray = Split(InitLine,Chr(44)&Chr(32))
InitCount = InitArray(0)
		
For ForIdx = 1 to 100
	Idx=Idx+1
	WScript.Echo "Idx = "&Idx&", InitCount = "&InitCount&"."
	If Idx >InitCount Then
		WScript.Echo "Idx >InitCount"
	End If
Next

Have use IsNumeric(InitCount) to test that it is reading a a numeric value not a string value but the conditional in the if statement is never met.



Thanks, Danzig
 
If Idx > [red]CInt([/red]InitCount[red])[/red] Then

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top