Author Topic: Why the hell won't this work.  (Read 543 times)

I've been trying to use if statements, why isn't this working?
Code: [Select]
function call(%var)
{
%var == 5;
if(%var == 5)
{
echo("Over 60!");
}
}

function call(%var)
{
%var = 5;
if(%var == 5)
{
echo("Over 60!");
}
}
Also, it isn't a problem, but having %var as an argument is pointless if your just defining it in the function anyways.

So how can I solve it, %number1?
hang on I deleted the argument and it still is syntaxing.

What is your code right now?

Nono.
It says it's wrong here:
%number1 == 5; ##
##

Yeah, do what a bolded in my first post

It needs to be %number1 = 5;
= is used to assign a value, == to compare values

Code: [Select]
function call(%var)
{
if(%var == 5)
{
echo("Over 60!");
}
}
or
Code: [Select]
function call()
{
%var = 5;
if(%var == 5)
{
echo("Over 60!");
}
}
i think

Oh sorry. My friend said do ==.
Ok, thanks guys, it works!