GET Convertir a Mayusc o Minusc (RESUELTO)
Posted: Thu Oct 20, 2016 5:18 pm
Buenos Dias Amigos del Foro:
Para modificar Datos ...
Alguna vez vuestros usuarios les han pedido el poder convertir un texto ya escrito
hacia Mayusculas o Minusculas en un campo Get sin tener que reescribir??
Prueben así ...
en su copia TGET.PRG que enlazan con sus programas ...
busquen ...
METHOD KeyChar( nKey, nFlags ) CLASS TGet
... declaren
LOCAL mivar1
... busquen las lineas de codigo
case nKey >= 32 .and. nKey < 256
...
...
if ::oGet:Type == "N" .and. ;
( Chr( nKey ) == "." .or. Chr( nKey ) == "," )
if ::oGet:Clear()
#ifndef __XHARBOUR__
::oGet:DelEnd()
#endif
endif
::oGet:ToDecPos()
... inserten el siguiente código
elseif ::oGet:Type == "C" .AND. Chr( nKey ) == "+"
mivar1=::oGet:buffer
IF LEN(ALLTRIM(mivar1))>0
mivar1=UPPER(mivar1)
::oGet:VarPut( mivar1 )
::Refresh()
ENDI
elseif ::oGet:Type == "C" .AND. Chr( nKey ) == "-"
mivar1=::oGet:buffer
IF LEN(ALLTRIM(mivar1))>0
mivar1=LOWER(mivar1)
::oGet:VarPut( mivar1 )
::Refresh()
ENDI
Graben su copia TGET.PRG enlacen y prueben
su comportamiento
** ahora puede convertir texto en campo GET activo
pulsa + y convierte a mayusculas
pulsa - y convierte a minusculas
Espero les sirva
Saludos
Julio César Gómez Cortéz
Godryc Experiencias
Lima Perú
Para modificar Datos ...
Alguna vez vuestros usuarios les han pedido el poder convertir un texto ya escrito
hacia Mayusculas o Minusculas en un campo Get sin tener que reescribir??
Prueben así ...
en su copia TGET.PRG que enlazan con sus programas ...
busquen ...
METHOD KeyChar( nKey, nFlags ) CLASS TGet
... declaren
LOCAL mivar1
... busquen las lineas de codigo
case nKey >= 32 .and. nKey < 256
...
...
if ::oGet:Type == "N" .and. ;
( Chr( nKey ) == "." .or. Chr( nKey ) == "," )
if ::oGet:Clear()
#ifndef __XHARBOUR__
::oGet:DelEnd()
#endif
endif
::oGet:ToDecPos()
... inserten el siguiente código
elseif ::oGet:Type == "C" .AND. Chr( nKey ) == "+"
mivar1=::oGet:buffer
IF LEN(ALLTRIM(mivar1))>0
mivar1=UPPER(mivar1)
::oGet:VarPut( mivar1 )
::Refresh()
ENDI
elseif ::oGet:Type == "C" .AND. Chr( nKey ) == "-"
mivar1=::oGet:buffer
IF LEN(ALLTRIM(mivar1))>0
mivar1=LOWER(mivar1)
::oGet:VarPut( mivar1 )
::Refresh()
ENDI
Graben su copia TGET.PRG enlacen y prueben
su comportamiento
** ahora puede convertir texto en campo GET activo
pulsa + y convierte a mayusculas
pulsa - y convierte a minusculas
Espero les sirva
Saludos
Julio César Gómez Cortéz
Godryc Experiencias
Lima Perú