if ... in ...

if ... in ...

Postby goosfancito » Mon Dec 01, 2008 8:26 pm

Hola.

Existe algo asi?

Code: Select all  Expand view
if lastkey in [ VK_RETURN, VK_... ] then
   msginfo("paso de campo")
endif


No se si me explique lo que quiero hacer?

Gracias.
FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
User avatar
goosfancito
 
Posts: 1954
Joined: Fri Oct 07, 2005 7:08 pm

Postby karinha » Tue Dec 02, 2008 11:11 am

Code: Select all  Expand view
    LOCAL nKey

    Do Case

       Case nKey == VK_RETURN .OR. GetKeyState( VK_ESCAPE )

       ... Mensagem ...
   
    EndCase
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7214
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Postby goosfancito » Tue Dec 02, 2008 11:26 am

Karhina,

Queria trabajar similar a cuando lo haces utilizando conjuntos en C,

Gracias de todos modos.

ç
karinha wrote:
Code: Select all  Expand view
    LOCAL nKey

    Do Case

       Case nKey == VK_RETURN .OR. GetKeyState( VK_ESCAPE )

       ... Mensagem ...
   
    EndCase
FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
User avatar
goosfancito
 
Posts: 1954
Joined: Fri Oct 07, 2005 7:08 pm

Re: if ... in ...

Postby pymsoft » Tue Dec 02, 2008 12:46 pm

goosfancito wrote:Hola.

Existe algo asi?

Code: Select all  Expand view
if lastkey in [ VK_RETURN, VK_... ] then
   msginfo("paso de campo")
endif


No se si me explique lo que quiero hacer?

Gracias.



Hola, prueba asi:


Code: Select all  Expand view
if ASCAN( lastkey, { VK_RETURN, VK_... } ) != 0
   msginfo("paso de campo")
endif



saludos
Pedro Gonzalez
User avatar
pymsoft
 
Posts: 383
Joined: Tue Oct 11, 2005 1:01 pm
Location: Savona - Italia

Re: if ... in ...

Postby goosfancito » Tue Dec 02, 2008 1:23 pm

Andubo. gracias. Cambiando a ) == 0


pymsoft wrote:
goosfancito wrote:Hola.

Existe algo asi?

Code: Select all  Expand view
if lastkey in [ VK_RETURN, VK_... ] then
   msginfo("paso de campo")
endif


No se si me explique lo que quiero hacer?

Gracias.



Hola, prueba asi:


Code: Select all  Expand view
if ASCAN( lastkey, { VK_RETURN, VK_... } ) != 0
   msginfo("paso de campo")
endif



saludos
FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
User avatar
goosfancito
 
Posts: 1954
Joined: Fri Oct 07, 2005 7:08 pm

Postby pymsoft » Tue Dec 02, 2008 3:53 pm

bien :-)
Pedro Gonzalez
User avatar
pymsoft
 
Posts: 383
Joined: Tue Oct 11, 2005 1:01 pm
Location: Savona - Italia

Re: if ... in ...

Postby Carlos Mora » Tue Dec 02, 2008 9:10 pm

Hola Goos
goosfancito wrote:Existe algo asi?


En xHarbour existe. Te recomiendo registrarte en www.xHarbour.com, que es gratis, y podes acceder a los manuales online. En particular sobre el operador IN pone:

http://www.xharbour.com/xhdn/referenceg ... r&id=19572
Code: Select all  Expand view
Syntax      
   <cSubString> IN <cString>
   <xValue>     IN <aArray>
   <xKey>       IN <hHash>
Arguments    
<cSubString>
   <cSubString> is a character or other value that is searched for in <cString>.
<aArray>
   <aArray> is an array with random values.
<xKey>
   <xKey> is a value to search in a hash.
<hHash>
   <hHash> is a hash value whose keys are searched for <xKey>.
Description    
The IN operator searches the left operand in the right operand and returns .T. (true) if the value of the left operand is contained in the value of the right operand, otherwise .F. (false) is returned.


y creo que es EXACTAMENTE lo que buscas. Aparentemente Harbour no lo soporta, al menos en la version Devel 1.1 que es la que bajé de Fivetech.

Un saludo,

Carlos.
Saludos
Carlos Mora
http://harbouradvisor.blogspot.com/
StackOverflow http://stackoverflow.com/users/549761/carlos-mora
“If you think education is expensive, try ignorance"
Carlos Mora
 
Posts: 988
Joined: Thu Nov 24, 2005 3:01 pm
Location: Madrid, España

Re: if ... in ...

Postby goosfancito » Wed Dec 03, 2008 9:24 am

JE! exacto compañero.-
Gracias.

Carlos Mora wrote:Hola Goos
goosfancito wrote:Existe algo asi?


En xHarbour existe. Te recomiendo registrarte en www.xHarbour.com, que es gratis, y podes acceder a los manuales online. En particular sobre el operador IN pone:

http://www.xharbour.com/xhdn/referenceg ... r&id=19572
Code: Select all  Expand view
Syntax      
   <cSubString> IN <cString>
   <xValue>     IN <aArray>
   <xKey>       IN <hHash>
Arguments    
<cSubString>
   <cSubString> is a character or other value that is searched for in <cString>.
<aArray>
   <aArray> is an array with random values.
<xKey>
   <xKey> is a value to search in a hash.
<hHash>
   <hHash> is a hash value whose keys are searched for <xKey>.
Description    
The IN operator searches the left operand in the right operand and returns .T. (true) if the value of the left operand is contained in the value of the right operand, otherwise .F. (false) is returned.


y creo que es EXACTAMENTE lo que buscas. Aparentemente Harbour no lo soporta, al menos en la version Devel 1.1 que es la que bajé de Fivetech.

Un saludo,

Carlos.
FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
User avatar
goosfancito
 
Posts: 1954
Joined: Fri Oct 07, 2005 7:08 pm


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 90 guests