In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

How do OnInitialize on Command Line?

Xailer professional forum in English
Responder
Cassiano de Oliveira
Mensajes: 475
Registrado: Mar Jul 24, 2012 10:21 pm

How do OnInitialize on Command Line?

Mensaje por Cassiano de Oliveira »

By Google Translator - Sorry :(
The IDE put in OnInitialize event { || SetKey ( VK_ESCAPE , 0 , { || ::
Close ( ) } ) }
ok works
How do it on command ?
I tried the way down and could not.
WITH OBJECT oForm : = TForm ( )
: SetBounds ( 508, 218, 894, 534 )
: SetClientSize ( 880, 520)
: cText : = ' Sales Query '
: oFont : = TFont (): Create ( "MS Sans Serif " , 8, 0 , 400)
: nBorderStyle : = bsNONE
// : OnInitialize : = { || SetKey ( VK_ESCAPE , 0 , { || :: Close
( ) } ) } // so it did not work .
: New ( Application : oActiveForm )
: OnInitialize : = { || SetKey ( VK_ESCAPE , 0 , { || :: Close ( ) } ) }
: ShowModal (.T . )
END
Regards,
Cassiano.
---
Este email foi escaneado pelo Avast antiví­rus.
http://www.avast.com
Avatar de Usuario
jfgimenez
Site Admin
Mensajes: 5706
Registrado: Lun Abr 06, 2015 8:48 pm
Contactar:

How do OnInitialize on Command Line?

Mensaje por jfgimenez »

Cassiano,
> By Google Translator - Sorry :(
>
> The IDE put in OnInitialize event { || SetKey ( VK_ESCAPE , 0 , { ||
> :: Close ( ) } ) }
> ok works
>
> How do it on command ?
>
> I tried the way down and could not.
>
> WITH OBJECT oForm : = TForm ( )
> : SetBounds ( 508, 218, 894, 534 )
> : SetClientSize ( 880, 520)
> : cText : = ' Sales Query '
> : oFont : = TFont (): Create ( "MS Sans Serif " , 8, 0 , 400)
> : nBorderStyle : = bsNONE
> // : OnInitialize : = { || SetKey ( VK_ESCAPE , 0 , { || :: Close (
> ) } ) } // so it did not work .
> : New ( Application : oActiveForm )
> : OnInitialize : = { || SetKey ( VK_ESCAPE , 0 , { || :: Close ( ) }
> ) }
> : ShowModal (.T . )
> END
Although it's possible to put a codeblock into another codeblock, in
this case you'll get errors due to the presence of :: (Self). So, you'll
need to write that event as a regular method:
:OnInitialize := "FormInitialize"
...
METHOD FormInitialize( oSender ) CLASS TForm1
SetKey( VK_ESCAPE , 0 , {|| ::Close ( ) } )
RETURN Nil
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info
José F. Giménez
[Equipo de Xailer / Xailer team]
http://www.xailer.com
http://www.xailer.info
Cassiano de Oliveira
Mensajes: 475
Registrado: Mar Jul 24, 2012 10:21 pm

How do OnInitialize on Command Line?

Mensaje por Cassiano de Oliveira »

thanks
"Jose F. Gimenez" wrote in message news:55218314$[email=1@svctag-j7w3v3j....]1@svctag-j7w3v3j....[/email]
Cassiano,
> By Google Translator - Sorry :(
>
> The IDE put in OnInitialize event { || SetKey ( VK_ESCAPE , 0 , { ||
> :: Close ( ) } ) }
> ok works
>
> How do it on command ?
>
> I tried the way down and could not.
>
> WITH OBJECT oForm : = TForm ( )
> : SetBounds ( 508, 218, 894, 534 )
> : SetClientSize ( 880, 520)
> : cText : = ' Sales Query '
> : oFont : = TFont (): Create ( "MS Sans Serif " , 8, 0 , 400)
> : nBorderStyle : = bsNONE
> // : OnInitialize : = { || SetKey ( VK_ESCAPE , 0 , { || :: Close (
> ) } ) } // so it did not work .
> : New ( Application : oActiveForm )
> : OnInitialize : = { || SetKey ( VK_ESCAPE , 0 , { || :: Close ( ) }
> ) }
> : ShowModal (.T . )
> END
Although it's possible to put a codeblock into another codeblock, in
this case you'll get errors due to the presence of :: (Self). So, you'll
need to write that event as a regular method:
:OnInitialize := "FormInitialize"
...
METHOD FormInitialize( oSender ) CLASS TForm1
SetKey( VK_ESCAPE , 0 , {|| ::Close ( ) } )
RETURN Nil
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info
---
Este email foi escaneado pelo Avast antiví­rus.
http://www.avast.com
Responder