A little help please - Una pequeña ayuda por favor

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
Jose Marte2
Posts: 45
Joined: Thu Nov 16, 2017 2:19 pm
Location: República Dominicana

A little help please - Una pequeña ayuda por favor

#1 Post by Jose Marte2 »

Greetings, I hope you are all well.

Sorry, but I would like to see if you can explain or help me with the following situation

I have a small program to read barcode

the situation is that when I pass the article with the bar code in the field where that information is read if the code in question does not exist after validating the field, the cursor stays at the end of the field and does not return to the beginning of the field.

if anyone could please lend me your help

thanks in advance

I attach the part of the code where I validate the field that reads the bar code and the screens

Español


Saludos, espero que esten todos bien.

Perdon, pero quisiera ver si me pueden explicar o ayudarme con la siguiente situacion

tengo un pequeño programa para leer codigo de barras

la situacion es que cuando paso el articulo con el codigo de barra en el campo donde se lee esa informacion si el codigo en cuestion no existe despues de validar el campo, el cursor se queda a final del campo y no vuelve al inicio del mismo.

si alguien pudiera por favor, prestarme su ayuda

las gracias anticipadas

adjunto la parte del codigo donde valido el campo que lee el codigo de barra y las pantallas

DBSelectArea("INVFILEH")
Set Order To 1
If DBSeek(cRepCod)
// submit item information - Presentar informacion del articulo
Else
DC_WinAlert("CODIGO DE ARTICULO NO EXISTE EN ARCHIVO DE INVENTARIO"+Chr(10)+"... PULSE ENTER, ESC O CLICK
[Ok] PARA CONTINUAR ...")
DC_GetRefresh( GetList )
cRepCod := Space(15)
Return .f.
ENDIF
Attachments
Pantalla Despues del aviso que el articulo no existe.jpg
Pantalla Despues del aviso que el articulo no existe.jpg (192.09 KiB) Viewed 12612 times
Pantalla Limpia.jpg
Pantalla Limpia.jpg (169.71 KiB) Viewed 12612 times
José Marte
Software & Servicios


mzipkin
Posts: 15
Joined: Thu May 13, 2010 8:27 pm

Re: A little help please - Una pequeña ayuda por favor

#2 Post by mzipkin »

Hola Jose,

When your barcode validation/lookup fails, try something like this:

oGet := dc_getactive()
oGet:xbpsle:clear()
oGet:refresh()

...this assumes your sample code is is called from the "valid" codeblock for the cRepcode input.

Let us know what happens.

Regards,

Mark

User avatar
Jose Marte2
Posts: 45
Joined: Thu Nov 16, 2017 2:19 pm
Location: República Dominicana

Re: A little help please - Una pequeña ayuda por favor

#3 Post by Jose Marte2 »

Greetings mr. Thanks for taking some of your valuable time to answer, excuse me, but I am new to this I have a system that works well in clipper and now I am doing some things with the express library to slowly make the change.

With this program, I am taking my first steps

since it is a simple thing a single field to read a barcode, look for it in the inventory database and if there is present certain information and if not present the message that does not exist, everything works well, only that the cursor in the field after presenting the notice, it does not return to the beginning and that makes the program operation difficult.

attached with more details how do I read the field and where do I validate it

excuse me but I didn't understand the part of your answer that says

.. this assumes that your sample code is called from the "valid" code block for the cRepcode entry.


Español
Saludos sr. gracias por tomarse un poco de su valioso tiempo para contestar, perdone, pero soy nuevo en esto tengo un sistema que funciona bien en clipper y ahora es que estoy haciendo algunas cosas con la libreria express para despacio ir haciendo el cambio.

con este programa es que estoy dando mis primeros pasos

ya que es algo simple un solo campo para leer un codigo de barra, buscarlo en la base de datos de inventario y si existe presentar cierta informacion y si no presentar el mensaje que no existe, todo funciona bien, solo que el cursor en el campo despues de presentar el aviso no vuelve al inicio y eso dificulta la operacion del programa.

adjunto con mas detalles como hago la lectura del campo y donde hago la validacion del mismo

me disculpa pero no entendi la parte de su repuesta que dice

.. esto supone que su código de muestra se llama desde el bloque de código "válido" para la entrada de cRepcode.


@ 02,02 DCSAY {|| ' CODIGO:' } SAYSIZE 30 COLOR {0,0,0},XBPSYSCLR_TRANSPARENT
@ 03,01 DCSAY {|| REPLICATE(CHR(95),139) } COLOR {101,147,207},XBPSYSCLR_TRANSPARENT
@ 04,02 DCSAY {|| 'REFERENCIA:'} SAYSIZE 30 COLOR {0,0,0},XBPSYSCLR_TRANSPARENT

@ 02,16 DCGET cRepCod GETFONT '15.Tahoma Bold' PICTURE "@!" POPUP {|c| ConsultaArticulos(@cCodArt) } POPKEY
xbeK_F3 POPTOOLTIP "F3 Consultar Articulos" ;
LostFocus {||DC_GetRefresh(GetList)} GETID "INICIO" Valid {|c| ValidarCampo(1,GetList) }
When {||lEsCodigo}

STATIC FUNCTION ValidarCampo(oCaso,GetList)
LOCAL lRetVal := .t.
DO CASE
CASE oCaso == 1
DBSelectArea("INVFILEH")
Set Order To 1
If DBSeek(cRepCod)
ELSE
DC_WinAlert("CODIGO DE ARTICULO NO EXISTE EN ARCHIVO DE INVENTARIO"+Chr(10)+"... PULSE ENTER,
ESC O CLICK [Ok] PARA CONTINUAR ...")
DC_GetRefresh( GetList )
cRepCod := Space(15)
Return .f.
ENDIF
ENDCASE
RETURN lRetVal


//DCSETPARENT TO

DC_SETKEYACTIVE(.T.)
DCGETOPTIONS ;
SAYFONT '9.Courier' ;
SAYWIDTH 0 ;
HILITEGETS GraMakeRGBColor(mcColorCampo) ;
COLORGETS { { GraMakeRGBColor({0,0,0}), GraMakeRGBColor(aBackColorGet) } } ;
TABSTOP ;
NOMAXBUTTON;
COLOR {214,223,247} ;
ICON 2002 NOCONFIRM

DCREAD GUI OPTIONS ;
GetOptions PARENT oVentanaDatos ;
SAVE PARENT oVentanaDatos HANDLER PreciosTeclasAplicadas SETFOCUS "INICIO";
EVAL {|o| DC_GetRefresh(GetList) }

IF LASTKEY() == 27 .OR. dinultkey == 27
EXIT
ENDIF


It is the same as in clipper and it worked well for me

thanks in advance

es lo mismo que hacia en clipper y me funcionaba bien

las gracias anticipadas
José Marte
Software & Servicios


mzipkin
Posts: 15
Joined: Thu May 13, 2010 8:27 pm

Re: A little help please - Una pequeña ayuda por favor

#4 Post by mzipkin »

Hola Jose,

In your ValidarCampo function, try adding the commented lines below which reference oGet.

Regards,

Mark



STATIC FUNCTION ValidarCampo(oCaso,GetList)
LOCAL lRetVal := .t.
LOCAL oGet // Add line
DO CASE
CASE oCaso == 1
DBSelectArea("INVFILEH")
Set Order To 1
If DBSeek(cRepCod)
ELSE

oGet := dc_getactive() // locate the active GET object
oGet:xbpsle:clear() // clear the internal buffer
oGet:refresh() // re-display

DC_WinAlert("CODIGO DE ARTICULO NO EXISTE EN ARCHIVO DE INVENTARIO"+Chr(10)+"... PULSE ENTER,
ESC O CLICK [Ok] PARA CONTINUAR ...")
DC_GetRefresh( GetList )
cRepCod := Space(15)
Return .f.
ENDIF
ENDCASE
RETURN lRetVal

User avatar
Jose Marte2
Posts: 45
Joined: Thu Nov 16, 2017 2:19 pm
Location: República Dominicana

Re: A little help please - Una pequeña ayuda por favor

#5 Post by Jose Marte2 »

Greetings, sir, thanks again for your attention,

an error comes out

I attach screen

thanks in advance

forgive so much inconvenience

Saludos, Sr. las gracias nuevamente por sus atenciones,

sale un error

le adjunto pantalla

las gracias anticipadas

perdone tantas molestias
Attachments
Untitled.jpg
Untitled.jpg (201.32 KiB) Viewed 12540 times
José Marte
Software & Servicios


User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: A little help please - Una pequeña ayuda por favor

#6 Post by rdonnay »

Try changing this:

oGet:refresh() // re-display

to this:

DC_GetRefresh(oGet)
The eXpress train is coming - and it has more cars.


User avatar
PedroAlex
Posts: 229
Joined: Tue Feb 09, 2010 3:06 am

Re: A little help please - Una pequeña ayuda por favor

#8 Post by PedroAlex »

Here is a sample code to demonstrate that problem.
Anexed complete files ready to compile

Code: Select all

#include "dcdialog.ch"

//=================================================
Procedure APPSYS
RETURN
//=================================================

//----------------------------------------------
FUNCTION Main()
LOCAL GetList[0], GetOptions

PUBLIC cCampo4 := space(50)


  //=================================>>>>>>>>>>>>>  UnRemark This

DC_XbpGetSetInputFocusBlock(;
    {|x,y,o| IIF(o:isGetDataOnLostFocus,o:getData(),nil), ;
        IIF(!Empty(o:get:buffer),o:get:pos := o:savePos,nil), ;
        o:DateFlag := .T., ;
        o:home(), ;
        DC_HiliteGets(o,1,o:getList:getOptions[nGETOPT_HILITECOLOR]), ;
        DC_ColorGets(o,1,o:getList:getOptions[aGETOPT_COLORGETS]), ;
        DC_PopupButtonShow(o,.t.)})

DC_XbpGetKillInputFocusBlock(;
    {|x,y,o| o:savePos := o:get:pos, ;
        o:DateFlag := .T., ;
        IIF(o:isGetDataOnLostFocus,o:getData(),nil), ;
        IIF(o:isGetDataOnLostFocus,o:setData(),nil), ;
        o:Home(), ;
        DC_HiliteGets(o,2,o:getList:getOptions[nGETOPT_HILITECOLOR]), ;
        DC_ColorGets(o,2,o:getList:getOptions[aGETOPT_COLORGETS]), ;
        DC_PopupButtonShow(o,.f.)})

 // =================================>>>>>>>>>>>>>  UnRemark This

@ 0,0 DcTabpage TABPAGE1 Caption '1' size 85,23 preoffset 0 postoffset 87  FONT '10.Arial Bold'

@ 1.5,1  dcgroup POS caption 'Product Select' size 80,20 parent TABPAGE1 COLOR NIL,0

@ 2,01 dcsay '      Code' get cCampo4 GETSIZE 40,1  Valid {|| Testa(GetList) } Parent POS GETSIZE 40,1

DCGETOPTIONS SAYFONT '10.Arial Bold' NOMAXBUTTON NOMINBUTTON BUTTONALIGN DCGUI_BUTTONALIGN_CENTER NORESIZE SAYRIGHT;
HILITEGETS { GRA_CLR_WHITE, GRA_CLR_DARKBLUE } ;
COLORGETS { { GRA_CLR_WHITE, GRA_CLR_DARKBLUE } }

DCREAD GUI ;
TITLE 'Test DcSayGet Color and Position ' ;
FIT ;
OPTIONS GetOptions ;
ADDBUTTONS

RETURN nil

Function testa(GetList)

	MsgBox('Register Not Found','Atention!')
	cCampo4:=Space(50)

	//oGet := dc_getactive() // locate the active GET object
	//oGet:xbpsle:clear() // clear the internal buffer
	//oGet:refresh() // re-display
	//DC_GetRefresh(oGet)

	Dc_Getrefresh(GetList)
	Return .f.

Return .t.
Attachments
Teste_2026.rar
(13.9 KiB) Downloaded 540 times
Pedro Alexandre

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: A little help please - Una pequeña ayuda por favor

#9 Post by rdonnay »

This works for me:

Code: Select all

@ 0,0 DcTabpage TABPAGE1 Caption '1' size 85,23 preoffset 0 postoffset 87  FONT '10.Arial Bold'

@ 1.5,1  dcgroup POS caption 'Product Select' size 80,20 parent TABPAGE1 COLOR NIL,0

@ 2,01 dcsay '      Code' get cCampo4 GETSIZE 40,1  Valid {|oGet| Testa(oGet,GetList) } Parent POS GETSIZE 40,1

DCGETOPTIONS SAYFONT '10.Arial Bold' NOMAXBUTTON NOMINBUTTON BUTTONALIGN DCGUI_BUTTONALIGN_CENTER NORESIZE SAYRIGHT;
HILITEGETS { GRA_CLR_WHITE, GRA_CLR_DARKBLUE } ;
COLORGETS { { GRA_CLR_WHITE, GRA_CLR_DARKBLUE } }

DCREAD GUI ;
TITLE 'Test DcSayGet Color and Position ' ;
FIT ;
OPTIONS GetOptions ;
ADDBUTTONS

RETURN nil

Function testa(oGet, GetList)

   MsgBox('Register Not Found','Atention!')
   cCampo4:=Space(50)

   oGet:xbpsle:clear() // clear the internal buffer
   oGet:refresh() // re-display
   oGet:home()

   Dc_Getrefresh(GetList)
   Return .f.

Return .t.
The eXpress train is coming - and it has more cars.

User avatar
PedroAlex
Posts: 229
Joined: Tue Feb 09, 2010 3:06 am

Re: A little help please - Una pequeña ayuda por favor

#10 Post by PedroAlex »

Roger,

It works perfect !

Many thanks..
Pedro Alexandre

Post Reply