Jump to content
Fivewin Brasil

zekasan

Membros
  • Posts

    146
  • Joined

  • Last visited

  • Days Won

    6

zekasan last won the day on December 6 2019

zekasan had the most liked content!

About zekasan

  • Birthday 09/30/1961

Profile Information

  • Gender
    Male
  • Location
    São Paulo

Contact Methods

  • Skype
    zekasan

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

zekasan's Achievements

  1. Estranho que não funcione para vc, nos meus programas não travam
  2. Uso uma rotina que o Vagner fez faz um tempão TAMANHO_VIDEO:=VRESVIDEO() ? TAMANHO_VIDEO[1],TAMANHO_VIDEO[2] /********************************************************* * Função : Funcao em C para pegar a Resolução da Tela * Data : 13/03/2013 à s 12:05:26 por Vagner * Revisado em : 13/03/2013 à s 12:05:35 por Vagner * Parâmetros : * iWidthNew - Largura Mínima Necessária * iHeightNew - Altura Mínima Necessária **********************************************************/ #Pragma BEGINDUMP #include <Windows.h> #include <ShellApi.h> #include <Wingdi.h> #include <hbapi.h> HB_FUNC (VRESVIDEO) { int iWidth,iHeight ; //Pega a Configuração Atual DEVMODE DeviceMode = { 0 }; EnumDisplaySettings( NULL, ENUM_CURRENT_SETTINGS, &DeviceMode ); iWidth = DeviceMode.dmPelsWidth; iHeight = DeviceMode.dmPelsHeight; hb_reta( 2 ); hb_storni( iWidth , -1, 1 ); hb_storni( iHeight, -1, 2 ); } #pragma ENDDUMP
  3. Bom dia, poderiam me ajudar como verificar se o código de barras de um boleto de arrecadação é válido após sua leitura?? Tem que ser de arrecadação e não boletos bancários. Imensamente Grato.
  4. Bom dia Srs e Sras. Alguém pode me informar onde acho os fontes da rotina do get qdo o mesmo pega um dado tipo data? Preciso alterar a rotina para que qdo seja digitado somente o dia ele complete com o mês e ano corrente e, qdo digitado dia e mês ele pegue o ano corrente. Fico muito agradecido pela colaboração. Uso a versão 1207 ainda.
  5. Boa tarde eu uso assim,eu acho prático, me deram a dica aqui no grupo: Pego os dados "oLloyds:Fields("tSaoCte"):Value" , e neste caso os transfiro para uma planilha "oSheetPr:Cells(4,2):value:=oLloyds:Fields("tSaoCte"):Value" ..... ABRE_SQL() cCmdSql:="select sum(SaoCte) as tSaoCte,sum(SaoVol) as tSaoVol,sum(SaoM3) as tSaoM3,sum(SaoFrete) as tSaoFrete, "+; "sum(RioCte) as tRioCte,sum(RioVol) as tRioVol,sum(RioM3) as tRioM3,sum(RioFrete) as tRioFrete, "+; "sum(BhzCte) as tBhzCte,sum(BhzVol) as tBhzVol,sum(BhzM3) as tBhzM3,sum(BhzFrete) as tBhzFrete "+; "from LLOYDS_CTE "+; "where DtEmissao >= '"+data_sql(c1101)+"' and DtEmissao <= '"+data_sql(c1102)+"'" try oLloyds := oCon:Execute(cCmdSql) catch oErr msginfo( "Erro ao abrir Tabela LLOYDS_CTE","ATENÇÃO" ) return(.f.) end oSheetPr:Cells(4,2):value:=oLloyds:Fields("tSaoCte"):Value oSheetPr:Cells(4,3):value:=oLloyds:Fields("tSaoVol"):Value oSheetPr:Cells(4,4):value:=oLloyds:Fields("tSaoM3"):Value oSheetPr:Cells(4,5):value:=oLloyds:Fields("tSaoFrete"):Value oSheetPr:Cells(5,2):value:=oLloyds:Fields("tRioCte"):Value oSheetPr:Cells(5,3):value:=oLloyds:Fields("tRioVol"):Value oSheetPr:Cells(5,4):value:=oLloyds:Fields("tRioM3"):Value oSheetPr:Cells(5,5):value:=oLloyds:Fields("tRioFrete"):Value oSheetPr:Cells(6,2):value:=oLloyds:Fields("tBhzCte"):Value oSheetPr:Cells(6,3):value:=oLloyds:Fields("tBhzVol"):Value oSheetPr:Cells(6,4):value:=oLloyds:Fields("tBhzM3"):Value oSheetPr:Cells(6,5):value:=oLloyds:Fields("tBhzFrete"):Value ... FECHA_SQL() function ABRE_SQL() * Server = nome do servidor ou seu IP * Database = nome do seu BD * Uid = usuário * Pwd = senha cConnection := "driver={SQL Server};Server=xxx.xxx.xxx.xxx;Database=NONAME;Uid=nonane;Pwd=noname" try oCon:=tOleAuto():new("ADODB.Connection") oCon:Open( cConnection ) CATCH oError MsgInfo( "Problema com a conexão ao banco de dados!" +CRLF+ ; "Error: " + Transform(oError:GenCode, nil) + ";" +CRLF+ ; "SubC: " + Transform(oError:SubCode, nil) + ";" +CRLF+ ; "OSCode: " + Transform(oError:OsCode, nil) + ";" +CRLF+ ; "SubSystem: " + Transform(oError:SubSystem, nil) + ";" +CRLF+ ; "Mensaje: " + oError:Description, "Atenção" ) return(.f.) end return(.t.) function FECHA_SQL() oCon:close() return(.t.)
  6. Precisei algo parecido, caso exista eu atualizo algumas variáveis, caso contrário eu insiro os dados: cCmdSql:="if exists (select usuario from SSW_USUARIO where Usuario = '"+cGet01_S1+"') "+; " begin "+; " update ssw_usuario set "+; " nome = '"+ cGet06_S1 +"',"+; " senha = '"+ cGet02_S1 +"',"+; " nivel = "+ str(cGet05_S1,1)+","+; " email = '"+ cGetEma +"',"+; " emailsenha = '"+ cGetSen +"',"+; " telddd = '"+ cGetDDD +"',"+; " telnr = '"+ cGetTel +"',"+; " telramal = '"+ cGetRam +"'"+; " where usuario = '"+cGet01_S1+"' "+; " end "+; "else "+; " begin "+; " insert into ssw_usuario(filial,usuario,nome,senha,nivel,email,emailsenha,telddd,telnr,telramal) "+; " values( "+; " '"+RET_FILIAL_SSW(cGet04_S1)+"',"+; " '"+cGet01_S1+"',"+; " '"+cGet06_S1+"',"+; " '"+cGet02_S1+"',"+; " "+str(cGet05_S1,1)+","+; " '"+cGetEma+"',"+; " '"+cGetSen+"',"+; " '"+cGetDDD+"',"+; " '"+cGetTel+"',"+; " '"+cGetRam+"')"+; " end"
  7. Muito obrigado, irei implementar
  8. Bom dia, alguma alma nobre pode me ajudar com estas encrenca? Estou procurando exemplo na versão 1207 e não estou achando, alguém tem esta COISA??? Agradeço muito se puderem me ajudar.
  9. COLOQUEI O SEGUINTE do whil .t. try CONDICAO:=oOle:readystate catch exit end syswait(.5) enddo
  10. Preciso que fique em um loop após ser aberta até a janela ser fechada, para dar prosseguimento a uma outra rotina, essa outra rotina será executada assim que esta janela aberta for fechada.
  11. Bom dia, alguém pode me ajudar??? Como fico sabendo se a janela aberta na rotina CreateObject("InternetExplorer.Application"), está aberta??? oOle:= CreateObject("InternetExplorer.Application") oOle:Visible := .t. oOle:ToolBar := .f. oOle:StatusBar := .f. oOle:MenuBar := .f. oOle:Navigate2("https://www.sefaz.rs.gov.br/NFE/NFE-CCC.aspx") hWnd:=oOle:hWnd ShowWindow(hWnd, 1 ) BringWindowToTop(hWnd) While oOle:Busy syswait(.5) End * cCopiar("60157377000504") try oOle1 := oOle:Document() oOle1:getElementById("ctl00_cphConteudo_cmbUF"):value := "35" // 35-> SP oOle1:getElementById("ctl00_cphConteudo_cmbUF"):Focus() oOle1:getElementById("ctl00_cphConteudo_cmbUF"):Click() oOle1:getElementById("tbxCNPJContrib"):value := QUAL_CNPJ catch end do while JANELA_ABERTA???? syswait(??) enddo GRATO
  12. caracas, comeu de novo o caracter colchete, tem quer sre IO:=ARR0+caracter colchete+ I + caracter colchete
  13. agora que vi que comeu uma parte do texto: onde se le IO:=ARR0 deve ser substituído por IO:=ARR0
  14. Boa tarde, eu dei uma mudadinha, retorna um array com os dados FUNCTION PEGA_CNPJ(PROC_CNPJ) Local oServerWS, cUrl, aCNPJ[12] if LEN(PROC_CNPJ)#14 MSGINFO("Este busca não funciona para CPF!") return .t. endif cUrl:= "https://www.receitaws.com.br/v1/cnpj/"+PROC_CNPJ Try oServerWS := CreateObject( 'MSXML2.ServerXMLHTTP.5.0' ) Catch oError try oServerWS := CreateObject( 'MSXML2.ServerXMLHTTP.6.0' ) catch oError try oServerWS := CreateObject("Microsoft.XMLHTTP") catch oError ? e:Description return nil end END end TRY oServerWS:open('GET', cUrl, .f.) oServerWS:setRequestHeader('Content-Type' , 'text/xml; charset=utf-8') // Obtém ou define o valor de cabeçalho de Content-type HTTP. oServerWS:send() CATCH ? "Não conseguiu enviar solicitação para requisição dos dados do CNPJ" return .t. END * Verifica o status do request. Exibe erro se houver IF oServerWS:Status != 200 // OK MsgStop( Alltrim(STR(oServerWS:Status)) +" - "+ oServerWS:StatusText , "Erro") RETURN NIL ENDIF WHILE oServerWS:readyState != 4 oServerWS:waitForResponse(1000) END * decodifica o arquivo json e transforma em um array multidimensional ** x := hb_jsondecode( oServerWS:responseText, @aArray ) txt:= oServerWS:responseText *? txt Arq_1:=ALLTRIM(txt) ARR0:=HB_ATokens( Arq_1, CHR(10) ) *xbrowse(ARR0) TAB:={} QT:=0 n_f1:="" n_f2:="" FOR I=1 TO LEN(ARR0) if substr(ARR0,4,4) = "nome" // REG 1 - Nome I0:=ARR0 I0:=StrTran( I0, "nome" ) I0:=StrTran( I0, ":" ) I0:=StrTran( I0, "," ) I0:=StrTran( I0, ";" ) I0:=StrTran( I0, CHR(34) ) if len(alltrim(I0))>0 aCNPJ[1] := alltrim(I0) endif endif if substr(ARR0,4,2) = "uf" // REG 2 - UF I0:=ARR0 I0:=StrTran( I0, "uf" ) I0:=StrTran( I0, ":" ) I0:=StrTran( I0, "," ) I0:=StrTran( I0, ";" ) I0:=StrTran( I0, CHR(34) ) if len(alltrim(I0))>0 aCNPJ[2] := alltrim(I0) endif ENDIF if substr(ARR0,4,10) = "logradouro" // REG 3 - LOGRADOURO I0:=ARR0 I0:=StrTran( I0, "logradouro" ) I0:=StrTran( I0, ":" ) I0:=StrTran( I0, "," ) I0:=StrTran( I0, ";" ) I0:=StrTran( I0, CHR(34) ) if len(alltrim(I0))>0 aCNPJ[3] := alltrim(I0) endif ENDIF if substr(ARR0,4,6) = "numero" // REG 4 - NÚMERO I0:=ARR0 I0:=StrTran( I0, "numero" ) I0:=StrTran( I0, ":" ) I0:=StrTran( I0, "," ) I0:=StrTran( I0, ";" ) I0:=StrTran( I0, CHR(34) ) if len(alltrim(I0))>0 aCNPJ[4] := alltrim(I0) endif ENDIF if substr(ARR0,4,3) = "cep" // REG 5 - CEP I0:=ARR0 I0:=StrTran( I0, "cep" ) I0:=StrTran( I0, ":" ) I0:=StrTran( I0, "," ) I0:=StrTran( I0, ";" ) I0:=StrTran( I0, "." ) I0:=StrTran( I0, "-" ) I0:=StrTran( I0, CHR(34) ) if len(alltrim(I0))>0 aCNPJ[5] := transform(alltrim(I0),"@R 99999-999") endif ENDIF if substr(ARR0,4,9) = "municipio" // REG 6 - MUNICÍPIO I0:=ARR0 I0:=StrTran( I0, "municipio" ) I0:=StrTran( I0, ":" ) I0:=StrTran( I0, "," ) I0:=StrTran( I0, ";" ) I0:=StrTran( I0, CHR(34) ) if len(alltrim(I0))>0 aCNPJ[6] := alltrim(I0) endif ENDIF if substr(ARR0,4,8) = "abertura" // REG 7 - DT ABERTURA I0:=ARR0 I0:=StrTran( I0, "abertura" ) I0:=StrTran( I0, ":" ) I0:=StrTran( I0, "," ) I0:=StrTran( I0, ";" ) I0:=StrTran( I0, CHR(34) ) if len(alltrim(I0))>0 aCNPJ[7] := alltrim(I0) endif ENDIF if substr(ARR0,4,6) = "bairro" // REG 8 - BAIRRO I0:=ARR0 I0:=StrTran( I0, "bairro" ) I0:=StrTran( I0, ":" ) I0:=StrTran( I0, "," ) I0:=StrTran( I0, ";" ) I0:=StrTran( I0, CHR(34) ) if len(alltrim(I0))>0 aCNPJ[8] := alltrim(I0) endif ENDIF if substr(ARR0,4,11) = "complemento" // REG 9 - COMPLEMENTO I0:=ARR0 I0:=StrTran( I0, "complemento" ) I0:=StrTran( I0, ":" ) I0:=StrTran( I0, "," ) I0:=StrTran( I0, ";" ) I0:=StrTran( I0, CHR(34) ) if len(alltrim(I0))>0 aCNPJ[9] := alltrim(I0) endif ENDIF if substr(ARR0,4,5) = "email" // REG 10 - EMAIL I0:=ARR0 I0:=StrTran( I0, "email" ) I0:=StrTran( I0, ":" ) I0:=StrTran( I0, "," ) I0:=StrTran( I0, ";" ) I0:=StrTran( I0, CHR(34) ) if len(alltrim(I0))>0 aCNPJ[10] := alltrim(I0) endif ENDIF if substr(ARR0,4,8) = "telefone" // REG 11 - TELEFONE I0:=ARR0 I0:=StrTran( I0, "telefone" ) I0:=StrTran( I0, ":" ) I0:=StrTran( I0, "," ) I0:=StrTran( I0, ";" ) I0:=StrTran( I0, CHR(34) ) if len(alltrim(I0))>0 aCNPJ[11] := alltrim(I0) * IF AT("/",TEL_C)>0 * TEL_C:=ALLTRIM(LEFT(TEL_C,AT("/",TEL_C)-1)) * ENDIF endif ENDIF if substr(ARR0,4,8) = "fantasia" // REG 12 - FANTASIA I0:=ARR0 I0:=StrTran( I0, "fantasia" ) I0:=StrTran( I0, ":" ) I0:=StrTran( I0, "," ) I0:=StrTran( I0, ";" ) I0:=StrTran( I0, CHR(34) ) if len(alltrim(I0))>0 aCNPJ[12] := alltrim(I0) endif ENDIF NEXT * xbrowse(aCNPJ) RETURN(aCNPJ)
×
×
  • Create New...