RSS feed blog feed : : del.icio.us : : newsletter : : free magazines : : find a job

If Control Structure

Posted by Ken Cheung on Wednesday, May 10, 2006 in General : : comment

Today I'm putting together a chart for the "if" control structure. The chart is intended for developers who program in php, vbscript, and javascript. Its easy to get the syntax wrong when you program with all three scripting languages.

"If"

php if (condition) {
     statements;
}
javascript if (condition) {
     statements
}
vbscript if (condition) then statement 1 : statement 2

or

if (condition) then
     statements
end if

"Else"

php if (condition) {
     statements;
} else {
     statements;
}
javascript if (condition) {
     statements
} else {
     statements
}
vbscript if (condition) then
     statements
else
     statements
end if

"ElseIf"

php if (condition) {
     statements;
} elseif (condition 2) {
     statements;
} else {
     statements;
}
javascript elseif not available
vbscript if (condition) then
     statements
elseif (condition 2) then
     statements
else
     statements
end if

References

If you found this page interesting, bookmark and share it on:
del.icio.us : : digg : : yahoo : : furl : : reddit : : newsvine : : spurl : : blink : : simpy : : blogmarks

Posts of Interest

Comments »

No comments yet.

Name (required)
E-mail (required - never shown publicly)
URI
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> in your comment.

iZachy Newsletter

Don't have time to visit iZachy everyday? Then sign up for my free newsletter. I'll send you an email when I have something to share with you. Your email address will be kept confidential and I will not share, sell, or rent it to anyone. You can unsubscribe at any time by clicking a link in the email.

Enter your email address to sign up for my newsletter: