im trying to this code but i encounter this errors;
invalid expression term 'else'
the name "If' does not exist in the current context
Code:If(i > 12);
{
i = 1;
}
else();
{
i = i + 1;
}
Printable View
im trying to this code but i encounter this errors;
invalid expression term 'else'
the name "If' does not exist in the current context
Code:If(i > 12);
{
i = 1;
}
else();
{
i = i + 1;
}
You don't put parentheses after the else and you don't use a semicolon on either. Anything that is follow by a code block in braces is NOT the end of a statement so you don't use the end-of-statement character, i.e. the semicolon:Code:if(i > 12)
{
i = 1;
}
else
{
i = i + 1;
}
'if' is supposed to be lowercase, so it starts whining. Are you from a VB6/VB.NET background? :DQuote:
Originally Posted by arshesander
I suggest starting with a tutorial
Better you should learn the syntaxCode:if(i > 12)
{
i = 1;
}
else
{
i = i + 1;
}
Also punctuation.Quote:
Originally Posted by RaviIntegra
Quote:
Originally Posted by wossname
Dude buy a book called Microsoft WSH and Vbscript programming for the absolute beginner by Jerry Lee Ford, JR. I have the book and it works great with simply examples to follow.
Systemfire
We are discussing C#, not VBScript.Quote:
Originally Posted by systemfire