FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
|
Herramientas | Buscar en Tema | Desplegado |
#1
|
|||
|
|||
Tipo de Propiedades y valor de una clase u objeto TypInfo
En realidad no se si estoy haciendo correctamente la pregunta
Aqui mi unidad, solo un formulario (Form1) y un boton (btnPrueba)
Apartir de la clase Producto = Class(TPersistent) Donde estan definidos sus tipos, quiero por medio de TypInfo o RTTI Obtener las propiedades y sus respectivos valores. Vale aclarar que la clase Producto es mucho mas extensa y esta definida en otra unidad, aqui esta resumida para el caso practico. Con el procedimiento GetPropertyList(Producto, Lista, tkProperties); Obtengo la lista de propiedades de Producto y se carga en Lista: TStringList Luego recorriendo ese TStringList obtengo cada uno de los valores y su tipo Value := GetPropValue(Producto, Lista[i]); PInfo := GetPropInfo(Producto, Lista[i]); Mi problema es que al ver los valores siguientes FCreado:TDateTime; FClaves:TStringList; Estos me devuelven numeros de tipo float Supongamos que en el caso del TDateTime esto sea correcto porque se maneja asi... Como hago para que eso que me devuelve lo pase a fecha (dd/mm/yyyy) que el usuario ve, siendo que el tipo devuelto es un tkfloat, el usuario no entiende ese numero float, yo tengo que mostrarle la fecha. En el caso de claves es mas complicado porque lo que me devuelve tambien es un numero float, pero el tipo es un tkClass, como hago para sacar los valores que tiene ese stringlist Lo que pensaba era, volver a la funcion, donde le paso la clase producto apuntando a claves que es lo que quiero que me devuelva ahora... pero la lista la deja vacia, como que no encuentra ese elemento GetPropertyList(Producto.Claves, Lista2, tkProperties); Tambien probe con este procedimiento, tambien me devuelve la lista vacia GetPropertyNames(Producto.Claves, Lista);
|
|
|
Temas Similares | ||||
Tema | Autor | Foro | Respuestas | Último mensaje |
Publicar parte de un objeto de clase | jlrbotella | OOP | 7 | 19-07-2017 09:18:54 |
Crear Objeto por su nombre de clase | jlrbotella | OOP | 2 | 08-01-2008 23:44:37 |
Acceso a las propiedades de un objeto desde el editor de propiedades | Hugo | OOP | 0 | 24-11-2006 12:58:22 |
Clase, objeto, tipo? | [Gunman] | OOP | 3 | 04-01-2006 16:11:32 |
Metodo que devuelva la lista de propiedades de la clase. | nemo | OOP | 1 | 16-07-2003 16:10:02 |
|