Friday, November 20, 2009

IO_Form private > add()

i just want to see if i'm on the right track... well our group.. so can someone take a look?

int IO_Form::add(IO_Field* f, bool dynamic, bool submitter){

IO_Node *Temp = new IO_Node(f, dynamic, submitter);
if(Tail){
Tail->_next = Temp;
Temp->_prev = Tail;
Temp->_next = NULL;
Tail = Temp;
Current = Tail;
}
else{
Current = Head = Tail = Temp;
}
f->set(this);

return length();
}

1 comment:

  1. It looks ok, but I don't think you need to set the current to tail, because essentially current is where editing is to start, and you don't want the editing begin from the last field:)
    ...
    Tail = Temp;
    Current = Tail; // no need
    }
    else{
    Current = Head = Tail = Temp;
    }

    ReplyDelete