Monday, October 5, 2009

OOP344

case RIGHT_KEY: /* should stop at the end of data or maxfieldlength */
if(*curpos != fieldlen - 1){
(*curpos)++;
}
else if(/*HELP here can anyone explain to me?*/){
break;
}
else{
(*offset)++;
}
break;


can anyone explain to me? like how do i stop it

1 comment:

  1. Hello,
    Let's think of this logically:

    When you press the right key on a field, you're really redrawing the screen with your cursor one to the right.

    Therefore, if your cursor moves to the right, your *curpos is being incremented by 1 (where then your application would redraw the cursor one to the right). If the user presses the right key and you detect that the condition for moving to the right is not fulfilled (e.g. you're at the end of the data, or at max field length), then all you need to do is ignore the right key input altogether.

    ReplyDelete