Agregar Parametro a Create
Buenas gente, cómo puedo hacer para agregar un parametro a un constructor, la idea es, yo tengo varios formularios en el cual se le asigna un código, lo que quiero hacer es que cuando creo el formulario a parte del parametro de siempre :P le pase un número que va a ser el código que le asigno, lo que habia hecho era esto:
Pero me da el error : Declaration of 'Create' differs from previous declaration Agradeceria cualquier tipo de ayuda. Saludos :D |
Bueno chusmeando un poco de código de delphi encontre la solucion, en ves de modificar el create, creo otro constructor y el código sería así:
De esa manera me funcionó. Saludos :D |
si haces override, lo que estas es 'reescribiendo' una funcion anterior, por lo que la nueva función debe tener la misma estructura. Prueba de poner 'overload', creando asi dos tipos de constructores (uno sin id, el otro con) (no podras usar el inherited, tendras que usar Create(AOwner))
|
Veo q te adelantaste :rolleyes: . Lo más correcto, igualmente, es el 'overload' :p te dejo la ayuda de delphi
Cita:
|
Grax coso por la data :D y te consulto de donde sacaste la info para tenerla de referencia para la proxima jeje.
Saludos y nuevamente Grax |
X) pues de la OOP, aunque ahora hay tantas palabrejas (estaba leyendo lo de virtual y reintroduce) que ya uno se pierde :confused: La cita es de la ayuda del Delphi :)
|
La franja horaria es GMT +2. Ahora son las 02:19:04. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi