![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Buscar | Temas de Hoy | Marcar Foros Como Leídos |
![]() |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
|
|
#1
|
||||
|
||||
|
Cita:
Cita:
|
|
#2
|
||||
|
||||
|
Ahora que entiendo que el visor artesanal en el que estamos trabajando es típico de lo que haría un programador en C en donde 0 es false y distinto de cero es true. Si queremos algo más de estilo Pascal podríamos usar:
Código:
// bZorrilla es una variable booleana
ShowMessage(Chr((Ord('T') - Ord('F'))*Integer(bZorrilla) + Ord('F')));
De hecho podemos omitir totalmente el uso de funciones auxiliares como IntToStr, Chr u Ord y utulizar exclusivamente moldeo de tipos: Código:
ShowMessage(Char((Integer('T') - Integer('F'))*Integer(bZorrilla) + Integer('F')));
Última edición por roman fecha: 25-01-2004 a las 03:23:06. |
|
#3
|
|||
|
|||
|
Perdón por el Off Topic, pero, es que Román, cada día se te va más la pelota
(de buen rollo, eh!!!! )PD: me ha encantado tu solución ![]() |
|
#4
|
||||
|
||||
|
Como anda el patio...
Personalmente yo no iria mostrando mensajes porque al final vas a acabar un poco harto de tanto aceptar. Pondria una etiqueta en el formulario y le daria valor en cada procedimiento: if leyendo then lbLeyendo.caption:= 'Verdadero' else lbLeyendo.caption:= 'Falso'
__________________
Saludos, Peter Investment |
|
#5
|
||||
|
||||
|
Hola,
Aunque no es exactamente lo que se pide, también podría ser de utilidad el procedimiento Assert, muy utilizada en C: Código:
procedure Assert(expr : Boolean [; const msg: string]); "In Delphi code, use Assert as a debugging tool to test that conditions assumed to be true are never violated. Assert provides an opportunity to intercept an unexpected condition and halt a program rather than allow execution to continue under unanticipated conditions. Assert takes a Boolean expression and an optional message string as parameters. If the Boolean test fails, Assert raises an EAssertionFailed exception. If a message string was passed to Assert, the exception object is created with that string. Otherwise it is created with a default string indicating that the assertion failed. The message is displayed along with the complete path, filename, and the line number on which Assert failed." Saludos |
|
#6
|
||||
|
||||
|
Tengo que decir a lo que propone Investment que yo lo utilizo cuando se trata por ejemplo de un bucle o se va mostrar em muchos sitios, incluso un memo y así luego podemos ir recorriendo los valores.
Un Saludo.
__________________
Guía de Estilo de los Foros Cita:
|
![]() |
| Herramientas | Buscar en Tema |
| Desplegado | |
|
|
|