View Single Post
  #65  
Old 05-04-2011, 02:27 AM
oo_jazz_oo oo_jazz_oo is offline
Jazz teh Awesome
oo_jazz_oo's Avatar
Join Date: Jul 2006
Location: California
Posts: 596
oo_jazz_oo is a jewel in the roughoo_jazz_oo is a jewel in the rough
Send a message via MSN to oo_jazz_oo
Quote:
Originally Posted by Devil_Lord2 View Post
I hate that! My first script I decided to work on was learning Dustys hammer and he did things sort of like that.. the missing brackets are the only reason I couldn't understand the parts I wanted to learn were
level.tiles[x,y];
and
updateboard(x,y,L,W);
Actually, having single like script blocks within if() or loops is common.

The problem in this case is he was asking about a function without brackets.

PHP Code:
function onCreated() {
  if (
foo == bar) return true;
}
function 
onPlayerEnters() {
  for (
pl:players)
    
pl.chat "Welcome!";

Both of which are used commonly. At that point, I think its a matter of preference whether you include brackets for 1 line codes.
__________________

Reply With Quote