Ver Mensaje Individual
  #3 (permalink)  
Antiguo 22/05/2006, 11:07
haven
 
Fecha de Ingreso: febrero-2002
Ubicación: Navarra
Mensajes: 701
Antigüedad: 22 años, 4 meses
Puntos: 2
control de errores ++

te paso la funcion entera, si necesitas mas informacion te paso el proyecto entero. Que librerias de c++ se pueden utilizar? tengo q hacer otra aparte de: (iomanip tambien esta).
#include <iostream>
#include <string>
#include <fstream>
#include <iomanip>

void marquee::pedir_marquee (string a, int b)
{
string velo;
string com;
string alternate;
string scroll;
int i;
int velo1;
do{
try
{

switch (b)
{
case 1:
cout <<"introduce "<<a <<" nueva"<<endl;
cin>>velo;
velo1=0;
for (i=0;i<velo.size();i++)
{
velo1=velo1+(velo.at(i)-48)*(pow(10, velo.size()-i-1));
}
for(i=0; i<velo.size();i++)
{
if (velo.at(i)<48 || velo.at(i)>57)
{
b=1;
throw LETRAS_EN_NUMEROS;
}
if (velo1<0 || velo1>500)
{
throw RANGO;
}
}

velocidad=velo;
b=0;
break;

case 2:
cout <<"introduce "<<a<<" nueva"<<endl;
cin>>com;
if (com!=alternate || com!= scroll)
{b=2;
throw ERROR_EN_MOVIMIENTO;
}/*
if ((strcmp(com, alternate)<0) || (strcmp(com, alternate)>0) || (strcmp(com, scroll)!=0) || (strcmp(com, scroll)!=0))
{
b=2;
throw ERROR_EN_MOVIMIENTO;
}
*/
movimiento=com;
b=0;
break;
}
}
catch(error e)
{
switch(e)
{
case ERROR_EN_MOVIMIENTO:
cerr<<"Ese movimiento no existe"<<endl;
break;
case RANGO:
cerr<<"El numero introducido esta fuera del rango"<<endl;
break;
}
}
}while(b!=0);

}
__________________
asp, php, .net, adaptandose a las necesidades