Thread: Curiosity...
View Single Post
  #9  
Old 08-08-2008, 07:24 PM
LoneAngelIbesu LoneAngelIbesu is offline
master of infinite loops
LoneAngelIbesu's Avatar
Join Date: May 2007
Location: Toldeo, Ohio
Posts: 1,049
LoneAngelIbesu has a spectacular aura aboutLoneAngelIbesu has a spectacular aura about
Send a message via AIM to LoneAngelIbesu
Quote:
Originally Posted by DustyPorViva View Post
It depends on how many values of the object I am changing.
Yup, same here. As a rule of thumb, if I'm changing three or more values, I use with.

I mean, really... which one looks better? It may be more lines, but I guess I'm a block kind of guy.
PHP Code:
function TheParentObject.onMove(newxnewy) {
  
TheObject.newx TheParentObject.width 10;
  
TheObject.newy;
  
TheObject.text "Has been moved with parent object";
}
function 
TheParentObject.onMove(newxnewy) {
  
with(TheObject) {
    
this.newx TheParentObject.width 10;
    
this.newy;
    
this.text "Has been moved with parent object";
  }

__________________
"We are all in the gutter, but some of us are looking at the stars."
— Oscar Wilde, Lady Windermere's Fan
Reply With Quote