Luiz Arruda (ICO) Posted May 11, 2005 Report Share Posted May 11, 2005 Bom dia a todos, é a primeira vez que participo do forum apesar de ja ter usado muitas dicas dele, estou mudando meus programas para FiveWin, criei no Ws uma dialog com os campos data, historico, valor, gostaria de saber como faço para usar estes campos para digitação e registra-los no arquivo de nome diario.dbf que comtem os mesmos campos. Obrigado. Quote Link to comment Share on other sites More sharing options...
pauloaraujo Posted May 11, 2005 Report Share Posted May 11, 2005 Ico, Segue um exemplo em que voce cria BUTTON para gravar o que foi digitado. function EditTrans( oLbx , lInclui , lAltera , lConsulta , lExclui ) PRIV oDlg,oFld PRIV nOldRec := RecNo() IF lInclui INICVA02() && inicializa variaveis para inclusao ELSE if lExclui .or. lAltera if .not. crlock() DO MENSAGEM WITH 7 return nil endif endif VARTRANS() && inicializa variaveis para alteração ENDIF SELE 2 DO WHIL .T. lSalva = .f. lDel = .f. lAnterior = .f. lProximo = .f. DEFINE DIALOG oDlg FROM 0, 0 TO 505, 800 ; TITLE If( lInclui, "Incluir Transportador", "Modificar Transportador" ) ; PIXEL FONT wfonte_FixedSys @ 01,01 SAY "Codigo :" SIZE 048,08 OF oDlg @ 01,13 GET TRANSCOD2 PICTURE "999" SIZE 16,11 OF oDlg VALID PESQTRANS() ; WHEN lInclui @ 03,01 SAY "Nome :" SIZE 048,08 OF oDlg @ 03,13 GET TRANSDESC2 PICT "@!" OF oDlg SIZE 124,11 ; WHEN lInclui .OR. lAltera @ 03,59 SAY "Data Cad.:" SIZE 040,08 OF oDlg @ 03,70 GET DATACAD2 OF oDlg SIZE 044,11 ; WHEN lInclui .OR. lAltera DO CASE CASE lInclui .or. lAltera @ 20,02 BUTTON "&Gravar" OF oDlg SIZE 60, 09 ; ACTION ( lSalva:=.t. , lDel:=.f. , oDlg:End() ) @ 20,18 BUTTON "&Sair" OF oDlg SIZE 60, 09 ; ACTION ( lSalva:=.f. , lDel:=.f. , oDlg:End() ) CASE lConsulta @ 20,02 BUTTON "&Sair" OF oDlg SIZE 60, 09 ; ACTION ( lSalva:=.f. , lDel:=.f. , oDlg:End() ) @ 20,18 BUTTON "&Anterior" OF oDlg SIZE 60, 09 ; ACTION ( lAnterior:=.T. , lProximo:=.f. , oDlg:End() ) @ 20,34 BUTTON "&Proximo" OF oDlg SIZE 60, 09 ; ACTION ( lAnterior:=.f. , lProximo:=.T. , oDlg:End() ) CASE lExclui @ 20,02 BUTTON "&Sair" OF oDlg SIZE 60, 09 ; ACTION ( lSalva:=.f. , lDel:=.f. , oDlg:End() ) @ 20,18 BUTTON "&Excluir" OF oDlg SIZE 60, 09 ; ACTION ( lSalva:=.f. , lDel:=.t. , oDlg:End() ) ENDCASE ACTIVATE DIALOG oDlg CENTERED do case case GETASYNCKEY(27) SELE 2 DBGOTO(nOldRec) EXIT case lAnterior SELE 2 SET ORDER TO WORD__PRINC DBSKIP(-1) DO VARTRANS nOldRec := RecNo() LOOP case lProximo SELE 2 SET ORDER TO WORD__PRINC DBSKIP() IF EOF() DBSKIP(-1) ENDIF DO VARTRANS nOldRec := RecNo() LOOP case lSalva IF .NOT. PGDNTRANS() LOOP ELSE IF .NOT. REPLTRANS( lInclui ) LOOP ELSE EXIT ENDIF ENDIF case lDel IF .NOT. PEXCTRANS() DO MENSAGEM WITH 28 LOOP ELSE DELE DBCOMMIT() EXIT ENDIF othe SELE 2 DBGOTO(nOldRec) EXIT endcase ENDDO UNLOCK ALL RETU NIL FUNC REPLTRANS IF lInclui SELE 2 SET ORDER TO WIX01 SEEK TRANSCOD2 IF.NOT.EOF() DO MENSAGEM WITH 16 SET ORDER TO WORD__PRINC RETU .F. ELSE IF.NOT.ADDREC() DO MENSAGEM WITH 6 SET ORDER TO WORD__PRINC RETU.F. ENDIF ENDIF ENDIF REPL DATACAD WITH DATACAD2,; TRANSCOD WITH TRANSCOD2,; TRANSDESCR WITH TRANSDESC2 SELE 2 DBCOMMIT() SET ORDER TO WORD__PRINC RETU.T. Paulo/CONTATO SISTEMAS Clipper53b / FW26 / Blinker70 Quote Link to comment Share on other sites More sharing options...
siscat Posted May 11, 2005 Report Share Posted May 11, 2005 seja bem vindo... para atribuir uma variavel a um campo no FW voce faz exatamente da mesma forma que faria com Clipper... FIELD->NOME_CAMPO := <_variavel_> voce deve executar os mesmos passos... para inclusao.. append blank travar o registro gravar o registro destravar o resgistro.. Marllon Figueiredo Analista de Sistemas ERP/CRM Porto Alegre - RS siscatsoftware@hotmail.com FWH,(x)Harbour,xMate,Bcc,Clipper,Blinker,Exospace,MySQL,MsSQL,Oracle,Postgres,TopConn,ADS,SQLLib Quote Link to comment Share on other sites More sharing options...
eajunior Posted May 11, 2005 Report Share Posted May 11, 2005 Ola Ico, seja bem vindo ao forum Onde você vê um obstáculo alguém vê o término da viagem e o outro vê uma chance de crescer. Elias Abrão Júnior Fone : (0**11) 5181-6909 São Paulo - SP eajunior.fw@terra.com.br xHarbour 0.99.0 - Fivewin 2.5 e xMate Quote Link to comment Share on other sites More sharing options...
fluna Posted May 11, 2005 Report Share Posted May 11, 2005 id='Arial'> .......................................................................... use histor new shared if !rlock() MsgAlert("Tem alguem mexendo neste registro!","Vai dá não patrão!!!!") return(.f.) endif DEFINE DIALOG oDlg RESOURCE "nonono" // nonono é o nome que vc deu para adialog REDEFINE GET oGet1 VAR Histor->data ID 101 OF oDlg picture "99/99/9999" REDEFINE GET oGet2 VAR histor->historico ID 102 OF oDlg REDEFINE GET oGet3 VAR histor->valor ID 103 OF oDlg picture "@E 999,999,99.99" ACTIVATE DIALOG oDlg CENTERED unlock all ............................................................................ os numeros 101,102,103 são identificadores dos campos dentro da dialog criada... verifique os id da sua dialog e os substitua. ex: duplo clique no campo e vc vera um numero no <> ou tb pode abrir o arquivo.rc com um editor qualquer e vc verá: TELA1 DIALOG 29, 52, 260, 142 STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME FONT 8, "Arial" { GROUPBOX "Cabecalho", 119, 3, 1, 254, 64, BS_GROUPBOX | WS_CHILD | WS_VISIBLE EDITTEXT 115, 6, 10, 248, 12 <===== o primeiro numero da lista: 115 EDITTEXT 150, 6, 24, 248, 12 <===== o primeiro numero da lista: 150 EDITTEXT 117, 6, 37, 248, 12 <===== o primeiro numero da lista: 117 EDITTEXT 165, 6, 50, 248, 12 <===== o primeiro numero da lista: 165 LTEXT "Grupo:", -1, 7, 68, 23, 8, WS_CHILD | WS_VISIBLE | WS_GROUP EDITTEXT 107, 4, 122, 136, 12, ES_AUTOHSCROLL | WS_BORDER | WS_TABSTOP <== idem: 107 } Quote Link to comment Share on other sites More sharing options...
Luiz Arruda (ICO) Posted May 12, 2005 Author Report Share Posted May 12, 2005 Obrigado a todos pelas respostas rápidas, só que nem uma delas resolveu o meu problema, a do fluna foi a quase deu certo, só um porem a tela fica só editando registros e nao incluindo novos, na minha dialog tem 04 buttons, incluir, alterar, excluir e sair, gostaria que só efetuasse o registro apos o clik em incluir. obrigado mais uma vez. Editado por - ico on 12/05/2005 10:30:08 Quote Link to comment Share on other sites More sharing options...
kapiaba Posted May 12, 2005 Report Share Posted May 12, 2005 http://www.fivewin.com.br/exibedicas.asp?id=159 Bad Boy - The HuntsMan Of E.A.J. Automação Comercial. kapiaba@brfree.com.br FW 2.3C CLIPPER 5.3B BLINKER 7.0 WORKSHOP.EXE 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.