View Single Post
  #10  
Old 06-04-2007, 08:56 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
You don't have to reference temp variables with temp. just leave that out, it looks better.
PHP Code:
public function saveItems() {
  
temp.file =
  
temp.i =
  
temp.path =
  
temp.data = 0;
  
  for (
i = this.items.size() - 1; i > -1; i --) {
    if (
this.items[i].archname != null) {
      
data = this.items[i].getSaveData();
      
file.(@ "item" @ data[0]) = {data[1], data[2], data[3], data[4]};
    }
  }
  
path = MudControl.containerpath @ this.conttype @ "/cont" @ this.contid @ ".txt";
  
file.saveVars(path, 0);
} 
Versus
PHP Code:
public function saveItems() {
  for (
temp.i = this.items.size() - 1; temp.i > -1; temp.i --) {
    if (
this.items[temp.i].archname != null) {
      
temp.data = this.items[temp.i].getSaveData();
      
temp.file.(@ "item" @ temp.data[0]) = {temp.data[1], temp.data[2], temp.data[3], temp.data[4]};
    }
  }
  
temp.path = MudControl.containerpath @ this.conttype @ "/cont" @ this.contid @ ".txt";
  
temp.file.saveVars(temp.path, 0);
} 
__________________
Reply With Quote