Page 1 of 1
if ... in ...
Posted: Mon Dec 01, 2008 8:26 pm
by goosfancito
Hola.
Existe algo asi?
Code: Select all
if lastkey in [ VK_RETURN, VK_... ] then
msginfo("paso de campo")
endif
No se si me explique lo que quiero hacer?
Gracias.
Posted: Tue Dec 02, 2008 11:11 am
by karinha
Code: Select all
LOCAL nKey
Do Case
Case nKey == VK_RETURN .OR. GetKeyState( VK_ESCAPE )
... Mensagem ...
EndCase
Posted: Tue Dec 02, 2008 11:26 am
by goosfancito
Karhina,
Queria trabajar similar a cuando lo haces utilizando conjuntos en C,
Gracias de todos modos.
ç
karinha wrote:Code: Select all
LOCAL nKey
Do Case
Case nKey == VK_RETURN .OR. GetKeyState( VK_ESCAPE )
... Mensagem ...
EndCase
Re: if ... in ...
Posted: Tue Dec 02, 2008 12:46 pm
by pymsoft
goosfancito wrote:Hola.
Existe algo asi?
Code: Select all
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
if ASCAN( lastkey, { VK_RETURN, VK_... } ) != 0
msginfo("paso de campo")
endif
saludos
Re: if ... in ...
Posted: Tue Dec 02, 2008 1:23 pm
by goosfancito
Andubo. gracias. Cambiando a ) == 0
pymsoft wrote:goosfancito wrote:Hola.
Existe algo asi?
Code: Select all
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
if ASCAN( lastkey, { VK_RETURN, VK_... } ) != 0
msginfo("paso de campo")
endif
saludos
Posted: Tue Dec 02, 2008 3:53 pm
by pymsoft
bien
![Smile :-)](./images/smilies/icon_smile.gif)
Re: if ... in ...
Posted: Tue Dec 02, 2008 9:10 pm
by Carlos Mora
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
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.
Re: if ... in ...
Posted: Wed Dec 03, 2008 9:24 am
by goosfancito
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
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.