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
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.
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?
-
- Mensajes: 475
- Registrado: Mar Jul 24, 2012 10:21 pm
How do OnInitialize on Command Line?
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
> 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
-
- Mensajes: 475
- Registrado: Mar Jul 24, 2012 10:21 pm
How do OnInitialize on Command Line?
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
"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