topic
stringlengths
1
63
text
stringlengths
1
577k
Ayuda con clase TPrinter
Una aiudita..... porfi....
Ayuda con clase TPrinter
Amigos, a alguien le toca imprimir texto centrado en un listado? Saludos Roberto
Ayuda con clase TPrinter
[code=fw:30l18bfr]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#Define</span> PAD_LEFT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">0</span><br /><span style="color: #00D7D7;">#Define</span> PAD_RIGHT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">1</span><br /><span style="color: #00D7D7;">#Define</span> PAD_CENTER &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">2</span><br />&nbsp;</div>[/code:30l18bfr]
Ayuda con clase TPrinter
Karinha gracias pero de lo que hablo, es de justificar el texto a ambos lados, para que quede alineado a ambos márgenes, esto es para poner el texto a la derecha, o izquierda o centrado, yo necesito que esté JUSTIFICADO porque se trata de formularios oficiales que deben presentar este formato. Roberto
Ayuda con clase TPrinter
Podrias poner un ejemplo simples? Mira: [url:7os32r5b]http&#58;//fivetechsupport&#46;com/forums/viewtopic&#46;php?f=6&t=27192&start=0[/url:7os32r5b] [url:7os32r5b]http&#58;//forums&#46;fivetechsupport&#46;com/viewtopic&#46;php?f=6&t=14387[/url:7os32r5b] [url:7os32r5b]http&#58;//wiki&#46;fivetechsoft&#46;com/doku&#46;php?id=fivewin_functions_by_category[/url:7os32r5b] saludos.
Ayuda con clase TPrinter
Bueno, justamente lo que estoy usando hasta ahora, es la función Imp_memow() que la vengo aplicando desde hace rato, tenía modificada la clase tprinter de la versión 6.12 y algo y estaba usando esa, pero, como actualizé la versión de FW, quería aprovechar las mejoras de la clase tprinter y preview, entonces necesitaba corregirla porque así como está no me funciona correctamente, si miras el primer post, ahí está el método Say de la clase tprinter que es donde hay que modificar, pero no lo puedo hacer funcionar. Saludos Roberto
Ayuda con clase TPrinter
/* Entrada = Texto a ser justificado Tamanho em que o texto será justificado Fonte utilizada Indicador se o tamanho foi passado em pixels Saída = Texto espaçado/justificado */ [code=fw:z0zyxnv8]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">METHOD</span> JustifyText<span style="color: #000000;">&#40;</span> cText, nLen, oFont, lPixel <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TPrinter<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cAuxi:=ALLTRIM<span style="color: #000000;">&#40;</span>cText<span style="color: #000000;">&#41;</span>, nLenPixel:=<span style="color: #000000;">0</span>, nSpace:=<span style="color: #000000;">1</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aWords:=<span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span>, i:=<span style="color: #000000;">0</span>, cSubst:=<span style="color: #ff0000;">""</span>, cSpell:=<span style="color: #ff0000;">""</span>, lDone:=.T.<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> i = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> len<span style="color: #000000;">&#40;</span>cText<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; cSubst := &nbsp;SUBST<span style="color: #000000;">&#40;</span>cText,i,<span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> cSubst = <span style="color: #ff0000;">" "</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aadd<span style="color: #000000;">&#40;</span>aWords,cSpell<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cSpell = <span style="color: #ff0000;">""</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp; &nbsp; cSpell += &nbsp;cSubst<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">next</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> .not.empty<span style="color: #000000;">&#40;</span>cSpell<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; aadd<span style="color: #000000;">&#40;</span>aWords,cSpell<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> len<span style="color: #000000;">&#40;</span>aWords<span style="color: #000000;">&#41;</span>=<span style="color: #000000;">0</span> .OR. len<span style="color: #000000;">&#40;</span>aWords<span style="color: #000000;">&#41;</span>=<span style="color: #000000;">1</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> cText<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> lPixel = <span style="color: #00C800;">nil</span> .or. .not.lPixel<br /><br />&nbsp; &nbsp; &nbsp; nLenPixel = <span style="color: #0000ff;">Max</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">&#40;</span> nLen * <span style="color: #000000;">10</span> * ::<span style="color: #000000;">nHorzRes</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> / ::<span style="color: #000000;">nHorzSize</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> - ::<span style="color: #000000;">nXoffset</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br /><br />&nbsp; &nbsp; &nbsp; nLenPixel = nLen<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">while</span> .T.<br /><br />&nbsp; &nbsp; &nbsp; cAuxi = <span style="color: #ff0000;">""</span><br /><br />&nbsp; &nbsp; &nbsp; lDone = .F.<br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">for</span> i = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> len<span style="color: #000000;">&#40;</span>aWords<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">IF</span> i # len<span style="color: #000000;">&#40;</span>aWords<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cAuxi += aWords<span style="color: #000000;">&#91;</span> i <span style="color: #000000;">&#93;</span> + SPACE<span style="color: #000000;">&#40;</span>nSpace<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">next</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">GetTextWidth</span><span style="color: #000000;">&#40;</span> cAuxi, oFont <span style="color: #000000;">&#41;</span> >= nLenPixel<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;lDone = .T.<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;EXIT<br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp; &nbsp; nSpace ++<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">enddo</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> lDone<br /><br />&nbsp; &nbsp; &nbsp; cText = cAuxi<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">return</span> cText<br /><br />&nbsp;</div>[/code:z0zyxnv8] // Exemplo de utilização: // Ejemplo de como usar [code=fw:z0zyxnv8]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFT12N <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Arial"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-11</span> <span style="color: #0000ff;">OF</span> oPrn<br /><br />&nbsp; &nbsp;cFrase = <span style="color: #ff0000;">"Quinto Encontro de FiveWiners em Novembro/2007, espero ver todos presentes !"</span><br /><br />&nbsp; &nbsp;nLen = <span style="color: #000000;">19</span> \\ largura <span style="color: #00C800;">do</span> A4 com margens<br /><br />&nbsp; &nbsp;cJustificado = oPrn:<span style="color: #000000;">JustifyText</span><span style="color: #000000;">&#40;</span>cFrase,nLen,oFT12N<span style="color: #000000;">&#41;</span><br /><br />oPrn:<span style="color: #000000;">CmSay</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">01</span>,<span style="color: #000000;">01</span>,cJustificado,oFT12N,<span style="color: #00C800;">NIL</span>,CLR_BLACK<span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:z0zyxnv8] Saludos. 
Ayuda con clase TPrinter
PERFECTO! Esto es lo que necesito, una consultita más: Para imprimir un texto de varias líneas como tendría que hacer? Gracias! Roberto
Ayuda con clase TPrinter
Mira \samples\testprn?.prg creo tenga el que necesitas. saludos.
Ayuda con clase TPrinter
Karinha... no encuentro ese método dentro de la tprinter, tampoco ejemplos de los testprn... no sé de donde se puede probar...
Ayuda con clase TPrinter
Mira el metodo SayMemo de la clase Scintilla
Ayuda con cmonth en minúscula
Por ejemplo: Si la fecha de hoy es 28-10-2009 y aplico el código "Madrid"+","+str(day(date))+" de"+"[color=#FF0000:u4i627zq]lower([/color:u4i627zq]alltrim(cmonth(date))[color=#FF0000:u4i627zq])[/color:u4i627zq]+" de"+ str(year(date)) me devolverá:"Madrid, 28 de Octubre de 2009".
Ayuda con cmonth en minúscula
Hola, foro. Cómo hacer para que el comando cmonth(date) devuelva el mes en minúscula? Por ejemplo: Si la fecha de hoy es 28-10-2009 y aplico el código "Madrid"+","+str(day(date))+" de"+"alltrim(cmonth(date))+" de"+ str(year(date)) me devolverá:"Madrid, 28 de Octubre de 2009". Lo que yo quiero es que devuelva "octubre" y no "Octubre" Perdonad mi ignorancia, pero hace muuuuuucho tiempo que dejé, por cuestión de tiempo, la programación. Me viene a la memoria la funcíón lógica Isupper()....., pero no recuerdo ahora el manejo... Un saludo
Ayuda con cmonth en minúscula
Muchas gracias, Pablo.
Ayuda con codigo - conversion
Hola estimados, necesito de su ayuda con este codigo, deseo pasarlo a harbour/fw, si bien le he dado muchas vueltas, no logro hace la parte del TMultipartFormData.Create() agradezco cualquier ayuda brindada! [code=fw:1w1nx7zx]<div class="fw" id="{CB}" style="font-family: monospace;">program sendFileByUpload;<br /><br /><span style="color: #000000;">&#123;</span>$APPTYPE CONSOLE<span style="color: #000000;">&#125;</span><br /><br />uses<br />&nbsp; System.SysUtils,<br />&nbsp; System.Classes, System.Net.HttpClient, System.Net.Mime, System.Net.URLClient, System.Net.HttpClientComponent;<br /><br /><span style="color: #0000ff;">var</span><br />&nbsp; HttpClient: <span style="color: #000000;">TNetHTTPClient</span>;<br />&nbsp; Response: <span style="color: #000000;">IHTTPResponse</span>;<br />&nbsp; FormData: <span style="color: #000000;">TMultipartFormData</span>;<br />&nbsp; EndpointURL, ID_INSTANCE, API_TOKEN_INSTANCE: <span style="color: #000000;">string</span>;<br /><br />begin<br />&nbsp; ID_INSTANCE := <span style="color: #ff0000;">'110100001'</span>;<br />&nbsp; API_TOKEN_INSTANCE := <span style="color: #ff0000;">'d75b3a66374942c5b3c019c698abc2067e151558acbd451234'</span>;<br /><br />&nbsp; EndpointURL := <span style="color: #ff0000;">'https://api.green-api.com/waInstance'</span> + ID_INSTANCE + <span style="color: #ff0000;">'/sendFileByUpload/'</span> + API_TOKEN_INSTANCE;<br /><br />&nbsp; HttpClient := TNetHTTPClient.Create<span style="color: #000000;">&#40;</span><span style="color: #00C800;">nil</span><span style="color: #000000;">&#41;</span>;<br /><br />&nbsp; FormData := TMultipartFormData.Create<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />&nbsp; FormData.AddField<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'chatId'</span>, <span style="color: #ff0000;"><!-- e --><a href="mailto:'71234567890@c.us">'71234567890@c.us</a><!-- e -->'</span><span style="color: #000000;">&#41;</span>;<br />&nbsp; FormData.AddField<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'caption'</span>, <span style="color: #ff0000;">'test'</span><span style="color: #000000;">&#41;</span>;<br />&nbsp; FormData.AddFile<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'file'</span>, <span style="color: #ff0000;">'C:<span style="color: #000000;">\t</span>mp<span style="color: #000000;">\b</span>p.png'</span><span style="color: #000000;">&#41;</span>;<br /><br />&nbsp; <span style="color: #00C800;">try</span><br />&nbsp; &nbsp; Response := HTTPClient.Post<span style="color: #000000;">&#40;</span>EndpointURL, FormData, <span style="color: #00C800;">nil</span><span style="color: #000000;">&#41;</span>;<br /><br />&nbsp; &nbsp; <span style="color: #00C800;">if</span> Response.StatusCode = <span style="color: #000000;">200</span> then<br />&nbsp; &nbsp; &nbsp; Writeln<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'[Response]: '</span> + Response.ContentAsString<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; Writeln<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'[ERROR '</span> + IntToStr<span style="color: #000000;">&#40;</span>Response.StatusCode<span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">']:'</span> + Response.StatusText + <span style="color: #ff0000;">''</span> + Response.ContentAsString<span style="color: #000000;">&#41;</span>;<br /><br />&nbsp; &nbsp; readln;<br />&nbsp; except<br />&nbsp; &nbsp; <span style="color: #0000ff;">on</span> E: <span style="color: #000000;">Exception</span> <span style="color: #00C800;">do</span><br />&nbsp; &nbsp; &nbsp; Writeln<span style="color: #000000;">&#40;</span>E.ClassName, <span style="color: #ff0000;">': '</span>, E.<span style="color: #0000ff;">Message</span><span style="color: #000000;">&#41;</span>;<br />&nbsp; end;<br /><br />&nbsp; HttpClient.Free;<br />&nbsp; FormData.Free;<br /><br />end.</div>[/code:1w1nx7zx]
Ayuda con codigo - conversion
Estimado Carlos, Supongo que habrás encontrado esto: [url:2dr0guph]http&#58;//www&#46;w3&#46;org/TR/html4/interact/forms&#46;html#h-17&#46;13&#46;4&#46;2[/url:2dr0guph]
Ayuda con codigo - conversion
A ver si esto puede servirte: [code=fw:8n32kkct]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">// A class to represent a single part of a multipart/form-data</span><br /><span style="color: #00C800;">CLASS</span> TFormDataPart<br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> <span style="color: #0000ff;">name</span> <span style="color: #B900B9;">// The name of the part</span><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> contentType <span style="color: #B900B9;">// The content type of the part, or empty if not specified</span><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> filename <span style="color: #B900B9;">// The filename of the part, or empty if not a file</span><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> <span style="color: #00C800;">data</span> <span style="color: #B900B9;">// The data of the part, as an array of bytes</span><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> dataSize <span style="color: #B900B9;">// The size of the data in bytes</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// A constructor that takes the name and data of the part</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> cName, aData <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #0000ff;">name</span> := cName<br />&nbsp; &nbsp; &nbsp; ::<span style="color: #00C800;">data</span> := aData<br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">dataSize</span> := Len<span style="color: #000000;">&#40;</span> ::<span style="color: #00C800;">data</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">Self</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// A constructor that takes the name, content type, filename and data of the part</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> NewWithFile<span style="color: #000000;">&#40;</span> cName, cContentType, cFilename, aData <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #0000ff;">name</span> := cName<br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">contentType</span> := cContentType<br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">filename</span> := cFilename<br />&nbsp; &nbsp; &nbsp; ::<span style="color: #00C800;">data</span> := aData<br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">dataSize</span> := Len<span style="color: #000000;">&#40;</span> ::<span style="color: #00C800;">data</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">Self</span><br /><br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><span style="color: #B900B9;">// A class to represent a multipart/form-data</span><br /><span style="color: #00C800;">CLASS</span> TMultiPartFormData<br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> parts <span style="color: #B900B9;">// An array of parts</span><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> numParts <span style="color: #B900B9;">// The number of parts in the array</span><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> boundary <span style="color: #B900B9;">// A boundary string to separate the parts</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// A constructor that generates a random boundary string</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">parts</span> := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">numParts</span> := <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">boundary</span> := ::<span style="color: #000000;">generateBoundary</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">Self</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// A constructor that takes a custom boundary string</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> NewWithBoundary<span style="color: #000000;">&#40;</span> cBoundary <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">parts</span> := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">numParts</span> := <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">boundary</span> := cBoundary<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">Self</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// A method to add a part to the multipart/form-data</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> addPart<span style="color: #000000;">&#40;</span> oPart <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; AAdd<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">parts</span>, oPart <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">numParts</span>++<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">Self</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// A method to get the content type of the multipart/form-data</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> getContentType<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> <span style="color: #ff0000;">"multipart/form-data; boundary="</span> + ::<span style="color: #000000;">boundary</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// A method to get the content length of the multipart/form-data</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> getContentLength<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; nLength := <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">FOR</span> EACH oPart IN ::<span style="color: #000000;">parts</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// Add the length of the boundary and the CRLF</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nLength += Len<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">boundary</span> <span style="color: #000000;">&#41;</span> + <span style="color: #000000;">2</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// Add the length of the Content-Disposition header and the CRLF</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nLength += <span style="color: #000000;">38</span> + Len<span style="color: #000000;">&#40;</span> oPart:<span style="color: #0000ff;">name</span> <span style="color: #000000;">&#41;</span> + <span style="color: #000000;">2</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">IF</span> !Empty<span style="color: #000000;">&#40;</span> oPart:<span style="color: #000000;">filename</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// Add the length of the filename parameter and the CRLF</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nLength += <span style="color: #000000;">12</span> + Len<span style="color: #000000;">&#40;</span> oPart:<span style="color: #000000;">filename</span> <span style="color: #000000;">&#41;</span> + <span style="color: #000000;">2</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span> <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">IF</span> !Empty<span style="color: #000000;">&#40;</span> oPart:<span style="color: #000000;">contentType</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// Add the length of the Content-Type header and the CRLF </span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nLength += <span style="color: #000000;">16</span> + Len<span style="color: #000000;">&#40;</span> oPart:<span style="color: #000000;">contentType</span> <span style="color: #000000;">&#41;</span> + <span style="color: #000000;">2</span> <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span> <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// Add an extra CRLF before the data </span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nLength += <span style="color: #000000;">2</span> <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// Add the length of the data and the CRLF </span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nLength += oPart:<span style="color: #000000;">dataSize</span> + <span style="color: #000000;">2</span> <br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">NEXT</span> <br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// Add the length of the final boundary and the CRLF </span><br />&nbsp; &nbsp; &nbsp; nLength += Len<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">boundary</span> <span style="color: #000000;">&#41;</span> + <span style="color: #000000;">4</span> <br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> nLength <br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// A method to write the multipart/form-data to an output stream </span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> writeToStream<span style="color: #000000;">&#40;</span> oStream <span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">FOR</span> EACH oPart IN ::<span style="color: #000000;">parts</span> <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// Write the boundary and the CRLF </span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oStream:<span style="color: #000000;">WriteLine</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"--"</span> + ::<span style="color: #000000;">boundary</span> <span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// Write the Content-Disposition header and the CRLF </span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oStream:<span style="color: #000000;">WriteLine</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Content-Disposition: form-data; name=<span style="color: #000000;">\"</span>"</span> + oPart:<span style="color: #0000ff;">name</span> + <span style="color: #ff0000;">"<span style="color: #000000;">\"</span>"</span> <span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">IF</span> !Empty<span style="color: #000000;">&#40;</span> oPart:<span style="color: #000000;">filename</span> <span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// Write the filename parameter and the CRLF </span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oStream:<span style="color: #000000;">WriteLine</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"; filename=<span style="color: #000000;">\"</span>"</span> + oPart:<span style="color: #000000;">filename</span> + <span style="color: #ff0000;">"<span style="color: #000000;">\"</span>"</span> <span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span> <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">IF</span> !Empty<span style="color: #000000;">&#40;</span> oPart:<span style="color: #000000;">contentType</span> <span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// Write the Content-Type header and the CRLF </span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oStream:<span style="color: #000000;">WriteLine</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Content-Type: "</span> + oPart:<span style="color: #000000;">contentType</span> <span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span> <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// Write an extra CRLF before the data </span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oStream:<span style="color: #000000;">WriteLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// Write the data and the CRLF </span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oStream:<span style="color: #000000;">WriteBytes</span><span style="color: #000000;">&#40;</span> oPart:<span style="color: #00C800;">data</span> <span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oStream:<span style="color: #000000;">WriteLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">NEXT</span> <br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// Write the final boundary and the CRLF </span><br />&nbsp; &nbsp; &nbsp; oStream:<span style="color: #000000;">WriteLine</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"--"</span> + ::<span style="color: #000000;">boundary</span> + <span style="color: #ff0000;">"--"</span> <span style="color: #000000;">&#41;</span> <br /><br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><span style="color: #B900B9;">// A helper function to generate a random boundary string</span><br /><span style="color: #00C800;">FUNCTION</span> generateBoundary<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">// Use a random number generator</span><br />&nbsp; &nbsp;Randomize<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// Use 16 hexadecimal digits as the boundary</span><br />&nbsp; &nbsp;cBoundary := <span style="color: #ff0000;">"----"</span><br />&nbsp; &nbsp;<span style="color: #00C800;">FOR</span> i := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">16</span><br />&nbsp; &nbsp; &nbsp; cBoundary += <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"0123456789ABCDEF"</span>, Int<span style="color: #000000;">&#40;</span> <span style="color: #000000;">16</span> * Random<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">NEXT</span><br />&nbsp; &nbsp;<span style="color: #00C800;">RETURN</span> cBoundary<br />&nbsp;</div>[/code:8n32kkct]
Ayuda con codigo - conversion
Y aqui la clase TStream: [code=fw:2jemk61b]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">// A class to represent a stream of bytes</span><br /><span style="color: #00C800;">CLASS</span> TStream<br />   <span style="color: #00C800;">DATA</span> position <span style="color: #B900B9;">// The current position in the stream</span><br />   <span style="color: #00C800;">DATA</span> <span style="color: #0000ff;">size</span> <span style="color: #B900B9;">// The size of the stream in bytes</span><br /><br />   <span style="color: #B900B9;">// A constructor that sets the initial position and size of the stream</span><br />   <span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> nPosition, nSize <span style="color: #000000;">&#41;</span><br />      ::<span style="color: #000000;">position</span> := nPosition<br />      ::<span style="color: #0000ff;">size</span> := nSize<br />      <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">Self</span><br />   END<br /><br />   <span style="color: #B900B9;">// A method to read a line of text from the stream, or NIL if the end of the stream is reached</span><br />   <span style="color: #00C800;">METHOD</span> ReadLine<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      cLine := <span style="color: #ff0000;">""</span><br />      nByte := ::<span style="color: #000000;">ReadByte</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">DO</span> <span style="color: #00C800;">WHILE</span> nByte != <span style="color: #00C800;">NIL</span> .AND. nByte != <span style="color: #000000;">10</span> <span style="color: #B900B9;">// 10 is the ASCII code for LF</span><br />         cLine += Chr<span style="color: #000000;">&#40;</span> nByte <span style="color: #000000;">&#41;</span><br />         <span style="color: #00C800;">IF</span> nByte == <span style="color: #000000;">13</span> <span style="color: #B900B9;">// 13 is the ASCII code for CR</span><br />            nByte := ::<span style="color: #000000;">ReadByte</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />            <span style="color: #00C800;">IF</span> nByte == <span style="color: #000000;">10</span> <span style="color: #B900B9;">// 10 is the ASCII code for LF</span><br />               EXIT <span style="color: #B900B9;">// End of line</span><br />            <span style="color: #00C800;">ELSE</span><br />               cLine += Chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">13</span> <span style="color: #000000;">&#41;</span> + Chr<span style="color: #000000;">&#40;</span> nByte <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// Append both CR and the next byte</span><br />            <span style="color: #00C800;">ENDIF</span><br />         <span style="color: #00C800;">ELSE</span><br />            nByte := ::<span style="color: #000000;">ReadByte</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />         <span style="color: #00C800;">ENDIF</span><br />      <span style="color: #00C800;">ENDDO</span><br />      <span style="color: #00C800;">IF</span> Empty<span style="color: #000000;">&#40;</span> cLine <span style="color: #000000;">&#41;</span><br />         <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span> <span style="color: #B900B9;">// End of stream</span><br />      <span style="color: #00C800;">ELSE</span><br />         <span style="color: #00C800;">RETURN</span> cLine <span style="color: #B900B9;">// Return the line without the CRLF</span><br />      <span style="color: #00C800;">ENDIF</span><br />   END<br /><br />   <span style="color: #B900B9;">// A method to write a line of text to the stream, followed by a CRLF</span><br />   <span style="color: #00C800;">METHOD</span> WriteLine<span style="color: #000000;">&#40;</span> cLine <span style="color: #000000;">&#41;</span><br />      ::<span style="color: #000000;">WriteBytes</span><span style="color: #000000;">&#40;</span> cLine + Chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">13</span> <span style="color: #000000;">&#41;</span> + Chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">10</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// Append CRLF to the line</span><br />   END<br /><br />   <span style="color: #B900B9;">// A method to read a single byte from the stream, or NIL if the end of the stream is reached</span><br />   <span style="color: #00C800;">METHOD</span> ReadByte<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">position</span> < ::<span style="color: #0000ff;">size</span><br />         nByte := ::<span style="color: #000000;">getByte</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">position</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// Get the byte at the current position (to be implemented by subclasses)</span><br />         ::<span style="color: #000000;">position</span>++ <span style="color: #B900B9;">// Increment the position</span><br />         <span style="color: #00C800;">RETURN</span> nByte<br />      <span style="color: #00C800;">ELSE</span><br />         <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span> <span style="color: #B900B9;">// End of stream</span><br />      <span style="color: #00C800;">ENDIF</span><br />   END<br /><br />   <span style="color: #B900B9;">// A method to write a single byte to the stream</span><br />   <span style="color: #00C800;">METHOD</span> WriteByte<span style="color: #000000;">&#40;</span> nByte <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">position</span> < ::<span style="color: #0000ff;">size</span><br />         ::<span style="color: #000000;">setByte</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">position</span>, nByte <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// Set the byte at the current position (to be implemented by subclasses)</span><br />         ::<span style="color: #000000;">position</span>++ <span style="color: #B900B9;">// Increment the position</span><br />      <span style="color: #00C800;">ELSE</span><br />         ::<span style="color: #000000;">appendByte</span><span style="color: #000000;">&#40;</span> nByte <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// Append the byte to the end of the stream (to be implemented by subclasses)</span><br />         ::<span style="color: #000000;">position</span>++ <span style="color: #B900B9;">// Increment the position</span><br />         ::<span style="color: #0000ff;">size</span>++ <span style="color: #B900B9;">// Increment the size</span><br />      <span style="color: #00C800;">ENDIF</span><br />   END<br /><br />   <span style="color: #B900B9;">// A method to read an array of bytes from the stream, or NIL if the end of the stream is reached</span><br />   <span style="color: #00C800;">METHOD</span> ReadBytes<span style="color: #000000;">&#40;</span> nCount <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">position</span> + nCount <= ::<span style="color: #0000ff;">size</span><br />         aBytes := ::<span style="color: #000000;">getBytes</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">position</span>, nCount <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// Get an array of bytes from the current position (to be implemented by subclasses)</span><br />         ::<span style="color: #000000;">position</span> += nCount <span style="color: #B900B9;">// Increment the position by the number of bytes read</span><br />         <span style="color: #00C800;">RETURN</span> aBytes<br />      <span style="color: #00C800;">ELSE</span><br />         <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span> <span style="color: #B900B9;">// End of stream or not enough bytes available</span><br />      <span style="color: #00C800;">ENDIF</span> <br />   END <br /><br />   <span style="color: #B900B9;">// A method to write an array of bytes to the stream </span><br />   <span style="color: #00C800;">METHOD</span> WriteBytes<span style="color: #000000;">&#40;</span> aBytes <span style="color: #000000;">&#41;</span> <br />      <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">position</span> + Len<span style="color: #000000;">&#40;</span> aBytes <span style="color: #000000;">&#41;</span> <= ::<span style="color: #0000ff;">size</span> <br />         ::<span style="color: #000000;">setBytes</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">position</span>, aBytes <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// Set an array of bytes from the current position (to be implemented by subclasses) </span><br />         ::<span style="color: #000000;">position</span> += Len<span style="color: #000000;">&#40;</span> aBytes <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// Increment the position by the number of bytes written </span><br />      <span style="color: #00C800;">ELSE</span> <br />         <span style="color: #00C800;">FOR</span> EACH nByte IN aBytes <br />            ::<span style="color: #000000;">WriteByte</span><span style="color: #000000;">&#40;</span> nByte <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// Write each byte individually </span><br />         <span style="color: #00C800;">NEXT</span> <br />      <span style="color: #00C800;">ENDIF</span> <br />   END <br /><br />   <span style="color: #00C800;">METHOD</span> WriteLine<span style="color: #000000;">&#40;</span> cLine <span style="color: #000000;">&#41;</span><br />      ::<span style="color: #000000;">WriteBytes</span><span style="color: #000000;">&#40;</span> cLine + Chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">13</span> <span style="color: #000000;">&#41;</span> + Chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">10</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// Append CRLF to the line</span><br />   END<br /><br /><span style="color: #00C800;">ENDCLASS</span> <br /> </div>[/code:2jemk61b]
Ayuda con codigo - conversion
Con la ayuda de César Gómez y la clase tposthtml logré enviar un archivo pero llega corrupto, hoy daré un vistazo a lo que envías Antonio, muy agradecido... Les comentaré como me fue... Salu2
Ayuda con codigo - conversion
Antonio, me parece que la clase tstream esta incompleta, est es derivada del vfp o xbase++? lo digo por la sintasix de la definicion de clase, o es de las antiguas clase de clipper class(y)? salu2 carlos
Ayuda con codigo - conversion
[code=fw:1ma2cg3x]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">/*----------------------------------------------------------------------------*/</span><br /><span style="color: #B900B9;">// CLASS TStream</span><br /><span style="color: #B900B9;">/*----------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">CLASS</span> TStream<br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> nPosition<br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> nSize<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> nPosition, nSize <span style="color: #000000;">&#41;</span> CONSTRUCTOR<br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> ReadLine<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> WriteLine<span style="color: #000000;">&#40;</span> cLine <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> ReadByte<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> WriteByte<span style="color: #000000;">&#40;</span> nByte <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> ReadBytes<span style="color: #000000;">&#40;</span> nCount <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> WriteBytes<span style="color: #000000;">&#40;</span> aBytes <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> GetByte<span style="color: #000000;">&#40;</span> nPosition <span style="color: #000000;">&#41;</span> VIRTUAL<br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> SetByte<span style="color: #000000;">&#40;</span> nPosition, nByte <span style="color: #000000;">&#41;</span> &nbsp;VIRTUAL<br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> AppendByte<span style="color: #000000;">&#40;</span> nByte <span style="color: #000000;">&#41;</span> VIRTUAL<br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> GetBytes<span style="color: #000000;">&#40;</span> nPosition, nCount <span style="color: #000000;">&#41;</span> VIRTUAL<br />&nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> SetBytes<span style="color: #000000;">&#40;</span> nPosition, aBytes <span style="color: #000000;">&#41;</span> VIRTUAL<br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><span style="color: #B900B9;">/*----------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> nPosition, nSize <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TStream<br />&nbsp; &nbsp;::<span style="color: #000000;">nPosition</span> := nPosition<br />&nbsp; &nbsp;::<span style="color: #000000;">nSize</span> &nbsp; &nbsp; := nSize<br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">Self</span><br /><br /><span style="color: #B900B9;">/*----------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> ReadLine<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TStream<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> cLine := <span style="color: #ff0000;">""</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> nByte := ::<span style="color: #000000;">ReadByte</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">WHILE</span> nByte != <span style="color: #00C800;">NIL</span> .AND. nByte != <span style="color: #000000;">10</span><br />&nbsp; &nbsp; &nbsp; cLine += Chr<span style="color: #000000;">&#40;</span> nByte <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> nByte == <span style="color: #000000;">13</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nByte := ::<span style="color: #000000;">ReadByte</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">IF</span> nByte == <span style="color: #000000;">10</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; EXIT<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cLine += Chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">13</span> <span style="color: #000000;">&#41;</span> + Chr<span style="color: #000000;">&#40;</span> nByte <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nByte := ::<span style="color: #000000;">ReadByte</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDDO</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> Empty<span style="color: #000000;">&#40;</span> cLine <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> cLine<br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">/*----------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> WriteLine<span style="color: #000000;">&#40;</span> cLine <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TStream<br />&nbsp; &nbsp;::<span style="color: #000000;">WriteBytes</span><span style="color: #000000;">&#40;</span> cLine + Chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">13</span> <span style="color: #000000;">&#41;</span> + Chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">10</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">/*----------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> ReadByte<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TStream<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> nByte<br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> ::<span style="color: #000000;">nPosition</span> < ::<span style="color: #000000;">nSize</span><br />&nbsp; &nbsp; &nbsp; nByte := ::<span style="color: #000000;">GetByte</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nPosition</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">nPosition</span>++<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> nByte<br />&nbsp; &nbsp;<span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">/*----------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> WriteByte<span style="color: #000000;">&#40;</span> nByte <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TStream<br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> ::<span style="color: #000000;">nPosition</span> < ::<span style="color: #000000;">nSize</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">SetByte</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nPosition</span>, nByte <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">nPosition</span>++<br />&nbsp; &nbsp;<span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">AppendByte</span><span style="color: #000000;">&#40;</span> nByte <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">nPosition</span>++<br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">nSize</span>++<br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">/*----------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> ReadBytes<span style="color: #000000;">&#40;</span> nCount <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TStream<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> aBytes<br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> ::<span style="color: #000000;">nPosition</span> + nCount <= ::<span style="color: #000000;">nSize</span><br />&nbsp; &nbsp; &nbsp; aBytes := ::<span style="color: #000000;">GetBytes</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nPosition</span>, nCount <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">nPosition</span> += nCount<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> aBytes<br />&nbsp; &nbsp;<span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">/*----------------------------------------------------------------------------*/</span><br /><br /><span style="color: #00C800;">METHOD</span> WriteBytes<span style="color: #000000;">&#40;</span> aBytes <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TStream<br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> ::<span style="color: #000000;">nPosition</span> + Len<span style="color: #000000;">&#40;</span> aBytes <span style="color: #000000;">&#41;</span> <= ::<span style="color: #000000;">nSize</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">SetBytes</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nPosition</span>, aBytes <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">nPosition</span> += Len<span style="color: #000000;">&#40;</span> aBytes <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">FOR</span> EACH nByte IN aBytes<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">WriteByte</span><span style="color: #000000;">&#40;</span> nByte <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">NEXT</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span></div>[/code:1ma2cg3x]
Ayuda con codigo C
Hola a todos. Quiero molestarles ahora, si alguien sabe como poder usar este codigo C con FWH por favor: [code=fw:14htnyl8]<div class="fw" id="{CB}" style="font-family: monospace;">--------------------------------------------------------------<br />| Codigo para lectura / registro de la huella<br />|<br />--------------------------------------------------------------<br /><br /><span style="color: #00D7D7;">#include</span> <iostream><br /><span style="color: #00D7D7;">#include</span> <windows.h><br /><span style="color: #00D7D7;">#include</span> <stdio.h><br /><span style="color: #00D7D7;">#include</span> <stdlib.h><br /><span style="color: #00D7D7;">#include</span> <string><br /><span style="color: #00D7D7;">#include</span> <fstream><br /><br />using namespace std;<br /><br />int main<span style="color: #000000;">&#40;</span>int argc, char *argv<span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />    string resultado = <span style="color: #ff0000;">""</span>;<br /><br />    <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span>argc==<span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><br />    <span style="color: #000000;">&#123;</span><br />        resultado = system<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"biometrico<span style="color: #000000;">\\</span>bspdemo_cs.exe  adndigital2021"</span><span style="color: #000000;">&#41;</span>;<br />        ifstream file<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"biometrico<span style="color: #000000;">\\</span>biometricohuella.txt"</span><span style="color: #000000;">&#41;</span>;<br />        string content;<br /><br />        <span style="color: #B900B9;">//--------------------------------------</span><br />        <span style="color: #B900B9;">// Lee el resultado del archivo</span><br />        <span style="color: #B900B9;">// La huella leida por el biometrico</span><br />        <span style="color: #B900B9;">//--------------------------------------</span><br />        <span style="color: #00C800;">while</span><span style="color: #000000;">&#40;</span>file >> content<span style="color: #000000;">&#41;</span><br />        <span style="color: #000000;">&#123;</span><br />            cout << content << <span style="color: #ff0000;">' '</span>;<br />        <span style="color: #000000;">&#125;</span><br /><br />    <span style="color: #000000;">&#125;</span><br /><br />    <span style="color: #00C800;">return</span> <span style="color: #000000;">0</span>;<br /><span style="color: #000000;">&#125;</span><br /><br /><br />--------------------------------------------------------------<br />| Codigo para comparar la huella contra una ya registrada<br />|<br />--------------------------------------------------------------<br /><br /><span style="color: #00D7D7;">#include</span> <iostream><br /><span style="color: #00D7D7;">#include</span> <windows.h><br /><span style="color: #00D7D7;">#include</span> <stdio.h><br /><span style="color: #00D7D7;">#include</span> <stdlib.h><br /><span style="color: #00D7D7;">#include</span> <string><br /><span style="color: #00D7D7;">#include</span> <fstream><br /><br />using namespace std;<br /><br />int main<span style="color: #000000;">&#40;</span>int argc, char *argv<span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />    string resultado = <span style="color: #ff0000;">""</span>;<br /><br />    <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span>argc==<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span><br />    <span style="color: #000000;">&#123;</span><br />        std::<span style="color: #000000;">string</span> cmd = <span style="color: #ff0000;">"biometrico<span style="color: #000000;">\\</span>bspdemo_cs.exe  adndigital2021"</span>;<br /><br />        <span style="color: #B900B9;">//</span><br />        <span style="color: #B900B9;">// argv[1] --> contiene el string de la huella a comparar</span><br />        <span style="color: #B900B9;">//</span><br />        cmd += argv<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>;<br /><br />        resultado = system<span style="color: #000000;">&#40;</span>cmd.c_str<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br /><br />        ifstream file<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"biometrico<span style="color: #000000;">\\</span>biometricoresultado.txt"</span><span style="color: #000000;">&#41;</span>; string content;<br /><br />        <span style="color: #B900B9;">//--------------------------------------</span><br />        <span style="color: #B900B9;">// Lee el resultado del archivo</span><br />        <span style="color: #B900B9;">// Matched</span><br />        <span style="color: #B900B9;">// Not Matched</span><br />        <span style="color: #B900B9;">//--------------------------------------</span><br />        <span style="color: #00C800;">while</span><span style="color: #000000;">&#40;</span>file >> content<span style="color: #000000;">&#41;</span><br />        <span style="color: #000000;">&#123;</span><br />            cout << content << <span style="color: #ff0000;">' '</span>;<br />        <span style="color: #000000;">&#125;</span><br />    <span style="color: #000000;">&#125;</span><br /><br />    <span style="color: #00C800;">return</span> <span style="color: #000000;">0</span>;<br /><span style="color: #000000;">&#125;</span></div>[/code:14htnyl8] Gracias anticipadas. Carlos
Ayuda con codigo C
Carlos, Prueba asi: WinExec( "biometrico\\bspdemo_cs.exe adndigital2021" ) MsgInfo( MemoRead( "biometrico\\biometricohuella.txt" ) )
Ayuda con codigo C
Antonio, gracias por tu respuesta. Yo hago las pruebas y comento luego. Este es un requerimiento de un cliente, que quiere utilizar los lectores biométricos Hamster IV Saludos cordiales. Carlos
Ayuda con codigo en c
Arme el ejemplo para actualización automática que mencionaron aqui [url:3qq14gm5]http&#58;//bielsys&#46;blogspot&#46;com/2009/04/actualizacion-automatica-de&#46;html[/url:3qq14gm5] y me funcionó perfectamente. El único problema es que yo personalmente, necesito re-arrancar mi aplicación pero enviándole un parámetro "/SERVER" y como no tengo muchos conocimientos de c, no se como hacerlo: Este es el código para actver.c que es parte del truco ( borra el ejecutable en uso y renombra el archivo descargado de internet ) y lo unique que atiné, fue a sacar el winexec ya que si no le envio el parametro /SERVER a mi no me sirve. Como habria que hacer para poder enviarle un parametro a WinExec ? seria mediante mediante argv[2] ? Tendria que ejecutar argv[1] /SERVER int main( int argc, char *argv[]) { // printf( argv[1] ); Sleep(700); DeleteFile( argv[1] ); rename( "tmp.exe",argv[1] ); // WinExec( argv[1], 1 ) ; // Aqui es donde necesito el parametro return EXIT_SUCCESS; } Antonio: por favor, podrias eliminar este post, asi no queda duplicado? [url:3qq14gm5]http&#58;//forums&#46;fivetechsupport&#46;com/viewtopic&#46;php?f=6&t=17365#p90343[/url:3qq14gm5] Muchas gracias!
Ayuda con codigo en c
Alejandro, Tendrias que concatenar los valores 1 y 2: [code=fw:3szf7y29]<div class="fw" id="{CB}" style="font-family: monospace;"><br />char cmd<span style="color: #000000;">&#91;</span> <span style="color: #000000;">200</span> <span style="color: #000000;">&#93;</span>;<br /><br />strcpy<span style="color: #000000;">&#40;</span> cmd, argv<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span>;<br />strcat<span style="color: #000000;">&#40;</span> cmd, argv<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span>; <span style="color: #B900B9;">// añade argv[ 2 ] al final del contenido de cmd (en donde este el cero, que indica fin de cadena)</span><br /><br />WinExec<span style="color: #000000;">&#40;</span> cmd, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> ;<br /> </div>[/code:3szf7y29] No borro el post como me pides, pues ya hay respuestas. Podemos enlazar aquel a este o viceversa <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Ayuda con codigo en c
Gracias Antonio! O sea que en cmd quedaria la concatenacion de argv[1] y argv[2], pero no deberia haber un espacio entre ambos? por que argv[1] es el nombre del fichero y argv[2] es "/SERVER" ??? En realidad me equivoque, quise decir que borraras mi comentario, no el post ya que es de otra persona. Muchas gracias!
Ayuda con codigo en c
Alejandro, Si quieres poner espacios puedes hacerlo asi: [code=fw:1xvljxo9]<div class="fw" id="{CB}" style="font-family: monospace;"><br />strcpy<span style="color: #000000;">&#40;</span> cmd, argv<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span>;<br />strcat<span style="color: #000000;">&#40;</span> cmd, <span style="color: #ff0000;">" "</span> <span style="color: #000000;">&#41;</span>;<br />strcat<span style="color: #000000;">&#40;</span> cmd, argv<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span>;<br /> </div>[/code:1xvljxo9] strcat() es similar a usar "+" con cadenas <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Ayuda con combox
Necesito colocar los campos de una base de datos en un combobox por ejemplo nombre, codigo clienteo es la descripcion y otro el codigo del cliente. Una vez que realicen esta operacion necesito que el codigo lo pueda capturar para poder realizar una busqueda en otro fichero, y no tengo ni idea de como hacerlo. Ya he buscado en el foro, pero no encuentro nigun ejemplo de este tipo GRACIAS
Ayuda con combox
Manuel, Primero crea y rellena un array con el contenido del campo ó campos que quieras mostrar: [code:qb0u5obj] local oCbx, cValor, aValores &#58;= &#123;&#125; Alias->&#40; DbGoTop&#40;&#41; &#41; while ! Alias->&#40; EoF&#40;&#41; &#41; AAdd&#40; aValores, Str&#40; Alias->Campo &#41; &#41; Alias->&#40; DbSkip&#40; 1 &#41; &#41; end @ &#46;&#46;&#46;, &#46;&#46;&#46; COMBOBOX oCbx VAR cValor ITEMS aValores &#46;&#46;&#46; ; ON CHANGE HazAlgo&#40; oCbx&#58;nAt &#41; [/code:qb0u5obj] oCbx:nAt es la posicion del elemento seleccionado. Tendrás que hacer un Alias->( DbGoTop() ), Alias->( DbSkip( oCbx:nAt ) ) para ir al registro seleccionado. En cValor tienes el valor seleccionado como cadena.
Ayuda con combox
OK, gracias
Ayuda con compilacion/make varios prgs
Estimados Colegas Tengo el siguiente archivo rmk y me esta dando error de sintaxis alguien me podria indicar como solucionarlo Gracias Fabian <!-- e --><a href="mailto:databaselab2002@yahoo.com.ar">databaselab2002@yahoo.com.ar</a><!-- e --> #Borland make sample, (c) FiveTech Software 2005 HBDIR=c:\Xharbour1 BCDIR=c:\bcc55 FWDIR=c:\fwh #change these paths as needed .path.PRG = .\ .path.OBJ = .\obj .path.CH = $(FWDIR)\include;$(HBDIR)\include .path.C = .\ .path.rc = .\ #important: Use Uppercase for filenames extensions, in the next two rules! PRG = \ Gvta.PRG \ Clientes.PRG \ CLIVen.PRG \ condicuo.PRG \ rubros.PRG \ tipocli.PRG \ zonas.PRG \ EXPRESOS.PRG \ fpagos.PRG \ alm.PRG \ libre.PRG \ PROVEEDO.PRG \ codiva.PRG \ monedas.PRG \ CLIPROVI.PRG \ TIPART.PRG \ GARTIC.PRG \ TUNI.PRG \ marcas.PRG \ COLORES.PRG \ tipcb.PRG \ BANCO.PRG \ tipmcb.PRG \ zoomprov.PRG \ genrep.PRG \ ZOOMEXP.PRG \ ZOOMCVE.PRG \ REPRUB.PRG \ REPTCLI.PRG \ COMPROB.PRG \ TALONAR.PRG \ prog_usu.PRG \ usucpb.PRG \ archabm.PRG \ indices.PRG \ parametr.PRG \ ARTICU.PRG \ zoomreg.PRG \ GRID.PRG \ REPCLI.PRG \ REPPROVE.PRG \ ZoomVen.PRG \ ZoomTCL.PRG \ REPPROV.PRG \ REPCOV.PRG \ REPZON.PRG \ REPEXP.PRG \ REPALM.PRG \ ZOOMMON.PRG \ REPFPAG.PRG \ REPCIVA.PRG \ REPMON.PRG \ REPROVI.PRG \ zoomcli.PRG \ zoomRUB.PRG \ zoomtun.PRG \ zoomPRO.PRG \ zoomcol.PRG \ REPART .PRG \ REPTART.PRG \ REPMAR.PRG \ REPGAR.PRG \ REPTUNI.PRG \ REPCOL.PRG \ REPBAN.PRG \ REPTTCP.PRG \ REPTMCB.PRG \ PAISES.PRG \ REPPAS.PRG \ REPVEN.PRG \ CLIART.PRG \ pCLIART.PRG \ zoomart.PRG \ REPLIST.PRG \ PERSONAL.PRG \ REPERS.PRG \ CUENTA.PRG \ REPCUE.PRG \ RElctabc.PRG \ zoomban.PRG \ repRELC.PRG \ EPRODUC.PRG \ cotiza.PRG \ REPEPRO.PRG \ REPCOTI.PRG C = \ PROJECT : GVTA.exe GVTA.exe : $(PRG:.PRG=.OBJ) $(C:.C=.OBJ) GVTA.res echo off Echo $(BCDIR)\bin\c0w32.obj + > b32.bc echo obj\Gvta.OBJ obj\Clientes.OBJ obj\CLIVen.OBJ obj\condicuo.OBJ, + > b32.bc echo obj\rubros.OBJ obj\tipocli.OBJ obj\zonas.OBJ obj\EXPRESOS.OBJ, + > b32.bc echo obj\fpagos.OBJ obj\alm.OBJ obj\libre.OBJ obj\PROVEEDO.OBJ, + > b32.bc echo obj\codiva.OBJ obj\monedas.OBJ obj\CLIPROVI.OBJ obj\TIPART.OBJ , + > b32.bc echo obj\GARTIC.OBJ obj\TUNI.OBJ obj\marcas.OBJ obj\COLORES.OBJ , + > b32.bc echo obj\tipcb.OBJ obj\BANCO.OBJ obj\tipmcb.OBJ obj\zoomprov.OBJ, + > b32.bc echo obj\genrep.OBJ obj\ZOOMEXP.OBJ obj\ZOOMCVE.OBJ obj\REPRUB.OBJ , + > b32.bc echo obj\REPTCLI.OBJ obj\COMPROB.OBJ obj\TALONAR.OBJ obj\prog_usu.OBJ, + > b32.bc echo obj\usucpb.OBJ obj\archabm.OBJ obj\indices.OBJ obj\parametr.OBJ, + > b32.bc echo obj\ARTICU.OBJ obj\zoomreg.OBJ obj\GRID.OBJ obj\REPCLI.OBJ , + > b32.bc echo obj\REPPROVE.OBJ obj\ZoomVen.OBJ obj\ZoomTCL.OBJ obj\REPPROV.OBJ , + > b32.bc echo obj\REPCOV.OBJ obj\REPZON.OBJ obj\REPEXP.OBJ obj\REPALM.OBJ , + > b32.bc echo obj\ZOOMMON.OBJ obj\REPFPAG.OBJ obj\REPCIVA.OBJ obj\REPMON.OBJ , + > b32.bc echo obj\REPROVI.OBJ obj\zoomcli.OBJ obj\zoomRUB.OBJ obj\zoomtun.OBJ, + > b32.bc echo obj\zoomPRO.OBJ obj\zoomcol.OBJ obj\REPART .OBJ obj\REPTART.OBJ , + > b32.bc echo obj\REPMAR.OBJ obj\REPGAR.OBJ obj\REPTUNI.OBJ obj\REPCOL.OBJ , + > b32.bc echo obj\REPBAN.OBJ obj\REPTTCP.OBJ obj\REPTMCB.PRG obj\PAISES.OBJ , + > b32.bc echo obj\REPPAS.OBJ obj\REPVEN.OBJ obj\CLIART.OBJ obj\pCLIART.OBJ , + > b32.bc echo obj\zoomart.OBJ obj\REPLIST.OBJ obj\REPTMCB.PRG obj\PAISES.OBJ , + > b32.bc echo obj\CUENTA.OBJ obj\REPCUE.OBJ obj\REPPAS.OBJ obj\REPVEN.OBJ .\RElctabc.OBJ .\zoomban.OBJ , + > b32.bc echo obj\repRELC.OBJ obj\EPRODUC.OBJ obj\cotiza.OBJ obj\REPEPRO.OBJ .\PERSONAL.OBJ .\REPERS.OBJ , + > b32.bc echo obj\REPCOTI.OBJ echo $(FWDIR)\lib\FiveH.lib $(FWDIR)\lib\FiveHC.lib + >> b32.bc echo $(HBDIR)\lib\b32\rtl.lib + >> b32.bc echo $(HBDIR)\lib\b32\vm.lib + >> b32.bc echo $(HBDIR)\lib\b32\gtwin.lib + >> b32.bc echo $(HBDIR)\lib\b32\lang.lib + >> b32.bc echo $(HBDIR)\lib\b32\macro.lib + >> b32.bc echo $(HBDIR)\lib\b32\rdd.lib + >> b32.bc echo $(HBDIR)\lib\b32\dbfntx.lib + >> b32.bc echo $(HBDIR)\lib\b32\dbfcdx.lib + >> b32.bc echo $(HBDIR)\lib\b32\dbfdbt.lib + >> b32.bc echo $(HBDIR)\lib\b32\debug.lib + >> b32.bc echo $(HBDIR)\lib\b32\common.lib + >> b32.bc echo $(HBDIR)\lib\b32\pp.lib + >> b32.bc echo $(HBDIR)\lib\b32\codepage.lib + >> b32.bc rem Uncomment these two lines to use Advantage RDD rem echo $(HBDIR)\lib\b32\rddads.lib + >> b32.bc rem echo $(HBDIR)\lib\b32\Ace32.lib + >> b32.bc echo $(BCDIR)\lib\cw32.lib + >> b32.bc echo $(BCDIR)\lib\import32.lib + >> b32.bc echo $(BCDIR)\lib\psdk\odbc32.lib + >> b32.bc echo $(BCDIR)\lib\psdk\nddeapi.lib + >> b32.bc echo $(BCDIR)\lib\psdk\iphlpapi.lib + >> b32.bc echo $(BCDIR)\lib\psdk\rasapi32.lib, >> b32.bc IF EXIST Alert.res echo Alert.res >> b32.bc $(BCDIR)\bin\ilink32 -Gn -aa -Tpe -s @b32.bc del b32.bc .PRG.OBJ: $(HBDIR)\bin\b32\harbour $< /L /N /W /Oobj\ /I$(FWDIR)\include;$(HBDIR)\include $(BCDIR)\bin\bcc32 -c -tWM -I$(HBDIR)\include -oobj\$& obj\$&.c .C.OBJ: echo -c -tWM -D__HARBOUR__ -DHB_API_MACROS > tmp echo -I$(HBDIR)\include;$(FWDIR)\include >> tmp $(BCDIR)\bin\bcc32 -oobj\$& @tmp $&.c del tmp gvta.res : gvta.rc $(BCDIR)\bin\brc32.exe -r Alert.rc 
Ayuda con compilacion/make varios prgs
> me esta dando error de sintaxis Que error exactamente te aparece ?
Ayuda con compilacion/make varios prgs
Estimado Antonio en estas lineas y subsiguientes me da command syntax error Echo $(BCDIR)\bin\c0w32.obj + > b32.bc echo obj\Gvta.OBJ obj\Clientes.OBJ obj\CLIVen.OBJ obj\condicuo.OBJ, + > b32.bc echo obj\rubros.OBJ obj\tipocli.OBJ obj\zonas.OBJ obj\EXPRESOS.OBJ, + > b32.bc echo obj\fpagos.OBJ obj\alm.OBJ obj\libre.OBJ obj\PROVEEDO.OBJ, + > b32.bc echo obj\codiva.OBJ obj\monedas.OBJ obj\CLIPROVI.OBJ obj\TIPART.OBJ , + > b32.bc echo obj\GARTIC.OBJ obj\TUNI.OBJ obj\marcas.OBJ obj\COLORES.OBJ , + > b32.bc echo obj\tipcb.OBJ obj\BANCO.OBJ obj\tipmcb.OBJ obj\zoomprov.OBJ, + > b32.bc echo obj\genrep.OBJ obj\ZOOMEXP.OBJ obj\ZOOMCVE.OBJ obj\REPRUB.OBJ , + > b32.bc Gracias Saludos Fabian
Ayuda con compilacion/make varios prgs
Fabian, Ojo que a partir de la segunda debes usar >> en vez de >
Ayuda con comunicacion TCP IP
Hola. Estoy tratando de comunicarme a traves de tcpip con un hardware que le envio un comando y recibo una respuesta. Mi problema es que la respuesta viene en binario de 8 bits, pero siempre el primer byte es nul entonces me indican quienes fabrican el hard que debo pasar esto a hexa para poder ver algo ya que el primer nul cancelaria la recepcion. Estoy usando esta funcion que encontre aca pero no me coincide la respuesta con lo que deberia. function BinToHex( cBin ) local n, nResult := 0 for n = Len( cBin ) to 1 step -1 if SubStr( cBin, n, 1 ) == "1" nResult += 2 ^ ( Len( cBin ) - n ) endif next return DecToHex( nResult ) Pruebo con un programa llamado Docklight Scripting y el hard responde correctamente, pero mi aplicacion no. La gente que provee este hard usa VBasic y no saben muy bien que decirme ya que ese lenguaje convierte en forma automatica una recepcion de binario a decimal, pero Yo en realidad no se bien que recibo. Antes de poner esta consulta probe de todo. Muchas Gracias.
Ayuda con comunicacion TCP IP
Perdon por la molestia, ya logre que funcione. Gracias.
Ayuda con comunicacion TCP IP
Jorge: Podrias colocar la solucion,
Ayuda con comunicacion TCP IP
Jorge buenas tardes El dia de ayer inicie un desarrollo en el cual necesito realizar algo parecido, es posible me ayudes indicandome como envio los comandos via tcpip y como tranformar la respuesta a hex. de ante mano gracias Saludos Oscar
Ayuda con comunicacion TCP IP
Este es un caso muy particular ya que el primer byte de la respuesta siempre es nul, esto hace que el evento de lectura asuma que ahi termina la transmision y no recibe mas, por lo tanto nunca recibia nada. Esto lleva a tener que pasar los byte recibidos a hexa o a decimal, la funcion que probe es la siguiente: // Esto lo compile y funciono bien asumiendo una cadena de byte de 8 bits separados por un espacio, lo que no significa que siempre venga // asi, eso depende de lo que tu servidor envie, esa informacion deberia dartela quien desarrollo el server. // Todo lo paso directo a caracter que en definitiva era lo que necesitaba. #include "FiveWin.ch" Function Main() Local Var Var:="00100110 00100000 00101110 00101111" MsgInfo(BinToChr(Var),"Resultado") Return nil Function BinToChr(cBin) Local n,q,nResult,Retorno,NumBin Retorno:="" NumBin :="" For q=1 To Len(cBin) IF SUBSTR(cBin,q,1)==" " NumBin:="" ELSE NumBin:=NumBin+SUBSTR(cBin,q,1) ENDIF IF LEN(NumBin)=8 nResult:=0 For n=8 to 1 Step -1 IF SubStr(NumBin,n,1)=="1" nResult += 2 ^ ( 8-n ) endif Next Retorno:=Retorno+CHR(INT(nResult)) ENDIF Next Return Retorno // En mi problema en particular esto no funciono, a pesar de que el modelo de arriba funciona perfecto. Aclaro que los proveedores del hard no son los autores del protocolo de comunicacion, entonces tampoco podian informarme bien, asi que tenia que arreglarmelas un poco solo. Entre tantas pruebas, por casualidad el exe produce un error y graba el ya conocido error.log, cuando lo abro a ver que habia hecho mal me encuentro con la grata sorpresa que en el primer argumento (la variable que supuestamente contenia la lectura recibida y yo no podia ver) estaba la cadena de caracteres tal cual como yo queria obtenerla. Por lo tanto deje de probar otras cosas y mire como hace FWH para generar el error.log e hice exactamente lo mismo y obtuve un archivo plano con una linea que contenia lo que queria obtener. Aqui muestro la solucion. // Esto es para establecer la comunicacion, enviar el comando y recibir la respuesta, en este caso en particular el server se cierra solo // despues de enviar la respuesta. Function EnvioComando() Local oSocket oSocket:= TSocket():New( 997 ) && Aca creo el socket, el puerto (997) deberia decirtelo el que desarrollo el server. oSocket:bRead:= { | oSocket | VerResSer(oSocket:GetData()) } && Este es el evento de lectura, aca recibe la respuesta oSocket:Connect( "192.168.0.150" ) && Esta es la ip donde esta el server. oSocket:SendData("q") && Aca envio un comando, los comandos deberian ser indicados por quien desarrollo el server. // oSocket:End() && Solo si el server no se cierra solo y quiero cerrar el puerto. En mi caso esto no va. Return nil // En la siguiente funcion entra la respuesta como parametro y simplemente se graba en el archivo de texto, de ahi en mas uno hace lo que // quiere, pero ya esta en formato legible. Yo lo paso a una dbf porque me sirve para lo que quiero hacer pero podes leerlo directo del txt. Function VerResSer(Dato) MemoWrit( "Resp.txt", cValToChar(Dato) ) && Asi graba el error.log USE BASE NEW APPEND FROM Resp.txt SDF CLOSE Return nil Aclaro que todo esto comenzo probando con los ejemplos de la clase TSocket que trae FWH, pueden encontrar un ejemplo de server y otro de cliente, es muy facil de usar, el problema surge cuando tenes que interactuar con un server que no conoces y no tenes mucha ayuda como me paso a mi, por eso tuve que hacer lo del archivo de texto, no es muy elegante pero anda. Esta es la solucion que yo encontre para mi caso particular, no significa que sea universal, disculpen que me extendi pero trate de ser lo mas claro posible. Espero sirva Saludos. Jorge G. Jaurena
Ayuda con comunicacion TCP IP
Jorge gracias voy a probar para mi caso.
Ayuda con correcta instruccion en sql
amigos, necesito de su ayuda <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->mil gracias por adelantado.estoy iniciando a usar sql en una app que usa ads local.y tengo la siguiente instruccion:[code:23feno95] PROCEDURE TestSql LOCAL cSql&#58;="" cSql &#58;= StrFormat&#40;"SELECT NUMERO, FECHA, TOTAL FROM MSALIDAS WHERE TIPO = %1 AND FECHA = %2", Ads2Str&#40;"VL"&#41;, Ads2Str&#40; CToD&#40;"25/07/2008" &#41; &#41; &#41; ?cSql ADSCreateSQLStatement&#40; "prueba", 2 &#41; IF ADSExecuteSQLDirect&#40; cSql &#41; PRUEBA->&#40; DBGoTop&#40;&#41; &#41; PRUEBA->&#40; Browse&#40;&#41; &#41; PRUEBA->&#40; DBCloseArea&#40;&#41; &#41; ENDIF RETURN [/code:23feno95] [code:23feno95] FUNCTION ADS2Str&#40;xVar&#41; LOCAL cVar cVar &#58;= "'" + HB_ValToStr&#40;xVar&#41; + "'" RETURN cVa [/code:23feno95]la pregunta es: Para un campo de tipo logico, como se implementaria en la cadena sql ?NOTA:strformat es una funcion que tiene por parametros una cadena y x numero de posibles valores a reempalzar en la cadena:StrFormat( "%1 %2, %3", "Uno-","Dos-","Tres")=>"Uno-Dos-Tres"1.-cSql := StrFormat("SELECT NUMERO, FECHA, TOTAL FROM MSALIDAS WHERE TIPO = %1 AND FECHA = %2 AND ANULADA=[color=red:23feno95]%3[/color:23feno95]", Ads2Str("VL"), Ads2Str( CToD("25/07/2008" ) ), [color=red:23feno95].t.[/color:23feno95] ) 2.-cSql := StrFormat("SELECT NUMERO, FECHA, TOTAL FROM MSALIDAS WHERE TIPO = %1 AND FECHA = %2 ANF ANULADA=[color=red:23feno95]%3[/color:23feno95]", Ads2Str("VL"), Ads2Str( CToD("25/07/2008" ) ), [color=red:23feno95]'True'[/color:23feno95] )salu2carlos vargas
Ayuda con correcta instruccion en sql
Carlos:No trabajo con ADS, uso MySql y con MySql el campo lógico lo defino como tipo BIT y sus valores posibles son 0000000 ó 00000001 por lo tanto para evaluarlo lo comparo contra valor 0 (falso) o valor 1 (Verdadero)Espero que esto te oriente.Saludos
Ayuda con correcta instruccion en sql
Hola Armandorevisa esto:Listado y descripción de los distintos tipos de datos de MySQL.Después de la fase de diseño de una base de datos, y una vez se ha realizado el paso a tablas del mismo, en necesario crear las tablas correspondientes dentro de la base de datos. Para cada campo de cada una de las tablas, es necesario determinar el tipo de datos que contiene, para de esa forma ajustar el diseño de la base de datos, y conseguir un almacenamiento óptimo con la menor utilización de espacio. El presente artículo describe cada uno de los tipos de datos que puede tener un campo en Mysql, para la versión 4.xx.xx. Los tipos de datos que puede haber en un campo, se pueden agrupar en tres grandes grupos: Tipos numéricos Tipos de Fecha Tipos de Cadena 1 Tipos numéricos: Existen tipos de datos numéricos, que se pueden dividir en dos grandes grupos, los que están en coma flotante (con decimales) y los que no. TinyInt: es un número entero con o sin signo. Con signo el rango de valores válidos va desde -128 a 127. Sin signo, el rango de valores es de 0 a 255 Bit ó Bool: un número entero que puede ser 0 ó 1 SmallInt: número entero con o sin signo. Con signo el rango de valores va desde -32768 a 32767. Sin signo, el rango de valores es de 0 a 65535. MediumInt: número entero con o sin signo. Con signo el rango de valores va desde -8.388.608 a 8.388.607. Sin signo el rango va desde 0 a16777215. Integer, Int: número entero con o sin signo. Con signo el rango de valores va desde -2147483648 a 2147483647. Sin signo el rango va desde 0 a 429.4967.295 BigInt: número entero con o sin signo. Con signo el rango de valores va desde -9.223.372.036.854.775.808 a 9.223.372.036.854.775.807. Sin signo el rango va desde 0 a 18.446.744.073.709.551.615. Float: número pequeño en coma flotante de precisión simple. Los valores válidos van desde -3.402823466E+38 a -1.175494351E-38, 0 y desde 1.175494351E-38 a 3.402823466E+38. xReal, Double: número en coma flotante de precisión doble. Los valores permitidos van desde -1.7976931348623157E+308 a -2.2250738585072014E-308, 0 y desde 2.2250738585072014E-308 a 1.7976931348623157E+308 Decimal, Dec, Numeric: Número en coma flotante desempaquetado. El número se almacena como una cadena Tipo de Campo Tamaño de Almacenamiento TINYINT 1 byte SMALLINT 2 bytes MEDIUMINT 3 bytes INT 4 bytes INTEGER 4 bytes BIGINT 8 bytes FLOAT(X) 4 ú 8 bytes FLOAT 4 bytes DOUBLE 8 bytes DOUBLE PRECISION 8 bytes REAL 8 bytes DECIMAL(M,D M+2 bytes sí D > 0, M+1 bytes sí D = 0 NUMERIC(M,D) M+2 bytes if D > 0, M+1 bytes if D = 0 2 Tipos fecha: A la hora de almacenar fechas, hay que tener en cuenta que Mysql no comprueba de una manera estricta si una fecha es válida o no. Simplemente comprueba que el mes esta comprendido entre 0 y 12 y que el día esta comprendido entre 0 y 31. Date: tipo fecha, almacena una fecha. El rango de valores va desde el 1 de enero del 1001 al 31 de diciembre de 9999. El formato de almacenamiento es de año-mes-dia DateTime: Combinación de fecha y hora. El rango de valores va desde el 1 de enero del 1001 a las 0 horas, 0 minutos y 0 segundos al 31 de diciembre del 9999 a las 23 horas, 59 minutos y 59 segundos. El formato de almacenamiento es de año-mes-dia horas:minutos:segundos TimeStamp: Combinación de fecha y hora. El rango va desde el 1 de enero de 1970 al año 2037. El formato de almacenamiento depende del tamaño del campo: Tamaño Formato 14 AñoMesDiaHoraMinutoSegundo aaaammddhhmmss 12 AñoMesDiaHoraMinutoSegundo aammddhhmmss 8 ñoMesDia aaaammdd 6 AñoMesDia aammdd 4 AñoMes aamm 2 Año aa Time: almacena una hora. El rango de horas va desde -838 horas, 59 minutos y 59 segundos a 838, 59 minutos y 59 segundos. El formato de almacenamiento es de 'HH:MM:SS' Year: almacena un año. El rango de valores permitidos va desde el año 1901 al año 2155. El campo puede tener tamaño dos o tamaño 4 dependiendo de si queremos almacenar el año con dos o cuatro dígitos. Tipo de Campo Tamaño de Almacenamiento DATE 3 bytes DATETIME 8 bytes TIMESTAMP 4 bytes TIME 3 bytes YEAR 1 byte 3 Tipos de cadena: Char(n): almacena una cadena de longitud fija. La cadena podrá contener desde 0 a 255 caracteres. VarChar(n): almacena una cadena de longitud variable. La cadena podrá contener desde 0 a 255 caracteres. Dentro de los tipos de cadena se pueden distinguir otros dos subtipos, los tipo Test y los tipo BLOB (Binary large Object) La diferencia entre un tipo y otro es el tratamiento que reciben a la hora de realizar ordenamientos y comparaciones. Mientras que el tipo test se ordena sin tener en cuenta las Mayúsculas y las minúsculas, el tipo BLOB se ordena teniéndolas en cuenta. Los tipos BLOB se utilizan para almacenar datos binarios como pueden ser ficheros. TinyText y TinyBlob: Columna con una longitud máxima de 255 caracteres. Blob y Text: un texto con un máximo de 65535 caracteres. MediumBlob y MediumText: un texto con un máximo de 16.777.215 caracteres. LongBlob y LongText: un texto con un máximo de caracteres 4.294.967.295. Hay que tener en cuenta que debido a los protocolos de comunicación los paquetes pueden tener un máximo de 16 Mb. Enum: campo que puede tener un único valor de una lista que se especifica. El tipo Enum acepta hasta 65535 valores distintos Set: un campo que puede contener ninguno, uno ó varios valores de una lista. La lista puede tener un máximo de 64 valores. Tipo de campo Tamaño de Almacenamiento CHAR(n) n bytes VARCHAR(n) n +1 bytes TINYBLOB, TINYTEXT Longitud+1 bytes BLOB, TEXT Longitud +2 bytes MEDIUMBLOB, MEDIUMTEXT Longitud +3 bytes LONGBLOB, LONGTEXT Longitud +4 bytes ENUM('value1','value2',...) 1 ó dos bytes dependiendo del número de valores SET('value1','value2',...) 1, 2, 3, 4 ó 8 bytes, dependiendo del número de valores Diferencia de almacenamiento entre los tipos Char y VarChar Valor CHAR(4) Almacenamiento VARCHAR(4) Almacenamiento '' '' 4 bytes " 1 byte 'ab' 'ab ' 4 bytes 'ab' 3 bytes 'abcd' 'abcd' 4 bytes 'abcd' 'abcdefgh' 'abcd' 4 bytes 'abcd' 5 bytes
Ayuda con correcta instruccion en sql
WilliExcelente este post. Muy ilustrativo. Gracias
Ayuda con correcta instruccion en sql
Willi:Siempre se aprende algo nuevo !Un abrazo
Ayuda con correcta instruccion en sql
Carlos,utiliza =True =FalsesaludosMarcelo
Ayuda con correcta instruccion en sql
Amigos, mil gracias por la ayuda.es muy util esto del sql con ads en modo local, lo estoy usando principalmente para la generacion de reportes.luego veremos <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->salu2
Ayuda con correcta instruccion en sql
willi, Si tengo un campo definido como TINYINT y le hago un FieldType(xCampo) me devuelve un tipo logico.... porque?Gracias.[quote="Willi Quintana":1tyvos41]Hola Armando revisa esto: Listado y descripción de los distintos tipos de datos de MySQL. Después de la fase de diseño de una base de datos, y una vez se ha realizado el paso a tablas del mismo, en necesario crear las tablas correspondientes dentro de la base de datos. Para cada campo de cada una de las tablas, es necesario determinar el tipo de datos que contiene, para de esa forma ajustar el diseño de la base de datos, y conseguir un almacenamiento óptimo con la menor utilización de espacio. El presente artículo describe cada uno de los tipos de datos que puede tener un campo en Mysql, para la versión 4.xx.xx. Los tipos de datos que puede haber en un campo, se pueden agrupar en tres grandes grupos: Tipos numéricos Tipos de Fecha Tipos de Cadena 1 Tipos numéricos: Existen tipos de datos numéricos, que se pueden dividir en dos grandes grupos, los que están en coma flotante (con decimales) y los que no. TinyInt: es un número entero con o sin signo. Con signo el rango de valores válidos va desde -128 a 127. Sin signo, el rango de valores es de 0 a 255 Bit ó Bool: un número entero que puede ser 0 ó 1 SmallInt: número entero con o sin signo. Con signo el rango de valores va desde -32768 a 32767. Sin signo, el rango de valores es de 0 a 65535. MediumInt: número entero con o sin signo. Con signo el rango de valores va desde -8.388.608 a 8.388.607. Sin signo el rango va desde 0 a16777215. Integer, Int: número entero con o sin signo. Con signo el rango de valores va desde -2147483648 a 2147483647. Sin signo el rango va desde 0 a 429.4967.295 BigInt: número entero con o sin signo. Con signo el rango de valores va desde -9.223.372.036.854.775.808 a 9.223.372.036.854.775.807. Sin signo el rango va desde 0 a 18.446.744.073.709.551.615. Float: número pequeño en coma flotante de precisión simple. Los valores válidos van desde -3.402823466E+38 a -1.175494351E-38, 0 y desde 1.175494351E-38 a 3.402823466E+38. xReal, Double: número en coma flotante de precisión doble. Los valores permitidos van desde -1.7976931348623157E+308 a -2.2250738585072014E-308, 0 y desde 2.2250738585072014E-308 a 1.7976931348623157E+308 Decimal, Dec, Numeric: Número en coma flotante desempaquetado. El número se almacena como una cadena Tipo de Campo Tamaño de Almacenamiento TINYINT 1 byte SMALLINT 2 bytes MEDIUMINT 3 bytes INT 4 bytes INTEGER 4 bytes BIGINT 8 bytes FLOAT(X) 4 ú 8 bytes FLOAT 4 bytes DOUBLE 8 bytes DOUBLE PRECISION 8 bytes REAL 8 bytes DECIMAL(M,D M+2 bytes sí D > 0, M+1 bytes sí D = 0 NUMERIC(M,D) M+2 bytes if D > 0, M+1 bytes if D = 0 2 Tipos fecha: A la hora de almacenar fechas, hay que tener en cuenta que Mysql no comprueba de una manera estricta si una fecha es válida o no. Simplemente comprueba que el mes esta comprendido entre 0 y 12 y que el día esta comprendido entre 0 y 31. Date: tipo fecha, almacena una fecha. El rango de valores va desde el 1 de enero del 1001 al 31 de diciembre de 9999. El formato de almacenamiento es de año-mes-dia DateTime: Combinación de fecha y hora. El rango de valores va desde el 1 de enero del 1001 a las 0 horas, 0 minutos y 0 segundos al 31 de diciembre del 9999 a las 23 horas, 59 minutos y 59 segundos. El formato de almacenamiento es de año-mes-dia horas:minutos:segundos TimeStamp: Combinación de fecha y hora. El rango va desde el 1 de enero de 1970 al año 2037. El formato de almacenamiento depende del tamaño del campo: Tamaño Formato 14 AñoMesDiaHoraMinutoSegundo aaaammddhhmmss 12 AñoMesDiaHoraMinutoSegundo aammddhhmmss 8 ñoMesDia aaaammdd 6 AñoMesDia aammdd 4 AñoMes aamm 2 Año aa Time: almacena una hora. El rango de horas va desde -838 horas, 59 minutos y 59 segundos a 838, 59 minutos y 59 segundos. El formato de almacenamiento es de 'HH:MM:SS' Year: almacena un año. El rango de valores permitidos va desde el año 1901 al año 2155. El campo puede tener tamaño dos o tamaño 4 dependiendo de si queremos almacenar el año con dos o cuatro dígitos. Tipo de Campo Tamaño de Almacenamiento DATE 3 bytes DATETIME 8 bytes TIMESTAMP 4 bytes TIME 3 bytes YEAR 1 byte 3 Tipos de cadena: Char(n): almacena una cadena de longitud fija. La cadena podrá contener desde 0 a 255 caracteres. VarChar(n): almacena una cadena de longitud variable. La cadena podrá contener desde 0 a 255 caracteres. Dentro de los tipos de cadena se pueden distinguir otros dos subtipos, los tipo Test y los tipo BLOB (Binary large Object) La diferencia entre un tipo y otro es el tratamiento que reciben a la hora de realizar ordenamientos y comparaciones. Mientras que el tipo test se ordena sin tener en cuenta las Mayúsculas y las minúsculas, el tipo BLOB se ordena teniéndolas en cuenta. Los tipos BLOB se utilizan para almacenar datos binarios como pueden ser ficheros. TinyText y TinyBlob: Columna con una longitud máxima de 255 caracteres. Blob y Text: un texto con un máximo de 65535 caracteres. MediumBlob y MediumText: un texto con un máximo de 16.777.215 caracteres. LongBlob y LongText: un texto con un máximo de caracteres 4.294.967.295. Hay que tener en cuenta que debido a los protocolos de comunicación los paquetes pueden tener un máximo de 16 Mb. Enum: campo que puede tener un único valor de una lista que se especifica. El tipo Enum acepta hasta 65535 valores distintos Set: un campo que puede contener ninguno, uno ó varios valores de una lista. La lista puede tener un máximo de 64 valores. Tipo de campo Tamaño de Almacenamiento CHAR(n) n bytes VARCHAR(n) n +1 bytes TINYBLOB, TINYTEXT Longitud+1 bytes BLOB, TEXT Longitud +2 bytes MEDIUMBLOB, MEDIUMTEXT Longitud +3 bytes LONGBLOB, LONGTEXT Longitud +4 bytes ENUM('value1','value2',...) 1 ó dos bytes dependiendo del número de valores SET('value1','value2',...) 1, 2, 3, 4 ó 8 bytes, dependiendo del número de valores Diferencia de almacenamiento entre los tipos Char y VarChar Valor CHAR(4) Almace namiento VARCHAR(4) Almace namiento '' '' 4 bytes " 1 byte 'ab' 'ab ' 4 bytes 'ab' 3 bytes 'abcd' 'abcd' 4 bytes 'abcd' 'abcdefgh' 'abcd' 4 bytes 'abcd' 5 bytes[/quote:1tyvos41]
Ayuda con correcta instruccion en sql
Holas,Debe devolver "N"Salu2
Ayuda con correcta instruccion en sql
Deberia de... voy a ver la tmysql.prg a ver que dice.Aca lo deuelve como logico.[quote="Willi Quintana":2q6evs9r]Holas, Debe devolver "N" Salu2[/quote:2q6evs9r]
Ayuda con corrupcion en campo memo
Hola amigos del foro Tengo una base de datos que contiene un campo memo el cual en algunos momentos se "corrompe", para hacer la correccion, abro dicha DBF con en clasico DBUM, busco el registro con el problema, edito el contenido del campo memo y con eso se resuelve el problema. Lo que deseo hacer es un programa que recorra dicha base de datos y que detecte y repare en forma automatica el problema. Me gustaria saber la forma en la que puedo hacer dicho procedimiento. He intentando hacer un ciclo por medio del cual detectar el problema y resolverlo pero no he tenido exito. Agradezco a quien me pueda brindar una ayuda con dicho tema Gracias. Saludos BEGIN SEQUENCE bVError = ErrorBlock( { | o | VBreak( o ) } ) USE \TEMP\INVENT EXCLU NEW ALIAS "TOFIX" DO WHILE !EOF() cTXT:=FIELD->COMENTARIO IF cTXT=NIL cTXT:='' ENDIF FIELD->COMENTARIO:=cTXT SKIP ENDDO END SEQUENCE ErrorBlock( bVError ) ?'OK' QUIT static function VBreak( oError ) FIELD->COMENTARIO:='' lNoError:=.F. BREAK return nil
Ayuda con corrupcion en campo memo
orbex, Se precisaría mas informacion: compilador, rdd usado, ¿ por qué reparar y no evitar el problema ?
Ayuda con corrupcion en campo memo
Orbex, Tenía problemas con los campos memo y es que a veces "aparecía" en ellos información de otros memos y no la que se había guardado. Esto pasaba muy de vez en cuando pero, cuando lo hacía era un verdadero problema. De acuerdo con lo sugerido por algunos integrantes del foro, revisé el programa en donde se "manejaba" este memo y lo reescribí dos veces pero el error en los memos seguía (muy de vez en cuando). Te comento que el problema comenzó cuando se conectó el sistema a tres pc en red, antes de eso y con una sola pc jamás hizo la falla. Todas con el mismo so (XP) sólo que una de las pc es un poco más vieja y lenta. La solución llegó cuando comencé a usar al ADS. NUNCA MÁS CORRUPCIÓN EN CAMPOS MEMOS. Ahora son tan confiables que incluso guardo en ellos infomación del seteo del sistema y otros datos importantísimos en foma de arrays multidimensionales y JAMÁS volví a tener problemas. No se si será tu caso pero espero que te ayude en algo mi respuesta. Saludos. Rolando <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Ayuda con corrupcion en campo memo
Gracias por contestar Rolando Se que con ADS se solucionan todos esos problemas, pero muchos de mis clientes no van a querer comprar la licencia de ADS y todos utilizan el sistema en red con por lo menos 3 pc... por eso estaba buscando una solucion gratuita de ser posible... Gracias en todo caso por tu sugerencia Saludos
Ayuda con creación de GETs dinámicos (Solucionado)
Hola amigosMe ha surgido la necesidad de generar un diálogo con unos gets que se deben crear dinámicamente, es decir que bien puede tener 2 o n gets dependiendo de cuántos campos tenga una tabla. Puede alguien darme una mano por favor.Con el siguiente código me genera bien los says, también se dibujan los gets pero parece que el valor de todos los gets creados toman el del último.[code:2mqnow3i] local asay&#58;=array&#40;nfields&#41; //Texto para los says local aoget&#58;=array&#40;nfields&#41; //Variables para los objeto Get local avarget&#58;=array&#40;nfields&#41; //Variables con el contenido del oGet for n&#58;=1 to nfields asay&#91;n&#93;&#58;=ors&#58;Fields&#40;n-1&#41;&#58;Name //Asigno nombre del campo avarget&#91;n&#93;&#58;=cvaltochar&#40;ors&#58;Fields&#40;n-1&#41;&#58;Value&#41; //Asig el valor next DEFINE dialog odlgReg from 1,1 to &#40;nfields*30&#41;+30,150 title "Edición de registro" pixel for n&#58;=1 to nfields tmp&#58;=n //Si no uso esto devuelve un error al generar el get @fila,colum say asay&#91;n&#93; of odlgReg pixel //Esto genera bien @fila,Colum+30 get aoget&#91;tmp&#93; var avarget&#91;tmp&#93; of odlgReg pixel update size 30,10 //<-- Aquí tengo el problema fila+=15 next [/code:2mqnow3i]Parece ser por la forma en que el TGet asigna el valor mediante un codeblock bsetget......no se. Estoy dándole vueltas a esto y no le encuentro solución.De antemano muchas gracias.Marcelo Jingo
Ayuda con creación de GETs dinámicos (Solucionado)
Marcelo,Que error manda?Algo más de código seria bueno para verle
Ayuda con creación de GETs dinámicos (Solucionado)
Hola Marcelo, el problema es debido a que en tu bucle "for" creas los objetos gets, pero la ejecución del programa continua y la variable n cuando sale del bucle es igual a nfields + 1, entonces cuando se activa el dialogo y se ven los gets intenta asignarles el valor avarget[nfields+1], que está fuera del rango de avarget.Si por el contrario usas la variable tmp, no da error, pero su valor cuando se activa el dialogo es el del último paso por el bucle, tmp = nfields y tendras todos los gets apuntando a avarget[nfields]La solución es usar un codeblock "dinámico" para asiganarle el valor :@fila,Colum+30 get aoget[tmp] var avarget[tmp] of odlgReg pixel update size 30,10 //<-- Aquí tengo el problema [b:2tg55x5f]aoget[n]:bSETGET := GenLocalBlock ( avarget, n )[/b:2tg55x5f]y la funcion :[b:2tg55x5f]function GenLocalBlock ( aGets, n ) return bSETGET ( aGets [n] )[/b:2tg55x5f]la definición de bSETGET () está en el archivo FiveWin.CH, por si le quieres echar un vistazo.Espero te sirva.
Ayuda con creación de GETs dinámicos (Solucionado)
gmart1Con tu sugerencia he logrado resolver este problema, pero he tenido que crear los gets en una función que mando a llamar desde el on init del diálogo principal. asi:[code:rlp7g7ss] DEFINE dialog odlgReg from 1,1 to &#40;nfields*30&#41;+50,250 title "Edición de registro" pixel @ &#40;nfields*15&#41;,10 button obt1 prompt "OK" of odlgReg pixel @ &#40;nfields*15&#41;,50 button obt2 prompt "Cancel" of odlgreg pixel activate dialog odlgreg centered on init gendlg&#40;odlgReg,asay,aoget,avarget,nfields&#41; return nil //------------------------------------------------------- //Función para generar los gets y says function gendlg&#40;odlgReg,asay,aoget,avarget,nfields,obt1,obt2&#41; local n ,fila&#58;=10,colum&#58;=10 for n&#58;=1 to nfields @fila,colum say asay&#91;n&#93; of odlgReg pixel aoget&#91;n&#93;&#58;=TGet&#40;&#41;&#58;New&#40; fila, Colum+60, GenLocalBlock&#40;avarget,n&#41;, odlgReg,50,20,,,,,,,,&#46;t&#46;&#41; fila+=25 next return nil //------------------------------------------------------ function GenLocalBlock &#40; aGets, n &#41; return bSETGET &#40; aGets &#91;n&#93; &#41; [/code:rlp7g7ss]Si tengo más problemas estaré molestando. Gracias también Willian por tu interés.Un saludo a todos.Marcelo Jingo
Ayuda con creación de GETs dinámicos (Solucionado)
Hola de nuevo Marcelo,Perdona que no te indicara que tenías que cambiar la declaración de los gets al formato de clase TGet:new(), yo en su día tuve que cambiarlo, ya que la solución que te di [code:345vp0q8]aoget&#91;n&#93;&#58;bSETGET &#58;= GenLocalBlock &#40; avarget, n &#41; [/code:345vp0q8]requiere que el objeto exista, para poder modificar la propiedad bSETGET.Pero con el cambio de nomenclatura que has hecho, creo que no es necesario que llames a la función en el on init, yo por lo menos lo tengo declarado antes y no me lanza ningún error.Un saludo.
Ayuda con crear un JSon no funciona
Saludos. Siguiendo algunos ejemplos de miembros del foro, quiero crear un archivo json, para enviar informacion a un webservice, pero no me funciona, aparente se va la informacion pero no me reposnde nada: mi codigo: [code=fw:8zbe4rr3]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><span style="color: #00C800;">Function</span> APIS<span style="color: #000000;">&#40;</span>cOpe<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> doc,oHttp,cText,cText1,response,cStr,hHash,nLen,r<br /><br /><span style="color: #00C800;">default</span> cOpe:=<span style="color: #ff0000;">'VU'</span><br /><br />doc:=CreateObject<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"MSXML2.DOMDocument"</span> <span style="color: #000000;">&#41;</span><br />oHttp:=CreateObject<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"MSXML2.XMLHTTP"</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">if</span> cOpe==<span style="color: #ff0000;">'VU'</span><br />&nbsp;oHttp:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"POST"</span> ,<span style="color: #ff0000;">"http://www.answerspip.com:80/apidms/v1/Venta"</span>,.F.<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">endif</span><br />oHttp:<span style="color: #000000;">SetRequestHeader</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"cache-control"</span>, <span style="color: #ff0000;">"no-cache"</span><span style="color: #000000;">&#41;</span><br />oHttp:<span style="color: #000000;">SetRequestHeader</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"content-type"</span>, &nbsp;<span style="color: #ff0000;">"application/json"</span> <span style="color: #000000;">&#41;</span><br />oHttp:<span style="color: #000000;">SetRequestHeader</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"authorization"</span>, <span style="color: #ff0000;">"Token token=398336e2a7bbeaac6d3858c1551a8536"</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">if</span> cOpe==<span style="color: #ff0000;">'VU'</span><br />&nbsp;cText:=MemoRead<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"p:<span style="color: #000000;">\t</span>mp<span style="color: #000000;">\v</span>entauni.json"</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">TRY</span><br />&nbsp;oHttp:<span style="color: #000000;">Send</span><span style="color: #000000;">&#40;</span> cText <span style="color: #000000;">&#41;</span><br />&nbsp;? cText<br />CATCH &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp;<span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"No Se Pudo Enviar Documento JSON"</span>,<span style="color: #ff0000;">"Intente Nuevamente"</span><span style="color: #000000;">&#41;</span><br />&nbsp;<span style="color: #00C800;">return</span> .t.<br />END<br />response:=oHttp:<span style="color: #000000;">responseText</span><br /><span style="color: #00C800;">if</span> cOpe==<span style="color: #ff0000;">'VU'</span><br />&nbsp;MemoWrit<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'p:<span style="color: #000000;">\t</span>mp<span style="color: #000000;">\S</span>endVentaUni_Res.json'</span>,response<span style="color: #000000;">&#41;</span><br />&nbsp;cText1:=MEMOREAD<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"p:<span style="color: #000000;">\t</span>mp<span style="color: #000000;">\S</span>endVentaUni_Res.json"</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">endif</span><br />?cText1 <span style="color: #B900B9;">// ver respuesta del servidor .</span><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">NIL</span><br />&nbsp;</div>[/code:8zbe4rr3] y el contenido del archico p:\tmp\ventuni.json es: ************************************************************* { "invoice": { "IdMarca": "010", "IdDistribuidor": "497", "IdInterfaz": "MX00000088", "IdEjecutivo": "090", "IdCliente": "48045", "Apellido_Paterno": "GUTIERREZ", "Apellido_Materno": "TREJO", "Nombre": "ALDO ISMAEL", "Telefono1": "5552928000", "Telefono2": "0445552928000", "Email": "naburtos@gmail.com", "TipoPersona": "0", "TipoVenta":" "AUTOFINANCIAMIENTO", "No_Factura": "003957", "Clave_Modelo": "J1L", "Clave_Color": "AEM", "Clave_Color_Int": "TCG", "Fecha_Factura": "20170724", "Fecha_Entrega": "20180730", "No_Vin": "8AFWR5DV6H6497124", "Numero_Inventario": "2852-17", "RazonComercial": "", "IdProspectoSicop": "48045", "Calle": "AVENIDA PLAZA DEL SOL", "No_Ext": "25", "No_Int": "41", "Colonia": "RINCONADA DEL SOL", "Delegacion_Municipio": "ZAPOPAN", "Estado": "JALISCO", "CP": "45055", "RFC": "GUTA880104RA4", "Matricula": "1234-XXX", "Fecha_Matricula": "", "Descripcion_Auto": "RANGER XLT CREW", "Descripcion_Version": "", "Descripcion_Color": "EX24", "Descripcion_ColorInt": "IN19", } } ************************************************************* en caso de que hubiera error deberia mandar: msginfo("No Se Pudo Enviar Documento JSON","Intente Nuevamente") no lo avisa, pero el: response:=oHttp:responseText esta en blanco. alguna sugerencia porfa.
Ayuda con crear un JSon no funciona
Es que es un servicio REST, si haces un POST y sale bien recibirás una respuesta vacia con el código http correspondiente ( 200 OK ó en tu caso sería mejor un 201 Created) pero la respuesta es VACIA.
Ayuda con crystalreport
Saludos amigos del foro. Quiero aprender a generar mis reportes con crystalreport. El asunto es que no tengo la mas minima idea de como usarlo y menos de como integrarlo a mi programa FW. Alguien puede darme una mano con los principales puntos? Que version debo usar? Donde se descarga? Donde consigo manuales que me enseñen a usarlo y sobre todo como hago para que los reportes que genere se integren a mi aplicacion. Quedo al pendiente de su generosa ayuda al respecto. Gracias adelantadas. Uso fw17.01, xHarbour, mariaDB, windows 10 64bits
Ayuda con crystalreport
Hola, Prueba EasyReport, que es de Fivetech, gratuito y el código fuente disponible: <!-- m --><a class="postlink" href="https://bitbucket.org/fivetech/easyreport/src/master/">https://bitbucket.org/fivetech/easyreport/src/master/</a><!-- m --> La parte de impresión funciona muy bien, no así el diseñador, que falla a veces al arrastrar y colocar los objetos, pero en teoría en Fivetech lo están arreglando. Un saludo
Ayuda con crystalreport
Gracias eduardo por la informacion y tu sugerencia. Voy a entrarle al easyreport. Algun sitio donde pueda descargar un manual de como usarlo y como integrarlo a mis aplicaciones? En realidad es muy importante para mi porque no tengo la mas minima idea de como hacerlo. Jamas he utilizado un generador de reportes. Hasta el dia de hoy, los hago "a pulso"
Ayuda con crystalreport
Un pequeño ejemplo con dbf [code=fw:3tsjlidb]<div class="fw" id="{CB}" style="font-family: monospace;"><br />PROC pIPRI022<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> oReport,Pagina:=nLinea := <span style="color: #000000;">1</span><br /><span style="color: #00C800;">local</span> vTCRCos:=<span style="color: #000000;">0</span>,vTCRSal:=<span style="color: #000000;">0</span>,vTCRPub:=<span style="color: #000000;">0</span>,vTCRTot:=<span style="color: #000000;">0</span><br /><span style="color: #00C800;">local</span> vTentra:=<span style="color: #000000;">0</span>,vTsalid:=<span style="color: #000000;">0</span>,vTsaldo:=<span style="color: #000000;">0</span><br />uFec:=dtoc<span style="color: #000000;">&#40;</span>date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />uTim:=subs<span style="color: #000000;">&#40;</span>time<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">1</span>,<span style="color: #000000;">8</span><span style="color: #000000;">&#41;</span><br /><br />vTRep:=<span style="color: #ff0000;">"REPORTE MOVIMIENTO DE INVENTARIO"</span><br />vTDes:=<span style="color: #ff0000;">"Fecha Desde:  "</span>+dtoc<span style="color: #000000;">&#40;</span>vFecDE<span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" Hasta: "</span>+dtoc<span style="color: #000000;">&#40;</span>vFecHA<span style="color: #000000;">&#41;</span><br /><br />SELE d_inv01<br />SET FILT <span style="color: #0000ff;">TO</span><br /><span style="color: #0000ff;">SUM</span> d_inv01->Entra <span style="color: #0000ff;">TO</span> vTentra<br /><span style="color: #0000ff;">SUM</span> d_inv01->Salid <span style="color: #0000ff;">TO</span> vTsalid<br />Dbgotop<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />vTsaldo:=vTentra-vTsalid<br /><br />EASYREPORT oVRD <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">".<span style="color: #000000;">\r</span>eport<span style="color: #000000;">\R</span>_INVEN02.vrd"</span> PREVIEW <span style="color: #000000;">&#40;</span>.T.<span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//OF oDlg2</span><br /><br />  <span style="color: #00C800;">IF</span> oVRD:<span style="color: #000000;">lDialogCancel</span> = .T.<br />    <span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> .F. <span style="color: #000000;">&#41;</span><br />  <span style="color: #00C800;">ENDIF</span><br /><br />  PRINTAREA <span style="color: #000000;">1</span> <span style="color: #0000ff;">OF</span> oVRD;<br />  ITEMIDS    <span style="color: #000000;">&#123;</span><span style="color: #000000;">101</span>,<span style="color: #000000;">102</span>,<span style="color: #000000;">103</span>,<span style="color: #000000;">104</span>,<span style="color: #000000;">106</span>,<span style="color: #000000;">107</span>,<span style="color: #000000;">105</span><span style="color: #000000;">&#125;</span>;<br />  ITEMVALUES <span style="color: #000000;">&#123;</span>alltrim<span style="color: #000000;">&#40;</span>oLamcla:<span style="color: #000000;">vGnom</span><span style="color: #000000;">&#41;</span>,<span style="color: #ff0000;">"NIT: "</span>+alltrim<span style="color: #000000;">&#40;</span>oLamcla:<span style="color: #000000;">vGnit</span><span style="color: #000000;">&#41;</span>,uFec,alltrim<span style="color: #000000;">&#40;</span>uTim<span style="color: #000000;">&#41;</span>,vTRep,vTDes,Transform<span style="color: #000000;">&#40;</span>Pagina,<span style="color: #ff0000;">"999,999"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br /><br />  PRINTAREA <span style="color: #000000;">2</span> <span style="color: #0000ff;">OF</span> oVRD<br /><br />  SELE d_inv01<br />  SET FILT <span style="color: #0000ff;">TO</span><br />  Dbgotop<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />  <span style="color: #00C800;">Do</span> <span style="color: #00C800;">While</span> !EOF<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />      PRINTAREA <span style="color: #000000;">3</span> <span style="color: #0000ff;">OF</span> oVRD ;<br />      ITEMIDS <span style="color: #000000;">&#123;</span> <span style="color: #000000;">377</span>, <span style="color: #000000;">390</span>,<span style="color: #000000;">378</span>,<span style="color: #000000;">305</span>,<span style="color: #000000;">307</span>,<span style="color: #000000;">309</span>,<span style="color: #000000;">308</span><span style="color: #000000;">&#125;</span> ;<br />      ITEMVALUES <span style="color: #000000;">&#123;</span> <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span>d_inv01->Docum=<span style="color: #ff0000;">"LYM"</span>,<span style="color: #ff0000;">"INIC."</span>,d_inv01->Docum<span style="color: #000000;">&#41;</span>,;<br />                   <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span>d_inv01->Conse=<span style="color: #ff0000;">"LYM"</span>,<span style="color: #ff0000;">"INIC."</span>,d_inv01->Conse<span style="color: #000000;">&#41;</span>,;<br />               Dtoc<span style="color: #000000;">&#40;</span>d_inv01->Fecha<span style="color: #000000;">&#41;</span>,;<br />               pDETIPDO<span style="color: #000000;">&#40;</span>d_inv01->Contr<span style="color: #000000;">&#41;</span>,;<br />                   <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span>d_inv01->Entra#<span style="color: #000000;">0</span>,Transform<span style="color: #000000;">&#40;</span>d_inv01->Entra,<span style="color: #ff0000;">"999,999,999.99"</span><span style="color: #000000;">&#41;</span>,<span style="color: #ff0000;">" "</span><span style="color: #000000;">&#41;</span>,;<br />               Transform<span style="color: #000000;">&#40;</span>d_inv01->Subto,<span style="color: #ff0000;">"999,999,999.99"</span><span style="color: #000000;">&#41;</span>,;<br />                   <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span>d_inv01->Salid#<span style="color: #000000;">0</span>,Transform<span style="color: #000000;">&#40;</span>d_inv01->Salid,<span style="color: #ff0000;">"999,999,999.99"</span><span style="color: #000000;">&#41;</span>,<span style="color: #ff0000;">" "</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br /><br />      SELE d_inv01<br />      d_inv01-><span style="color: #000000;">&#40;</span>DBSKIP<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br />    <span style="color: #00C800;">IF</span> oVRD:<span style="color: #000000;">nNextRow</span> > oVRD:<span style="color: #000000;">nPageBreak</span><br />       PAGEBREAK oVRD<br />       pagina:=pagina<span style="color: #000000;">+1</span><br /><br />       PRINTAREA <span style="color: #000000;">1</span> <span style="color: #0000ff;">OF</span> oVRD;<br />       ITEMIDS    <span style="color: #000000;">&#123;</span><span style="color: #000000;">101</span>,<span style="color: #000000;">102</span>,<span style="color: #000000;">103</span>,<span style="color: #000000;">104</span>,<span style="color: #000000;">106</span>,<span style="color: #000000;">107</span>,<span style="color: #000000;">105</span><span style="color: #000000;">&#125;</span>;<br />       ITEMVALUES <span style="color: #000000;">&#123;</span>alltrim<span style="color: #000000;">&#40;</span>oLamcla:<span style="color: #000000;">vGnom</span><span style="color: #000000;">&#41;</span>,<span style="color: #ff0000;">"NIT: "</span>+alltrim<span style="color: #000000;">&#40;</span>oLamcla:<span style="color: #000000;">vGnit</span><span style="color: #000000;">&#41;</span>,uFec,alltrim<span style="color: #000000;">&#40;</span>uTim<span style="color: #000000;">&#41;</span>,vTRep,vTDes,Transform<span style="color: #000000;">&#40;</span>Pagina,<span style="color: #ff0000;">"999,999"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br /><br />       PRINTAREA <span style="color: #000000;">2</span> <span style="color: #0000ff;">OF</span> oVRD<br />    <span style="color: #00C800;">ENDIF</span><br /><br />  <span style="color: #00C800;">EndDo</span><br /><br />  PRINTAREA <span style="color: #000000;">4</span> <span style="color: #0000ff;">OF</span> oVRD ;<br />  ITEMIDS    <span style="color: #000000;">&#123;</span><span style="color: #000000;">403</span>,<span style="color: #000000;">404</span>,<span style="color: #000000;">405</span><span style="color: #000000;">&#125;</span>;<br />  ITEMVALUES <span style="color: #000000;">&#123;</span>Transform<span style="color: #000000;">&#40;</span>vTentra,<span style="color: #ff0000;">"999,999,999.99"</span><span style="color: #000000;">&#41;</span>,Transform<span style="color: #000000;">&#40;</span>vTsalid,<span style="color: #ff0000;">"999,999,999.99"</span><span style="color: #000000;">&#41;</span>,Transform<span style="color: #000000;">&#40;</span>vTsaldo,<span style="color: #ff0000;">"999,999,999.99"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br /><br />END EASYREPORT oVRD<br /><br /> </div>[/code:3tsjlidb] Aun que en el repositorio que te indico Manuel, hay varios ejemplos.
Ayuda con códigos de barra...????
Necesito ayuda con los codigos de barra, pues debo obtener en un get la lectura generada por un pistola lectora de codigo. No se si existe alguna aplicacion especifica o alguna classe que me ayude con esta tarea. Sí alguien sabe de esto se los agradecere.... <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Ayuda con códigos de barra...????
Hola, no deberias tener mayor problema, tan solo debes tener el foco en el GET y hacer la lectura del codigo de barras con tu dispositivo (lector) este por lo general pondra la lectura en el buffer del teclado como si lo hubieras tecleado directamente. saludos Marcelo
Ayuda con códigos de barra...????
En tu sistema no tienes nada que agregar, deja que el lector haga su trabajo, saludos..
Ayuda con decimales
Como puedo redondear una cantidad a dos decimales por ejemplo 2*3,18 = xxx gracias <!-- e --><a href="mailto:imjcc@mjccsl.com">imjcc@mjccsl.com</a><!-- e -->
Ayuda con decimales
[quote="mjcc":3t1y8pk7]Como puedo redondear una cantidad a dos decimales por ejemplo 2*3,18 = xxx gracias <!-- e --><a href="mailto:imjcc@mjccsl.com">imjcc@mjccsl.com</a><!-- e -->[/quote:3t1y8pk7] ROUND( nVar,nDecimales ) ejemplo ROUND( (2*3.18),2 ) Saludos
Ayuda con dll
Tengo la siguiente funcion en un dll Declare Short Online_SetupEx ; In C:\OnlineCommManager\OnlineDll ; Long CommData, ; Short Port, ; Short BaudRate, ; Short StopBits, ; Short Parity alguien me podria ayudar a hacer la llamada desde fwh Muchas gracias por la ayuda
Ayuda con dll
DLL FUNCTION Online_SetupEx( CommData AS LONG, Port AS LONG, Baudrate AS LONG, Stopbits AS LONG, Parity AS LONG ) AS LONG LIB "C:\OnlineCommManager\OnlineDll.dll"
Ayuda con dll
[quote="Antonio Linares":3aunjqn1]DLL FUNCTION Online_SetupEx( CommData AS LONG, Port AS LONG, Baudrate AS LONG, Stopbits AS LONG, Parity AS LONG ) AS LONG LIB "C:\OnlineCommManager\OnlineDll.dll"[/quote:3aunjqn1]
Ayuda con editor de recursos URGENTE !
Hola amigos del foro Estoy intentando abandonar el WorkShop y he probado PellesC, ResEdit, ResourceBuilder pero no logro avanzar en nada Al abrir mi .RC con -ResEdit envia errores que no he podido resolver -PellesC no logro que se muestre nada en forma visual para poder trabajar... -y ResourceBuilder abre todo y puedo trabajar pero al final se descuadran todos los dialogos Pregunto que via me recomiendan para reemplazar el WS y si es posible que me ayuden con la forma de hacerlo. ES URGENTISIMO ya que acabo de instalar el sistema en un Windows Server y los dialogos no se muestran completos... Gracias...
Ayuda con editor de recursos URGENTE !
JoseGS, Porque dejar WorksHop? Y trabajo con pellesc sin problemas.
Ayuda con editor de recursos URGENTE !
Me temo que es por la resolucion grafica de esa compu donde los dialogos no se muestran completos, para crear los dialogos siempre hay que tomar encuenta una medida standard , para evitar esos problemas de resolucion, en mi caso cuando trabajo con resources, los dialogos son de 800x600. saludos..
Ayuda con editor de recursos URGENTE !
Ya resolvi el problema, estaba relacionado con el WindowsXp.Manifest
Ayuda con el build de mi aplicacion
Pues eso que estoy haciendo pruebas con rutinas escritas en .c y no se como agrgarlas a mi exe, con el archivo .mak. Ya se que esas rutinas las puedo agregar en los .prg, pero quiero aprender como se hace desde el .mak. Si alguien me puediera ayudar con un .mak que este funcionando. FWH 2.7 Feb 2006 Harbour Gracias
Ayuda con el build de mi aplicacion
Ricardo, Revisa el directorio fwh\makes Tienes uno para Borland y otro para Microsoft.
Ayuda con el build de mi aplicacion
Sr. Antonio, Gracias por contestar, he hecho una prueba y me arroja el error: To Many Exe file names: obj\tsys.obj Alguna sugerencia?. Gracias
Ayuda con el build de mi aplicacion
Ricardo, Cómo lo has modificado ? Muéstranos los cambios
Ayuda con el build de mi aplicacion
Sr. Linars Aqui los Cambios [quote:1c7og2qz] #Borland make sample, (c) FiveTech Software 2005 HBDIR=c:\xHarb27f BCDIR=c:\bc5527 FWDIR=c:\fwh27F RGDIR=c:\rglib #change these paths as needed .path.PRG = $(RGDIR)\fuentes .path.OBJ = $(RGDIR)\obj .path.CH = $(FWDIR)\include;$(HBDIR)\include;$(RGDIR)\include .path.C = $(RGDIR)\fuentes .path.rc = $(RGDIR)\fuentes #important: Use Uppercase for filenames extensions, in the next two rules! PRG = \ testsis.PRG \ factura.PRG \ systab.PRG \ mantcata.PRG \ tsys.PRG \ ttable.PRG \ tfield.PRG \ tindex.PRG \ tmaint.PRG \ maint_.PRG \ fnext.PRG \ xfer.PRG \ tdetail.PRG \ tcbrowse.PRG \ rgflib.PRG C = \ rgfuncs.C PROJECT : Testsis.exe Testsis.exe : $(PRG:.PRG=.OBJ) $(C:.C=.OBJ) Testsis.res echo off echo $(BCDIR)\bin\c0w32.obj + > b32.bc echo obj\testsis.obj obj\factura.obj obj\systab.obj, + >> b32.bc echo obj\mantcata.obj obj\tsys.obj obj\ttable.obj, + >> b32.bc echo obj\tfield.obj obj\tindex.obj obj\tmaint.obj, + >> b32.bc echo obj\maint_.obj obj\fnext.obj obj\xfer.obj, + >> b32.bc echo obj\tdetail.obj obj\tcbrowse.obj obj\rgflib.obj, + >> b32.bc echo obj\rgfuncs.obj, + >> b32.bc echo Testsis.exe, + >> b32.bc echo testsis.map, + >> b32.bc echo $(FWDIR)\lib\FiveHX.lib $(FWDIR)\lib\FiveHC.lib + >> b32.bc echo $(HBDIR)\lib\b32\rtl.lib + >> b32.bc echo $(HBDIR)\lib\b32\vm.lib + >> b32.bc echo $(HBDIR)\lib\b32\gtwin.lib + >> b32.bc echo $(HBDIR)\lib\b32\lang.lib + >> b32.bc echo $(HBDIR)\lib\b32\macro.lib + >> b32.bc echo $(HBDIR)\lib\b32\rdd.lib + >> b32.bc echo $(HBDIR)\lib\b32\dbfntx.lib + >> b32.bc echo $(HBDIR)\lib\b32\dbfcdx.lib + >> b32.bc echo $(HBDIR)\lib\b32\dbffpt.lib + >> b32.bc echo $(HBDIR)\lib\b32\hbsix.lib + >> b32.bc echo $(HBDIR)\lib\b32\debug.lib + >> b32.bc echo $(HBDIR)\lib\b32\common.lib + >> b32.bc echo $(HBDIR)\lib\b32\pp.lib + >> b32.bc echo $(HBDIR)\lib\b32\codepage.lib + >> b32.bc rem Uncomment these two lines to use Advantage RDD rem echo $(HBDIR)\lib\b32\rddads.lib + >> b32.bc rem echo $(HBDIR)\lib\b32\Ace32.lib + >> b32.bc echo $(BCDIR)\lib\cw32.lib + >> b32.bc echo $(BCDIR)\lib\import32.lib + >> b32.bc echo $(BCDIR)\lib\psdk\odbc32.lib + >> b32.bc echo $(BCDIR)\lib\psdk\nddeapi.lib + >> b32.bc echo $(BCDIR)\lib\psdk\iphlpapi.lib + >> b32.bc echo $(BCDIR)\lib\psdk\rasapi32.lib, >> b32.bc IF EXIST Testsis.res echo Testsis.res >> b32.bc $(BCDIR)\bin\ilink32 -Gn -aa -Tpe -s @b32.bc del b32.bc .PRG.OBJ: $(HBDIR)\bin\harbour $< /L /N /W /Oobj\ /I$(FWDIR)\include;$(HBDIR)\include;$(RGDIR)\include $(BCDIR)\bin\bcc32 -c -tWM -I$(HBDIR)\include -oobj\$& obj\$&.c .C.OBJ: echo -c -tWM -D__HARBOUR__ -DHB_API_MACROS > tmp echo -I$(HBDIR)\include;$(FWDIR)\include >> tmp $(BCDIR)\bin\bcc32 -oobj\$& @tmp $&.c del tmp Testsis.res : Testsis.rc $(BCDIR)\bin\brc32.exe -r Testsis.rc[/quote:1c7og2qz]
Ayuda con el build de mi aplicacion
Sr. Linares. Aprovechando el hilo. La funcion FixSays(), en donde la puedo encontrar ?. ó biene en alguna libreria? (FIVEHC, FIVEHX????) Trabajo con FWH 2.7 y el Build de Febrero 2006. Gracias
Ayuda con el make
Socorro BCC 582 FWH 1104 HB30 Hace unos días, nnicanor, con muy buen criterio me recomendó que usase Harbour 3.0 que es más estable. Lo descargue y utilizando el make de abajo intento comenzar a compilar mis programas... primero ejemplos de FW y me da el problema de abajo que no logro superar. porque soy torpe o porque soy muy novato, pero estoy bloqueado. Supongo que será alguna tonteria pero os agradeceria alguna ayuda. [code=fw:3pfiq92q]<div class="fw" id="{CB}" style="font-family: monospace;">@ECHO OFF<br />CLS<br />ECHO ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿<br />ECHO ³ FiveWin <span style="color: #00C800;">for</span> Harbour <span style="color: #000000;">11.04</span> - Apr. <span style="color: #000000;">2011</span>           Harbour development <span style="color: #0000ff;">power</span>  ³Ü<br />ECHO ³ <span style="color: #000000;">&#40;</span>c<span style="color: #000000;">&#41;</span> FiveTech, <span style="color: #000000;">1993</span><span style="color: #000000;">-2011</span>     <span style="color: #00C800;">for</span> Microsoft Windows 9X/NT/200X/ME/XP/Vista/<span style="color: #000000;">7</span> ³Û<br />ECHO ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙÛ<br />ECHO ÿ ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß<br /><br /><span style="color: #00C800;">if</span> A%<span style="color: #000000;">1</span> == A GOTO :<span style="color: #000000;">SINTAX</span><br /><span style="color: #00C800;">if</span> NOT EXIST %<span style="color: #000000;">1</span>.prg GOTO :<span style="color: #000000;">NOEXIST</span><br /><br />set FWDIR=C:\UTILP_5\FWH1104<br />set HBDIR=C:\UTILP_5\hb30<br />set GT=gtgui<br /><br />ECHO Compiling...<br /><br />set hdir=%HBDIR%<br />set hdirl=%hdir%\lib<br />set fwh=%FWDIR%<br />set bcdir=C:\UTILP_5\bcc582<br /><br />%hdir%\bin\harbour %<span style="color: #000000;">1</span> /n /i%fwh%\include;%hdir%\include /w /p %<span style="color: #000000;">2</span> %<span style="color: #000000;">3</span> > comp.log<br /><span style="color: #00C800;">IF</span> ERRORLEVEL <span style="color: #000000;">1</span> GOTO COMPILEERRORS<br />@type comp.log<br /><br />echo -O2 -e%<span style="color: #000000;">1</span>.exe -I%hdir%\include -I%bcdir%\include %<span style="color: #000000;">1</span>.c > b32.bc<br />%bcdir%\bin\bcc32 -M -c @b32.bc<br />:<span style="color: #000000;">ENDCOMPILE</span><br /><br /><span style="color: #00C800;">IF</span> EXIST %<span style="color: #000000;">1</span>.rc %bcdir%\bin\brc32 -r -I%bcdir%\include %<span style="color: #000000;">1</span><br />rem <span style="color: #00C800;">IF</span> EXIST %<span style="color: #000000;">1</span>.rc %vcdir%\bin\rc -r -d__FLAT__ %<span style="color: #000000;">1</span><br /><br />echo %bcdir%\lib\c0w32.obj + > b32.bc<br />echo %<span style="color: #000000;">1</span>.obj, + >> b32.bc<br />echo %<span style="color: #000000;">1</span>.exe, + >> b32.bc<br />echo %<span style="color: #000000;">1</span>.map, + >> b32.bc<br />echo %fwh%\lib\FiveH.lib %fwh%\lib\FiveHC.lib + >> b32.bc<br />echo %hdirl%\hbrtl.lib + >> b32.bc<br />echo %hdirl%\hbvm.lib + >> b32.bc<br />echo %hdirl%\gtgui.lib + >> b32.bc<br />echo %hdirl%\hblang.lib + >> b32.bc<br />echo %hdirl%\hbmacro.lib + >> b32.bc<br />echo %hdirl%\hbrdd.lib + >> b32.bc<br />echo %hdirl%\rddntx.lib + >> b32.bc<br />echo %hdirl%\rddcdx.lib + >> b32.bc<br />echo %hdirl%\rddfpt.lib + >> b32.bc<br />echo %hdirl%\hbsix.lib + >> b32.bc<br />echo %hdirl%\hbdebug.lib + >> b32.bc<br />echo %hdirl%\hbcommon.lib + >> b32.bc<br />echo %hdirl%\hbpp.lib + >> b32.bc<br />echo %hdirl%\hbcpage.lib + >> b32.bc<br />echo %hdirl%\hbwin.lib + >> b32.bc<br />echo %hdirl%\hbcplr.lib + >> b32.bc<br />echo %hdirl%\hbct.lib + >> b32.bc<br />echo %hdirl%\xhb.lib + >> b32.bc<br />echo %hdirl%\hbziparc.lib + >> b32.bc<br />echo %hdirl%\hbmzip.lib + >> b32.bc<br />echo %hdirl%\hbzlib.lib + >> b32.bc<br />echo %hdirl%\minizip.lib + >> b32.bc<br /><br />rem Uncomment these two lines <span style="color: #0000ff;">to</span> use Advantage RDD<br />rem echo %hdirl%\rddads.lib + >> b32.bc<br />rem echo %hdirl%\Ace32.lib + >> b32.bc<br /><br />echo %bcdir%\lib\cw32.lib + >> b32.bc<br />echo %bcdir%\lib\uuid.lib + >> b32.bc<br />echo %bcdir%\lib\import32.lib + >> b32.bc<br />echo %bcdir%\lib\psdk\odbc32.lib + >> b32.bc<br />echo %bcdir%\lib\psdk\nddeapi.lib + >> b32.bc<br />echo %bcdir%\lib\psdk\iphlpapi.lib + >> b32.bc<br />echo %bcdir%\lib\psdk\msimg32.lib + >> b32.bc<br />echo %bcdir%\lib\psdk\psapi.lib + >> b32.bc<br />echo %bcdir%\lib\psdk\rasapi32.lib, >> b32.bc<br /><br /><span style="color: #00C800;">IF</span> EXIST %<span style="color: #000000;">1</span>.res echo %<span style="color: #000000;">1</span>.res >> b32.bc<br /><span style="color: #00C800;">if</span> %GT% == gtwin %bcdir%\bin\ilink32 -Tpe -s @b32.bc<br /><span style="color: #00C800;">IF</span> ERRORLEVEL <span style="color: #000000;">1</span> GOTO LINKERROR<br /><span style="color: #00C800;">if</span> %GT% == gtgui %bcdir%\bin\ilink32 -Gn -aa -Tpe -s @b32.bc<br /><span style="color: #00C800;">IF</span> ERRORLEVEL <span style="color: #000000;">1</span> GOTO LINKERROR<br />ECHO * Application successfully built *<br />%<span style="color: #000000;">1</span><br />GOTO EXIT<br />ECHO<br /><br />rem delete temporary files<br />@del %<span style="color: #000000;">1</span>.c<br /><br />:<span style="color: #000000;">COMPILEERRORS</span><br />@type comp.log<br />ECHO * Compile errors *<br />GOTO EXIT<br /><br />:<span style="color: #000000;">LINKERROR</span><br />ECHO * Linking errors *<br />GOTO EXIT<br /><br />:<span style="color: #000000;">SINTAX</span><br />ECHO    SYNTAX: <span style="color: #000000;">Build</span> <span style="color: #000000;">&#91;</span>Program<span style="color: #000000;">&#93;</span>     <span style="color: #000000;">&#123;</span>-- No especifiques la extensi¢n PRG<br />ECHO                                <span style="color: #000000;">&#123;</span>-- Don<span style="color: #ff0000;">'t specify .PRG extension<br />GOTO EXIT<br /><br />:NOEXIST<br />ECHO The specified PRG %1 does not exist<br /><br />:EXIT<br /></span></div>[/code:3pfiq92q] error: [code=fw:3pfiq92q]<div class="fw" id="{CB}" style="font-family: monospace;">#line <span style="color: #000000;">39</span> <span style="color: #ff0000;">"C:<span style="color: #000000;">\U</span>TILP_5<span style="color: #000000;">\F</span>WH1104<span style="color: #000000;">\i</span>nclude<span style="color: #000000;">\F</span>iveWin.ch"</span><br />      <span style="color: #00C800;">static</span> bError<br />#line <span style="color: #000000;">209</span> <span style="color: #ff0000;">"C:<span style="color: #000000;">\U</span>TILP_5<span style="color: #000000;">\h</span>b30<span style="color: #000000;">\i</span>nclude<span style="color: #000000;">\h</span>bclass.ch"</span><br />DECLARE HBClass  <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> cName AS STRING, OPTIONAL SuperParams <span style="color: #000000;">&#41;</span> AS <span style="color: #00C800;">CLASS</span> HBClass  Create<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> AS OBJECT  Instance<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> AS OBJECT  AddClsMethod<span style="color: #000000;">&#40;</span> cName AS STRING, @MethodName<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, nScope AS NUMERIC, n2 AS NUMERIC, n3 AS NUMERIC <span style="color: #000000;">&#41;</span>  AddMultiClsData<span style="color: #000000;">&#40;</span> cType AS STRING, uVal, nScope AS NUMERIC, aDatas AS ARRAY <span style="color: #0000ff;">OF</span> STRING <span style="color: #000000;">&#41;</span>  AddMultiData<span style="color: #000000;">&#40;</span> cType AS STRING, uVal, nScope AS NUMERIC, aDatas AS ARRAY <span style="color: #0000ff;">OF</span> STRING, x AS LOGICAL, lPer AS LOGICAL <span style="color: #000000;">&#41;</span>  AddMethod<span style="color: #000000;">&#40;</span> cName AS STRING, @MethodName<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, nScope AS NUMERIC <span style="color: #000000;">&#41;</span>  AddInLine<span style="color: #000000;">&#40;</span> cName AS STRING, bBlock AS CODEBLOCK, nScope AS NUMERIC <span style="color: #000000;">&#41;</span>  AddVirtual<span style="color: #000000;">&#40;</span> cName AS STRING <span style="color: #000000;">&#41;</span><br />#line <span style="color: #000000;">80</span> <span style="color: #ff0000;">"C:<span style="color: #000000;">\U</span>TILP_5<span style="color: #000000;">\F</span>WH1104<span style="color: #000000;">\i</span>nclude<span style="color: #000000;">\F</span>iveWin.ch"</span><br />         EXTERNAL FW_GT<br /><br /><br /><br /><br /> </div>[/code:3pfiq92q]
Ayuda con el make
Comprueba que los ficheros de cabecera de Harbour (.CH) se correspondan con la versión de harbour.exe que estás usando
Ayuda con el make
Todos los ficheros de Harbour 3.0 están instalados el lunes, descarga de la web (harbour-3.0.0-win) e instalación asistida, y no han sido modificados ni sustituidos. Harbour está tal como se instaló en el pc. Por ejemplo el fichero ct.ch de 17/07/11 muestra la siguiente cabecera: [code=fw:salae7io]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">/*<br />&nbsp;* $Id: ct.ch 14688 2010-06-04 13:32:23Z vszakats $<br />&nbsp;*/</span><br /><br /><span style="color: #B900B9;">/*<br />&nbsp;* Harbour Project source code:<br />&nbsp;* &nbsp; CT3 Harbour header file<br />&nbsp;*<br />&nbsp;* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany<br />&nbsp;* &nbsp; &nbsp; &nbsp; &nbsp;Author: Martin Vogel <vogel@inttec.de><br />&nbsp;*<br />&nbsp;* www - <!-- m --><a class="postlink" href="http://harbour-project.org">http://harbour-project.org</a><!-- m --><br />&nbsp;*<br />&nbsp;* This program is free software; you can redistribute it and/or modify<br />&nbsp;* it under the terms of the GNU General Public License as published by<br />&nbsp;* the Free Software Foundation; either version 2, or (at your option)<br />&nbsp;* any later version.<br />&nbsp;*<br /></span></div>[/code:salae7io]
Ayuda con el make
Busca hbclass.ch, asegurate que no lo tengas copiado en alguna carpeta y sea una versión más antigua la que estas usando en realidad, sin darte cuenta
Ayuda con el make
¡Desesperado me tiene! Ante todo, muchas gracias Antonio por el interes. Entiendo que opinas que harbour está tomando directorios por defecto que no debería tomar, en base a una instalación anterior de harbour. Perfectamente puede ser. Obviamente en el pc hay otras versiones de Harbour y de FWH, y las instalaciones anteriores pueden haber dejado "lastre". Esta tarde probaré a hacer la instalación harbour y FW en un ordenador nuevo que nunca ha tenido el compilador y veré como me va.... y ya te contaré... si no es dar la lata demasiado. Gracias de nuevo y un saludo.
Ayuda con el twbrowse
Hola a todos los amigos del foro, estoy usando en mis aplicaciones la twbrowse de HDC y quisiera usar el estilo de 2 colores en el browse pero para todos mis browse de mi sistema, lo que no deseo es definirlo en codigo de mis prgs browse x browse, si no hacerlo de forma general, alguna idea, gracias de antemano se despide un amigo de lima peru
Ayuda con el twbrowse
Angel,define los colores en una base de datos, luego los cargas en una var publica, pones una opcion en tu sistema para redefinir colores, actualizas tus variables y listo ... los puedes cambiar cuando quieres y definiendolos una sola vez.salu2paco
Ayuda con el xBrowse - 2
Amigos del Foro: Aqui estoy de nuevo dando la lata, pero decidi usar este browse y por eso estoy medio " verde" o nuevo en su uso. 1) Como puedo hacer para que la ultima columna del xbrowse(), tome todo el ancho que resta de la ventana. Porque cuando son 2 columnas por ejemplo, queda al la derecho un espacio, en blanco, que se ve muy feo. y deseeo que la ultima columna del browse, lo ocupe todo. 2) Parece que para poner una imagen se puede usar esto : Insert image: [img:6nru5oot]http&#58;//image_url[/img:6nru5oot] (alt+p) Conocen algun sitio donde dejarla almacenada ?? , para que los mensajes salgan mas explicativos. Gracias por cualquier orientación. Juan[/img]
Ayuda con el xbrowse
Hola Foro: Necesito una ayudita con el xbrowse: Necesito editar en el mismo browse una columna determinada. Puedo llegar hasta editar, pero me falla el bOnPostEdit , no me refresca nada. No se como decirle que utilice la columna 3 por ejemplo. Alguien me puede decir que cambios hacer en el bOnpostEdit. Ver este ejemplo: STATIC FUNCTION AutoEdit( oWnd ) local oChild, oBrw, oCol local nFor USE DATOS ALIAS DATOS DEFINE WINDOW oChild TITLE "Auto edit browse" MDICHILD OF oWnd oBrw := TXBrowse():New( oWnd ) oBrw:nMarqueeStyle := MARQSTYLE_HIGHLCELL oBrw:nColDividerStyle := LINESTYLE_BLACK oBrw:nRowDividerStyle := LINESTYLE_BLACK oBrw:lColDividerComplete := .t. oBrw:SetRDD() oCol:= oBrw:aCols[ 3 ] oCol:nEditType:= EDIT_GET oCol:bOnPostEdit := <--- aqui que debo poner ??? oBrw:CreateFromCode() oChild:oClient := oBrw ACTIVATE WINDOW oChild ON INIT oBrw:SetFocus() RETURN NIL Gracias por su ayuda, Juan
Ayuda con el xbrowse
[code:18ac75s5] oCol&#58;bOnPostEdit &#58;= &#123;|o, v, n| iif&#40; n != VK_ESCAPE, FieldPut&#40; o&#58;nCreationOrder, v &#41;, &#41; &#125; [/code:18ac75s5] Si trabajas en red [code:18ac75s5] oCol&#58;bOnPostEdit &#58;= &#123;|o, v, n| iif&#40; n != VK_ESCAPE, If&#40; RLock&#40;&#41;, &#40; FieldPut&#40; o&#58;nCreationOrder, v &#41;, DbUnLock&#40;&#41; &#41;, MsgStop&#40; "Registro bloqueado" &#41; &#41;, &#41; &#125; [/code:18ac75s5]
Ayuda con el xbrowse
Oskar y Biel , gracias por la ayuda. Saludos Juan
Ayuda con error ADO:BookMark
Saludos a Todos Agradecere si alguno de ustedes me indica porque la lines: reg1:=oRs:bookMark() muestra el siguiente error: Error description: Error ADODB.Recordset/6 DISP_E_UNKNOWNNAME: BOOKMARK Args: Stack Calls =========== Called from: source\rtl\win32ole.prg => TOLEAUTO:BOOKMARK(0) Called from: C:\SCOW\MAINCMD.PRG => MAINCMD(16) A la espera de su pronta respuesta Saludos Luis #include "Ado.ch" FUNCTION MainCmd() LOCAL oConexionAdo := TOLEAUTO():New("adodb.connection") LOCAL oComando := TOLEAUTO():New("adodb.command") LOCAL oRecordset , reg1 LOCAL aDatos := {} oConexionAdo:Open("Provider=SQLOLEDB.1;Password=;Persist Security Info=False;User ID=Martin;Initial Catalog=APPLOCAL;Data Source=PERLIM_SYS_LCH") oComando:ActiveConnection(oConexionAdo) oComando:CommandType:= 4 oComando:CommandText := "sp_Menu" oRs := TOleAuto():New( "ADODB.Recordset" ) oRs:CursorType := adOpenKeyset oRs:CursorLocation := adUseClient oRs:LockType := adLockOptimistic oRs:Open(oComando:Execute()) reg1:=oRs:bookMark() DO WHILE .NOT. oRs:Eof() AADD(aDatos,oRs:Fields(0):value) oRs:MoveNext() ENDDO MsgList(aDatos) RETURN (.T.)
Ayuda con error ADO:BookMark
Porque no retiras la linea reg1:=oRs:bookMark() Si te funciona tienes que colocar una condicion que si no es fun de archivo lo ejecute.
Ayuda con error ADO:BookMark
Hola Ruben El punto es que al trabajar con Ado necesito capturar el registro(recno()) por lo cual necesito el metodo "bookmark", el problema es que muestra el error antes mencionado y no encuentro el porque. Saludos Luis
Ayuda con error EXCEPTION_ACCESS_VIOLATION ( SOLUCIONADO )
Tengo una aplicación FWH + xHarbour 32 bits, funcionando correctamente y luego que un cliente actualizara una pc a Windows 10 pro 32bits ( antes tenia Windows 7 ), empezó a dar error EXCEPTION_ACCESS_VIOLATION y no logro hacer que arranque, es windows mismo que tira el error, estoy desconcertado. Por favor, alguien tiene idea de como se puede solucionar esto? Muchos saludos
Ayuda con error EXCEPTION_ACCESS_VIOLATION ( SOLUCIONADO )
Alejandro, Debes tener un fichero hb_out.log con toda la información del GPF. Copia su contenido aqui, gracias