FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
|
Herramientas | Buscar en Tema | Desplegado |
#1
|
|||
|
|||
Could not convert variant of type (Null) into type (Integer)
Hola!
Tengo un problemita con el cual nunca eh lidiado. Es en sistemas XML, en el cual estoy usando un entero, pero aveces cierta función no existe osea NULA, de modo que no encuentra el entero y me tira error. Código:
Could not convert variant of type (Null) into type (Integer)
|
#2
|
||||
|
||||
Simplemente, antes de entrar en el case, comprueba si el valor es nulo, y en caso afirmativo asígnale el valor x defecto:
para evaluar la constante NULL, debes incluir uses variant, aunque supongo que ya lo tienes. OJO: compara con NULL, no con nil. Son cosas distintas. |
#3
|
||||
|
||||
También puedes utilizar la función VarIsNull() especficamente diseñada para ello.
__________________
Germán Estévez => Web/Blog Guía de estilo, Guía alternativa Utiliza TAG's en tus mensajes. Contactar con el Clubdelphi P.D: Más tiempo dedicado a la pregunta=Mejores respuestas. |
|
|
Temas Similares | ||||
Tema | Autor | Foro | Respuestas | Último mensaje |
Sql que no retorna datos me da error:invalid variant type conversion | bezaig | SQL | 6 | 17-03-2010 08:58:53 |
type? | Ledian_Fdez | C++ Builder | 1 | 05-02-2010 20:53:42 |
problema con type | anubis | Varios | 1 | 06-05-2007 21:24:37 |
type needs finalization | henrygale | Varios | 2 | 13-02-2007 16:49:44 |
Type Memo | emeritos | Conexión con bases de datos | 1 | 07-11-2003 14:40:06 |
|