Brandford

Validación Titulo Nota - bluenote-0.1

Apr 12th, 2014
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.07 KB | None | 0 0
  1.     //Validar titulo de nota ingresada
  2.     do{
  3.         werase(barra_mensajes);
  4.         wprintw(barra_mensajes,"#Informacion: Presione ENTER para cancelar (vacio)");
  5.         wrefresh(barra_mensajes);
  6.         move(2, 0);
  7.         attron(A_BOLD);
  8.         printw("+Titulo\t\t: ");
  9.         attroff(A_BOLD);
  10.         refresh();
  11.         getstr(p_notas->titulo_nota);
  12.        
  13.         if(p_notas->titulo_nota[0] == 0 )
  14.         {
  15.             curs_set(0);
  16.             noecho();
  17.                 werase(barra_mensajes);
  18.             wprintw(barra_mensajes,"#Informacion: Volviendo al menu principal...");
  19.             wrefresh(barra_mensajes);
  20.             sleep(2);
  21.                 werase(barra_mensajes);
  22.             wrefresh(barra_mensajes);
  23.             delwin(barra_superior);
  24.             delwin(barra_mensajes);
  25.             return(0);
  26.         }
  27.        
  28.         if( ! ( p_notas->titulo_nota[0] != ' ' ) )
  29.         {
  30.             curs_set(0);
  31.             noecho();
  32.             werase(barra_mensajes);
  33.             wprintw(barra_mensajes,"#Error: debe ingresar un valor...");
  34.             wrefresh(barra_mensajes);
  35.             sleep(1);
  36.                 werase(barra_mensajes);
  37.             wrefresh(barra_mensajes);
  38.             curs_set(2);
  39.             echo();
  40.         }
  41.     }while( ! ( ( p_notas->titulo_nota[0] != 0 ) && ( p_notas->titulo_nota[0] != ' ' ) ) );
Advertisement
Add Comment
Please, Sign In to add comment