oziel Posted August 10, 2012 Report Share Posted August 10, 2012 Senhores: Estou com um problema na pesquisa no GET, quando fecho o Browse, dar o erro abaixo. Vejam o programa e as funçoes. //----------------------------------------------- #include "TsButton.ch" #include "Tcbrowse.ch" #include "Corget.ch" #include "BtnGet.ch" ........................ FUNCTION GetCadNovo( lAppend ) ........................ REDEFINE GET oG22 VAR cNomeFor ID 30 OF oDlg ; Valid (PesqFor(nCodfor,cNomeFor) ........................ ACTIVATE DIALOG oDlg CENTERED RETURN NIL //------------------------------------------------------------------------ FUNCTION PesqFor(nCodfor,cNomeFor) LOCAL oDlg, oLbx // Objetos Caixa de Dialogo LOCAL oFnt, oG120 // Abrir Base Dados --------------------------------------------------- Select CadFor Set Index to CadFor Set Order to 2 DbGoTop() DEFINE FONT oFnt NAME "Arial" SIZE 0, -10 // Caixa de Dialogo --------------------------------------------------- oNome = Space(20) DEFINE DIALOG oDlg RESOURCE "BROWSEFOR" TITLE "SICEW - Cadastro de Fornecedores." CursorWait() REDEFINE LISTBOX oLbx FIELDS Transf(CadFor->CODF , "9999") , ; CadFor->Nome , ; CadFor->CITY , ; CadFor->EST ; HEADERS "Codigo"," Fornecedor "," Cidade ","Est" ; FIELDSIZES 30, 250, 150, 20 ; COLOR CLR_BLACK, CLR_VDCL1 ; FONT oFnt ; ID 101 ; OF oDlg ; ON DBLCLICK(PesqFor2(nCodFor,cNomeFor), oLbx:Refresh()) REDEFINE BTNBMP RESOURCE "BTNEXIT" ID 109 OF oDlg ; ACTION( oDlg:Update(), oDlg:End() ) ; TOOLTIP OemToAnsi( "Voltar ao Menu Principal" ) ; NOBORDER ACTIVATE DIALOG oDlg CENTERED RELEASE oFnt RETURN NIL //------------------------------------------------------------- Static Function PesqFor2(nCodf,cNomeFor) local cNome := Space( 30 ) local nRecNo := RecNo() SET SOFTSEEK ON Select CadFor SET ORDER TO 2 Goto top If MsgGet( "Procurar", " Nome do Fornecedor ", @cNome, ; ".\bmp\lupa.bmp" ) If ! CadFor->(DbSeek( alltrim(upper(cNome)) )) MsgAlert( "Cadstro Não encontrado! ","Informa‡ao" ) SET ORDER TO 2 Goto top GO nRecNo Endif nCodFor = CadFor->Codf cNomeFor = CadFor->Nome Endif Return Nil //---------------------------------------------------------------- Erro na saida. Error description: Error BASE/1066 Argument error: conditional Args: [ 1] = U Stack Calls =========== Called from: TGET.PRG => CORGET:LVALID(0) Called from: CONTROL.PRG => CORGET:FWLOSTFOCUS(0) https://skydrive.live.com/?sc=documents&cid=c7aa5a53b531c1ae#cid=C7AA5A53B531C1AE&id=C7AA5A53B531C1AE!125&sc=documents OZIEL LOPES FW 22c - Clipper 5.3b - Workshop 4.0 FWH 6.12 Free - xHarbour 0.99.71 Simplex - BCC55 - Pelles C - xDev. Editado por - oziel on 16/08/2012 16:10:49 Quote Link to comment Share on other sites More sharing options...
oziel Posted August 10, 2012 Author Report Share Posted August 10, 2012 Senhores: Estou com um problema na pesquisa no GET, quando fecho o Browse, dar o erro abaixo. Vejam o programa e as funçoes. //----------------------------------------------- #include "TsButton.ch" #include "Tcbrowse.ch" #include "Corget.ch" #include "BtnGet.ch" ........................ FUNCTION GetCadNovo( lAppend ) ........................ REDEFINE GET oG22 VAR cNomeFor ID 30 OF oDlg ; Valid (PesqFor(nCodfor,cNomeFor) ........................ ACTIVATE DIALOG oDlg CENTERED RETURN NIL //------------------------------------------------------------------------ FUNCTION PesqFor(nCodfor,cNomeFor) LOCAL oDlg, oLbx // Objetos Caixa de Dialogo LOCAL oFnt, oG120 // Abrir Base Dados --------------------------------------------------- Select CadFor Set Index to CadFor Set Order to 2 DbGoTop() DEFINE FONT oFnt NAME "Arial" SIZE 0, -10 // Caixa de Dialogo --------------------------------------------------- oNome = Space(20) DEFINE DIALOG oDlg RESOURCE "BROWSEFOR" TITLE "SICEW - Cadastro de Fornecedores." CursorWait() REDEFINE LISTBOX oLbx FIELDS Transf(CadFor->CODF , "9999") , ; CadFor->Nome , ; CadFor->CITY , ; CadFor->EST ; HEADERS "Codigo"," Fornecedor "," Cidade ","Est" ; FIELDSIZES 30, 250, 150, 20 ; COLOR CLR_BLACK, CLR_VDCL1 ; FONT oFnt ; ID 101 ; OF oDlg ; ON DBLCLICK(PesqFor2(nCodFor,cNomeFor), oLbx:Refresh()) REDEFINE BTNBMP RESOURCE "BTNEXIT" ID 109 OF oDlg ; ACTION( oDlg:Update(), oDlg:End() ) ; TOOLTIP OemToAnsi( "Voltar ao Menu Principal" ) ; NOBORDER ACTIVATE DIALOG oDlg CENTERED RELEASE oFnt RETURN NIL //------------------------------------------------------------- Static Function PesqFor2(nCodf,cNomeFor) local cNome := Space( 30 ) local nRecNo := RecNo() SET SOFTSEEK ON Select CadFor SET ORDER TO 2 Goto top If MsgGet( "Procurar", " Nome do Fornecedor ", @cNome, ; ".\bmp\lupa.bmp" ) If ! CadFor->(DbSeek( alltrim(upper(cNome)) )) MsgAlert( "Cadstro Não encontrado! ","Informa‡ao" ) SET ORDER TO 2 Goto top GO nRecNo Endif nCodFor = CadFor->Codf cNomeFor = CadFor->Nome Endif Return Nil //---------------------------------------------------------------- Erro na saida. Error description: Error BASE/1066 Argument error: conditional Args: [ 1] = U Stack Calls =========== Called from: TGET.PRG => CORGET:LVALID(0) Called from: CONTROL.PRG => CORGET:FWLOSTFOCUS(0) https://skydrive.live.com/?sc=documents&cid=c7aa5a53b531c1ae#cid=C7AA5A53B531C1AE&id=C7AA5A53B531C1AE!125&sc=documents OZIEL LOPES FW 22c - Clipper 5.3b - Workshop 4.0 FWH 6.12 Free - xHarbour 0.99.71 Simplex - BCC55 - Pelles C - xDev. Editado por - oziel on 16/08/2012 16:10:49 Quote Link to comment Share on other sites More sharing options...
atnsoft Posted August 10, 2012 Report Share Posted August 10, 2012 Os retornos das funcoes em valid devem ser: .t. ou .f. Assim: Static Function PesqFor2(nCodf,cNomeFor) local cNome := Space( 30 ) local nRecNo := RecNo() SET SOFTSEEK ON Select CadFor SET ORDER TO 2 Goto top If MsgGet( "Procurar", " Nome do Fornecedor ", @cNome, ; ".\bmp\lupa.bmp" ) If ! CadFor->(DbSeek( alltrim(upper(cNome)) )) MsgAlert( "Cadstro Não encontrado! ","Informa‡ao" ) SET ORDER TO 2 Goto top GO nRecNo Return(.F.) Endif nCodFor = CadFor->Codf cNomeFor = CadFor->Nome Endif Return(.T.) id=code>id=code>AtnSoft(Antenor Rabello) - xHarbour 0.99.71 / FwH 7.05 / Verce C. Procópio - PR Quote Link to comment Share on other sites More sharing options...
kapiaba Posted August 10, 2012 Report Share Posted August 10, 2012 REDEFINE BTNBMP RESOURCE "BTNEXIT" ID 109 OF oDlg ; ACTION( oDlg:Update(), oDlg:End() ) ; TOOLTIP OemToAnsi( "Voltar ao Menu Principal" ) ; NOBORDER Porque você dá uma odlg:update() na saida de um dialogo? E um CursorWait() em cima de uma ListBox?? Entendo que o CursorWait() fica em um looping eterno e isto consome recursos. abs, João Santos - São Paulo. joao@pleno.com.br Fone: (11) 3106-2832 / 5150-7341 - TIM https://www.facebook.com/kapiaba FWH 2.7 - xHARBOUR WorkShop.Exe Editado por - kapiaba on 10/08/2012 11:45:48 Quote Link to comment Share on other sites More sharing options...
oziel Posted August 10, 2012 Author Report Share Posted August 10, 2012 Fiz as altrações do Return (.f.) e Return (.T.) e desativei o o CursorWait() mas o problema ainda continua quanto dou ESC no Browse ou Exit. - Sugeridas por ATNSOFT E KAIPABA. Error description: Error BASE/1066 Argument error: conditional Args: [ 1] = U Stack Calls =========== Called from: TGET.PRG => CORGET:LVALID(0) Called from: CONTROL.PRG => CORGET:FWLOSTFOCUS(0) https://skydrive.live.com/?sc=documents&cid=c7aa5a53b531c1ae#cid=C7AA5A53B531C1AE&id=C7AA5A53B531C1AE!125&sc=documents OZIEL LOPES FW 22c - Clipper 5.3b - Workshop 4.0 FWH 6.12 Free - xHarbour 0.99.71 Simplex - BCC55 - Pelles C - xDev. Quote Link to comment Share on other sites More sharing options...
kapiaba Posted August 10, 2012 Report Share Posted August 10, 2012 Mostre: (PesqFor2(nCodFor,cNomeFor), oLbx:Refresh()) João Santos - São Paulo. joao@pleno.com.br Fone: (11) 3106-2832 / 5150-7341 - TIM https://www.facebook.com/kapiaba FWH 2.7 - xHARBOUR WorkShop.Exe Quote Link to comment Share on other sites More sharing options...
kapiaba Posted August 10, 2012 Report Share Posted August 10, 2012 "BROWSEFOR" é uma TCBROWSE mesmo? Verifique. abs João Santos - São Paulo. joao@pleno.com.br Fone: (11) 3106-2832 / 5150-7341 - TIM https://www.facebook.com/kapiaba FWH 2.7 - xHARBOUR WorkShop.Exe Quote Link to comment Share on other sites More sharing options...
kapiaba Posted August 10, 2012 Report Share Posted August 10, 2012 REDEFINE BTNBMP RESOURCE "BTNEXIT" ID 109 OF oDlg ; ACTION( oDlg:Update(), oDlg:End() ) ; TOOLTIP OemToAnsi( "Voltar ao Menu Principal" ) ; NOBORDER id=code>id=code>Toque por BUTTONBMP e teste, coloque o CANCEL João Santos - São Paulo. joao@pleno.com.br Fone: (11) 3106-2832 / 5150-7341 - TIM https://www.facebook.com/kapiaba FWH 2.7 - xHARBOUR WorkShop.Exe Quote Link to comment Share on other sites More sharing options...
atnsoft Posted August 10, 2012 Report Share Posted August 10, 2012 FUNCTION GetCadNovo( lAppend ) Veja se esta funçao tambem nao vem de um valid. Note que o parametro é lógico. (.t., .f.) Tente mudar isso: ACTIVATE DIALOG oDlg CENTERED RETURN NIL ---> para Return(.T.) AtnSoft(Antenor Rabello) - xHarbour 0.99.71 / FwH 7.05 / Verce C. Procópio - PR Quote Link to comment Share on other sites More sharing options...
oziel Posted August 13, 2012 Author Report Share Posted August 13, 2012 Fiz uma alteração na PesqFor(nCodfor,cNomeFor) de Return Nil -> para Return .T. e não deu o erro - agora vou ver se as variáver estão atualizadas... Obrigado... https://skydrive.live.com/?sc=documents&cid=c7aa5a53b531c1ae#cid=C7AA5A53B531C1AE&id=C7AA5A53B531C1AE!125&sc=documents OZIEL LOPES FW 22c - Clipper 5.3b - Workshop 4.0 FWH 6.12 Free - xHarbour 0.99.71 Simplex - BCC55 - Pelles C - xDev. Quote Link to comment Share on other sites More sharing options...
oziel Posted August 16, 2012 Author Report Share Posted August 16, 2012 Ok. Fiz várias alterações e os Gets estão atualizando - Tudo ok.. Obrigado mais uma vez https://skydrive.live.com/?sc=documents&cid=c7aa5a53b531c1ae#cid=C7AA5A53B531C1AE&id=C7AA5A53B531C1AE!125&sc=documents OZIEL LOPES FW 22c - Clipper 5.3b - Workshop 4.0 FWH 6.12 Free - xHarbour 0.99.71 Simplex - BCC55 - Pelles C - xDev. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.