The Dink Network

Reply to Re: D-Modding tips 'n tricks

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
March 25th 2010, 08:12 AM
dinkdead.gif
If statements:

if (&var)

is exactly the same as
if (&var != 0)


Also, you don't always need the braces after an if statement. Without braces, the 'if' just applies to the next line, like so:

if (&var)
goto here;
goto there;

If &var is 0 it will go to 'there' and otherwise it will go to 'here'.
You can even do it on the same line!
if (&var) goto here;
goto there;

Not really reccomended though, just indent that line or something.
The exception to this is variables, if you're changing a variable always enclose it in braces even if it's only one line because it has been known to cause problems.