Sign in to follow this  
Followers 0
bluerein

Variable if not?

4 posts in this topic

Ive got a variable like so

$key = 12345678

I need to find if the variable is wrong,so I thought

if not $key = 12345678 then exit

but that doesnt work

Whats the best way to go about this??

regards bluerein

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

if $key <> 12345678

or

if not ($key == 12345678)

Your way, the 'not' attaches to $key first, so your expression becomes (assuming $key is non-zero)

if 0 = 12345678

Edited by wraithdu

Share this post


Link to post
Share on other sites

Ive got a variable like so

$key = 12345678

I need to find if the variable is wrong,so I thought

if not $key = 12345678 then exit

but that doesnt work

Whats the best way to go about this??

regards bluerein

Please post in right forum. Here is Example forum.

The answer:

If $key <> 12345678 Then Exit

When the words fail... music speaks

Share this post


Link to post
Share on other sites

Im so sorry just realized I posted in examples!

Just got up ...lol

Thanks for the replys guys!!

If I mod could move the top...thanks

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0