FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour if ... in ...
Posts: 1956
Joined: Fri Oct 07, 2005 07:08 PM
if ... in ...
Posted: Mon Dec 01, 2008 08:26 PM
Hola.

Existe algo asi?

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/
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
if ... in ...
Posted: Tue Dec 02, 2008 11:11 AM
    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
Posts: 1956
Joined: Fri Oct 07, 2005 07:08 PM
if ... in ...
Posted: 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:
    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/
Posts: 383
Joined: Tue Oct 11, 2005 01:01 PM
Re: if ... in ...
Posted: Tue Dec 02, 2008 12:46 PM
goosfancito wrote:Hola.

Existe algo asi?

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:


if ASCAN( lastkey, { VK_RETURN, VK_... } ) != 0
   msginfo("paso de campo")
endif



saludos
Pedro Gonzalez
Posts: 1956
Joined: Fri Oct 07, 2005 07:08 PM
Re: if ... in ...
Posted: Tue Dec 02, 2008 01:23 PM
Andubo. gracias. Cambiando a ) == 0


pymsoft wrote:
goosfancito wrote:Hola.

Existe algo asi?

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:


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/
Posts: 383
Joined: Tue Oct 11, 2005 01:01 PM
if ... in ...
Posted: Tue Dec 02, 2008 03:53 PM

bien :-)

Pedro Gonzalez
Posts: 989
Joined: Thu Nov 24, 2005 03:01 PM
Re: if ... in ...
Posted: Tue Dec 02, 2008 09: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
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"
Posts: 1956
Joined: Fri Oct 07, 2005 07:08 PM
Re: if ... in ...
Posted: Wed Dec 03, 2008 09: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
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/

Continue the discussion