topic
stringlengths
1
63
text
stringlengths
1
577k
Buscar en archivo txt
La máxima velocidad la conseguirías escribiendo una función especifica en lenguaje C que haga el trabajo, sin tener que subir a nivel PRG. El lenguaje C se traduce directamente a ensamblador. Y el ensamblador es el lenguaje más rápido (código máquina) <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Buscar en archivo txt
Estimados Y si esa informacion en Texto de alguna forma se puede convertir a una tabla dbf la cual podemos perfectamente maipular no seria mejor. por ejemplo 21112007;01122007;31122007;20000000028;D;S;N;6,00;1,75;15;10 21112007;01122007;31122007;20000013677;D;S;N;6,00;1,75;15;10 21112007;01122007;31122007;20000091635;D;S;N;6,00;1,75;15;10 21112007;01122007;31122007;20000125327;C;S;N;6,00;1,75;15;10 21112007;01122007;31122007;20000188426;C;S;N;6,00;1,75;15;10 21112007;01122007;31122007;20000282465;D;S;N;0,00;0,00;01;01 se podria utilizar un COPY DELIMITED por ejemplo. salu2 carlos vargas
Buscar en archivo txt
Antonio En XBase++ tienen un RDD que permite manipular Archivos delimitados como si de una tabla se tratase, usando USE, BROWSE, SKIP, GO.. Tec. no se pudiera implementar algo similar en harbour. NOTA, si pueden enviarme el txt comprimido podria intentar encontrar la forma. karlos.vargas AT gmail.com salu2 carlos vargas.
Buscar en archivo txt
Carlos, Luis está buscando el sistema más rápido posible, ya que el fichero es muy grande. En esos casos es donde hace falta el lenguaje C, ya que es sin duda, el más rápido de todos <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Buscar en un recordSet. ¿cómo lo hago?
Hola. Estoy viendo las busquedas en xbrowser y siguiendo un ejemplo de Biel, me topo con esto: [quote:2xsttzsr]oRs:Find( "CliDes LIKE '"+cBuscar+"*'",,1)[/quote:2xsttzsr] Pero al ejecutar mi aplicacion me dice: [quote:2xsttzsr] ADODB.RecordSet/6 DISP_E_UNKNOWNNAME: FIND Args: [ 1] = C cliDes LIKE 'd*' [ 2] = U [ 3] = N 1 [/quote:2xsttzsr] Pueden por favor darme una mano. gracias.
Buscar en un recordSet. ¿cómo lo hago?
Se me ocurre que tendrias que probar así oRs : Movefirst() oRs : Find( ...... Saludos
Buscar en un recordSet. ¿cómo lo hago?
termino de probar eso pero no me funciona.
Buscar en un recordSet. ¿cómo lo hago?
A mi se me presentaba el mismo error y pasaba por la definicion del Recordset, ahora lo tengo de la siguiente manera: oRs := TOleAuto():New( "ADODB.Recordset" ) oRs:CursorType := adOpenDynamic oRs:CursorLocation := adUseClient oRs:LockType := adLockOptimistic oRs:ActiveConnection(oConnection) oRs:Source := "EXEC sp_Menu '0', '' " oRs:Open() oRs:MoveFirst() oRs:Find("CNIVOPC = '" + nopc2 +"'") Saludos
Buscar en un recordSet. ¿cómo lo hago?
el mismo problema.
Buscar en un recordSet. ¿cómo lo hago?
Prueba con esta cadena para la búsqueda oRs : Find( "iDes Like '" + Alltrim( cBuscar ) + "%'" ). saludos
Buscar en un recordSet. ¿cómo lo hago?
gracias este ultimo soluciono, ahora estoy viendo donde esta el problema en mi codigo. muchas gracias.
Buscar en un recordSet. ¿cómo lo hago?
MI ERRRORRRRRRR tengo definido el campo como NOMBRE y en el find ponia NOMBRES (la s al final)
Buscar en un recordSet. ¿cómo lo hago?
// 1.- Verificar si hay registros -------------------------------------------- If Data:RecordCount > 0 // 2 Posicionarse al comienzo del archivo Data1:MoveFirst() // 3 Buscar el campo teniendo en cuenta su tipo Do While !Data1:Eof() If Data1:Fields("Nombre"):Value = xNombre // MsgAlert("Encontrado...") Exit EndIf Data1:MoveNext() EndDo If Data1:Eof() MsgAlert(" No Esta en el archivo ") EndIf EndIf // Esto Funciona asi de facil
Buscar en un recordSet. ¿cómo lo hago?
si senior. asi es. me dieron una mano con esto los amigos del foro y funciono. nada mas que pense utilizar el LIKE porque me parecia mas comodo u flexible, pero lo termine haciendo a pata. gracias.
Buscar errores modharbour / tWeb
Buenas a todos Estimados se me hace un poco complicado el tema de buscar los errores me explico en la parte principal no hay problema ya que el mismo navegador muestra el error [code=fw:28xfot51]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">//  {% LoadHrb( 'lib/tweb/tweb.hrb' ) %}</span><br /><span style="color: #B900B9;">//  {% LoadHrb( 'lib/funlib/funlibweb.hrb' ) %}</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #000000;">&#123;</span>% TWebInclude<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> %<span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />    <span style="color: #00C800;">local</span> oWeb, o, oBrw<br /><br />    <span style="color: #0000ff;">DEFINE</span> WEB oWeb <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">'Listado de códigos'</span><br />    oWeb:<span style="color: #000000;">lTables</span> := .T.<br />    <span style="color: #0000ff;">INIT</span> WEB oWeb<br />    <span style="color: #0000ff;">DEFINE</span> FORM o <span style="color: #0000ff;">ID</span> <span style="color: #ff0000;">'demo'</span><br />        HTML o <span style="color: #00C800;">INLINE</span> <span style="color: #ff0000;">'<h5>LISTADOS DE PRECIOS</h5><hr>'</span><br /><br /><span style="color: #B900B9;">//aqui el error</span><br />o := tablas->precio<br /><span style="color: #B900B9;">// tabla no esta abierta si que muestra bien el error y la linea donde se produce</span><br /> </div>[/code:28xfot51] ahora el problema esta aqui [code=fw:28xfot51]<div class="fw" id="{CB}" style="font-family: monospace;"><br />        HTML o<br />            <script><br />                <span style="color: #0000ff;">var</span> oWnd<br />                <span style="color: #0000ff;">var</span> oBrw = <span style="color: #00C800;">new</span> TWebBrowse<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'ringo'</span> <span style="color: #000000;">&#41;</span><br /><br />                <span style="color: #00C800;">function</span> LoadState<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span><br />                    oWnd = MsgLoading<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />                    <span style="color: #0000ff;">var</span> cBuscar = $<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'#buscar'</span><span style="color: #000000;">&#41;</span>.val<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />                    MsgServer<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'listaprecioserver.prg'</span>, cBuscar, Post_LoadState <span style="color: #000000;">&#41;</span><br />                <span style="color: #000000;">&#125;</span><br /><br />                <span style="color: #00C800;">function</span> Post_LoadState<span style="color: #000000;">&#40;</span> dat <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span><br /><br />                    oWnd.<span style="color: #0000ff;">modal</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'hide'</span><span style="color: #000000;">&#41;</span>;<br />                    oBrw.SetData<span style="color: #000000;">&#40;</span> dat.rows <span style="color: #000000;">&#41;</span><br />                <span style="color: #000000;">&#125;</span><br /><br />                $<span style="color: #000000;">&#40;</span>document<span style="color: #000000;">&#41;</span>.ready<span style="color: #000000;">&#40;</span><span style="color: #00C800;">function</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span><br />                    oBrw.<span style="color: #0000ff;">Init</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />                <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br /><br />            </script><br />        ENDTEXT</div>[/code:28xfot51] si en la función listaprecioserver.prg se produce algun error no muestra nada las tablas estan vacias y uno pierde tiempo en buscar el error ahora la pregunta como uno puede mostrar los errores en la pantalla desde ya muchas gracias
Buscar errores modharbour / tWeb
Patricio, Es un tema un poco complicado, que supongo q con el paso del tiempo lo iremos solucionando. El error se puede producir de multiples maneras y a veces lo mejor es hacer trazas, quizas con un fichero log. De todas maneras en este caso tu tienes una pantalla que estar ya cargada en el navegador y ejecutara una peticion al server via ajax y sera alla cuando casque seguramente, no ?. Prueba de mirar con el inspector a ver si localizas como se ve el error. Se que es dificil tracearlo.... Poco a poc debemos ser cpaces de capturar este tipo de situaciones C.
Buscar errores modharbour / tWeb
gracias charle recien llevo 3 semanas con modharbour recien lo conoci cuando estuvo de compleaños jijiji me ha parecido super!!!, esperemos aportar cuando tenga mas experiencia
Buscar los DLL de mi proyecto
Saludos Al forum Hay alguna manera , de que cuando ejecute un modulo , y requiere algun DLL los Busquqe en una carpeta Espefica. Por ejemplo, si tengo el fuente le corrigo la direccion , pero si no tengo el fuente no seria posible, hay alguna manera.
Buscar los DLL de mi proyecto
Has probado a ponerla en la carpeta del sistema ( Windows o windows\system ) ?
Buscar mensagens no outlook
OlaExiste algum comando ou classe para buscar mensagens na base de dados do outlook ?
Buscar mensagens no outlook
OláEu consegui acessar as mensagens, só não descobri o nome de alguns campos da caixa de entrada para fazer a leitura.Me falta pegar quem enviou as mensagens(From) e os arquivos anexados.
Buscar números
Hola a todos. Perdón por esta consulta en principio tan básica, pero es q no se como buscar números en un indice. dbSeek( nNumero ) a mi no me funciona, no se si tenéis algún truco, o función que me pueda ayudar a hacer las búsquedas por un importe. Muchas gracias.
Buscar números
Manuel, creo recordar que tienes que construir el índice con STR. Mírate esto: <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=6&t=16135&hilit=indices+num%C3%A9ricos">viewtopic.php?f=6&t=16135&hilit=indices+num%C3%A9ricos</a><!-- l -->
Buscar números
Hola amigo... Podrías mostrar como tienes creado el TAG sobre el cual quieres realizar el seek? Saludos,
Buscar números
El indice se construye así // "Importe",; ( dbfFacCliT )->( ordCondSet( "!Deleted()", {|| !Deleted() }, , , , , , , , , , , .t. ) ) ( dbfFacCliT )->( ordCreate( cPath + "FACCLIP.CDX", "nImporte", "nImporte", {|| Field->nImporte }, ) ) Saludos
Buscar números
No debería tener ningún problema esto: [code=fw:2le2ng9h]<div class="fw" id="{CB}" style="font-family: monospace;">nBusqueda:=<span style="color: #000000;">109.23</span><br />dbSeek<span style="color: #000000;">&#40;</span>nBusqueda<span style="color: #000000;">&#41;</span></div>[/code:2le2ng9h] ¿No encuentra el número o te da error?
Buscar números
Anda, anda Manolillo!!! anda que a estas alturas!!! Usa StrZero(<nNúmero>) --> cNúmero Y lo debes aplicar así ( dbfFacCliT )->( ordCreate( cPath + "FACCLIP.CDX", "nImporte", "nImporte", {|| StrZero( Field->nImporte ) }, ) ) Para buscar lo mismo: dbSeek( StrZero( nNumero ) ) De hecho yo haria mi propia funcion de busqueda de numeros function dbSeekNum( nNumero ) return dbSeek( StrZero( nNumero ) ) A ver cuando te vienes a la capital o a 4 tetas y nos tomamos unas birrasss <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Buscar números
Nada tios falsa alarma, ya funciona bien. Alguien me quito un val() de mi código y me volvió loco. Siento las molestias. Gracias.
Buscar números
Manu tio, No puedo crear el indice como carácter, es largo de explicar. El martes tengo q ir para Sevilla, a ver si te llamo y comemos juntos. Contesta a correos anda... Saludos.
Buscar números
Ok!! Por cierto, he editado el post anterior. Si quieres dame un toque a mi telefono o yo te llamo y me explicas porqué tiene que ser numerico el indice...
Buscar números
Pero si no coges nunca el teléfono. Tu tienes el mio?
Buscar palabra en texto con Xbrowse
Saludos a todos: Estoy trabando con visualizar archivos de texto plano, ya tengo resuelto como poder verlos con la clase Xbrowse con el siguiente código. [code=fw:ymnclv4y]<div class="fw" id="{CB}" style="font-family: monospace;">TextFile<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oDlg, oSay, oIco, oGet, oBtn, oBrw, oCol<br />   <span style="color: #00C800;">local</span> cText:= space<span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> lValid:= .F.<br />   <span style="color: #00C800;">local</span> oTxt  := TTxtFile<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Z:<span style="color: #000000;">\P</span>RUEBAS<span style="color: #000000;">\M</span>iEditor<span style="color: #000000;">\T</span>exto.txt"</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> aGrad := <span style="color: #000000;">&#123;</span>  <span style="color: #000000;">&#123;</span>  <span style="color: #000000;">1</span>/<span style="color: #000000;">20</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">235</span>, <span style="color: #000000;">244</span>, <span style="color: #000000;">253</span> <span style="color: #000000;">&#41;</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">235</span>, <span style="color: #000000;">244</span>, <span style="color: #000000;">253</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>, ;<br />                     <span style="color: #000000;">&#123;</span>  <span style="color: #000000;">1</span>/<span style="color: #000000;">20</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">125</span>, <span style="color: #000000;">162</span>, <span style="color: #000000;">206</span> <span style="color: #000000;">&#41;</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">125</span>, <span style="color: #000000;">162</span>, <span style="color: #000000;">206</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>, ;<br />                     <span style="color: #000000;">&#123;</span> <span style="color: #000000;">16</span>/<span style="color: #000000;">20</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">220</span>, <span style="color: #000000;">235</span>, <span style="color: #000000;">252</span> <span style="color: #000000;">&#41;</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">193</span>, <span style="color: #000000;">219</span>, <span style="color: #000000;">252</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>, ;<br />                     <span style="color: #000000;">&#123;</span>  <span style="color: #000000;">1</span>/<span style="color: #000000;">20</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">125</span>, <span style="color: #000000;">162</span>, <span style="color: #000000;">206</span> <span style="color: #000000;">&#41;</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">125</span>, <span style="color: #000000;">162</span>, <span style="color: #000000;">206</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>, ;<br />                     <span style="color: #000000;">&#123;</span>  <span style="color: #000000;">1</span>/<span style="color: #000000;">20</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">235</span>, <span style="color: #000000;">244</span>, <span style="color: #000000;">253</span> <span style="color: #000000;">&#41;</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">235</span>, <span style="color: #000000;">244</span>, <span style="color: #000000;">253</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>  <span style="color: #000000;">&#125;</span><br /><br />     <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">ICON</span>    oIco <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"01"</span><br />     <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span>  oDlg <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"HEADERS"</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Revisando Archivos de Texto.."</span> <span style="color: #0000ff;">ICON</span> oIco<br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">SAY</span>     oSay                 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">100</span> <span style="color: #0000ff;">OF</span> oDlg<br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span>     oGet <span style="color: #0000ff;">Var</span> cText       <span style="color: #0000ff;">ID</span> <span style="color: #000000;">200</span> <span style="color: #0000ff;">OF</span> oDlg<br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oBrw COLUMNS <span style="color: #ff0000;">"cLine"</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">300</span> <span style="color: #0000ff;">OF</span> oDlg OBJECT oTxt FOOTERS<br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span>  oBtn                 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">400</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span>lValid:= .T., oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br />   WITH OBJECT <span style="color: #000000;">&#40;</span> oCol := oBrw:<span style="color: #000000;">aCols</span><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 />      :<span style="color: #000000;">bFooter</span>   := <span style="color: #000000;">&#123;</span> || <span style="color: #ff0000;">"Linea: "</span> + Ltrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> oTxt:<span style="color: #000000;">RecNo</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" / "</span> + LTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> oTxt:<span style="color: #000000;">RecCount</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />      :<span style="color: #000000;">cHeader</span>   := <span style="color: #ff0000;">"Z:<span style="color: #000000;">\P</span>RUEBAS<span style="color: #000000;">\M</span>iEditor<span style="color: #000000;">\T</span>exto.txt"</span>      <br />   END<br /><br />   WITH OBJECT oBrw<br />      :<span style="color: #000000;">bChange</span>       := <span style="color: #000000;">&#123;</span> || oCol:<span style="color: #000000;">RefreshFooter</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />      :<span style="color: #000000;">bClrSelFocus</span>  := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK, aGrad <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />      :<span style="color: #000000;">nMarqueeStyle</span> := <span style="color: #000000;">4</span><br />      :<span style="color: #000000;">nStretchCol</span>   := <span style="color: #000000;">1</span><br />      :<span style="color: #000000;">nRowHeight</span>    := <span style="color: #000000;">20</span><br />   END<br /><br />   oDlg:<span style="color: #000000;">lHelpIcon</span>:= .F.<br />   <br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">centered</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">VALID</span> lValid<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:ymnclv4y] Quedando de esta manera: [img:ymnclv4y]http&#58;//sia1&#46;subirimagenes&#46;net/img/2015/07/03/150703050044840886&#46;jpg[/img:ymnclv4y] Pero necesito tener un get para buscar palabras, como lo puedo hacer, he buscado en el foro pero solo hay ejemplos en bases de datos, ando algo perdido.. Saludos y gracias..
Buscar palabra en texto con Xbrowse
Cuate, a mi esto me va bien con sql, por ahi alguien en el foro me compartio en su momento codigo, no recuerdo (sorry), pero lo devuelo para ayuda: [code=fw:2io9f7gi]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">LOCAL</span> cBusca := <span style="color: #ff0000;">""</span>, oStatusBar, cOrden := <span style="color: #ff0000;">"nombre"</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> :: <span style="color: #000000;">oChild</span> &nbsp;......<br /><br /><span style="color: #0000ff;">DEFINE</span> STATUSBAR oStatusBar <span style="color: #0000ff;">OF</span> ::<span style="color: #000000;">oChild</span> <span style="color: #0000ff;">PROMPT</span> cBusca<br /><br /><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oBrw ..........<br /><br />&nbsp; oBrw:<span style="color: #000000;">bKeyDown</span> &nbsp;:= <span style="color: #000000;">&#123;</span> | nKey| IIF<span style="color: #000000;">&#40;</span> nKey == VK_DELETE, <span style="color: #000000;">&#40;</span> this:<span style="color: #000000;">cAccion</span> := <span style="color: #ff0000;">"E"</span>, this:<span style="color: #000000;">BorrarCatalogo</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp; &nbsp;<span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> nKey == VK_INSERT, <span style="color: #000000;">&#40;</span> this:<span style="color: #000000;">cAccion</span> := <span style="color: #ff0000;">"A"</span>, this:<span style="color: #000000;">AgregarCatalogo</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp; <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> nKey == VK_RETURN, <span style="color: #000000;">&#40;</span> this:<span style="color: #000000;">cAccion</span> := <span style="color: #ff0000;">"M"</span>, this:<span style="color: #000000;">ModificarCatalogo</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> nKey <> <span style="color: #000000;">13</span>, SeekText<span style="color: #000000;">&#40;</span>nKey,@::<span style="color: #000000;">oQry</span>,ALLTRIM<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">cTabla</span><span style="color: #000000;">&#41;</span>,cOrden,::<span style="color: #000000;">oBrw</span>,@cBusca,oStatusBar,, ::<span style="color: #000000;">cWhere</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />*---------------------------------------<br />* FUNCION: <span style="color: #000000;">SeekText</span><br />* Descripcion: <span style="color: #000000;">Busqueda</span> Incremental<br />* Fecha: <span style="color: #000000;">19</span>/<span style="color: #000000;">12</span>/<span style="color: #000000;">2011</span><br />*---------------------------------------<br /><span style="color: #00C800;">FUNCTION</span> SeekText<span style="color: #000000;">&#40;</span>nKey,oQry2,oTabla,oOrden,oLbx,cBusca,oMsgBar,cSelect,cWhere<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">Local</span> cQuery,campo<br /><span style="color: #00C800;">DEFAULT</span> cSelect := <span style="color: #ff0000;">"*"</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; cWhere &nbsp;:= <span style="color: #ff0000;">""</span><br /><br /><span style="color: #00C800;">IF</span> nKey=<span style="color: #000000;">8</span><br />&nbsp; &nbsp;cbusca:= <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span>cbusca,<span style="color: #000000;">1</span>,Len<span style="color: #000000;">&#40;</span>cbusca<span style="color: #000000;">&#41;</span><span style="color: #000000;">-1</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> Empty<span style="color: #000000;">&#40;</span>cWhere<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;cQuery := <span style="color: #ff0000;">"SELECT "</span> + cSelect + <span style="color: #ff0000;">" FROM "</span> + oTabla + <span style="color: #ff0000;">" WHERE "</span> + oOrden + <span style="color: #ff0000;">" LIKE '%"</span>+UPPER<span style="color: #000000;">&#40;</span>cBusca<span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"%' ORDER BY "</span> + oOrden<br />&nbsp; &nbsp;<span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp; &nbsp; &nbsp;cQuery := <span style="color: #ff0000;">"SELECT "</span> + cSelect + <span style="color: #ff0000;">" FROM "</span> + oTabla + <span style="color: #ff0000;">" "</span> + cWhere + <span style="color: #ff0000;">" AND "</span> + oOrden + <span style="color: #ff0000;">" LIKE '%"</span> + UPPER<span style="color: #000000;">&#40;</span>cBusca<span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"%' ORDER BY "</span> + oOrden<br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp;oQry2:<span style="color: #000000;">cQuery</span> := cQuery<br />&nbsp; &nbsp;oQry2:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oQry2:<span style="color: #000000;">GoTop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp;<span style="color: #00C800;">If</span> nKey=<span style="color: #000000;">190</span><br />&nbsp; &nbsp; &nbsp; cbusca :=cbusca + <span style="color: #ff0000;">"."</span><br />&nbsp; &nbsp;<span style="color: #00C800;">Else</span><br />&nbsp; &nbsp; &nbsp; cbusca :=cbusca + Upper<span style="color: #000000;">&#40;</span>chr<span style="color: #000000;">&#40;</span>nkey<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">Endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> Empty<span style="color: #000000;">&#40;</span>cWhere<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;cQuery := <span style="color: #ff0000;">"SELECT "</span> + cSelect + <span style="color: #ff0000;">" FROM "</span> + oTabla + <span style="color: #ff0000;">" WHERE "</span> + oOrden + <span style="color: #ff0000;">" LIKE '%"</span> + UPPER<span style="color: #000000;">&#40;</span>cBusca<span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"%' ORDER BY "</span> + oOrden<br />&nbsp; &nbsp;<span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp; &nbsp; &nbsp;cQuery := <span style="color: #ff0000;">"SELECT "</span> + cSelect + <span style="color: #ff0000;">" FROM "</span> + oTabla + <span style="color: #ff0000;">" "</span> + cWhere + <span style="color: #ff0000;">" AND "</span> + oOrden + <span style="color: #ff0000;">" LIKE '%"</span> + UPPER<span style="color: #000000;">&#40;</span>cBusca<span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"%' ORDER BY "</span> + oOrden<br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp;oQry2:<span style="color: #000000;">cQuery</span> := cQuery<br />&nbsp; &nbsp;oQry2:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oQry2:<span style="color: #000000;">GoTop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">ENDIF</span><br />oMsgBar:<span style="color: #000000;">SetMsg</span><span style="color: #000000;">&#40;</span> PadR<span style="color: #000000;">&#40;</span> cBusca ,<span style="color: #000000;">200</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />oLbx:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span>.T.<span style="color: #000000;">&#41;</span><br />oLbx:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br />&nbsp;</div>[/code:2io9f7gi] Saludos
Buscar palabra en texto con Xbrowse
Hola Pakito: Gracias por leer mi mensaje, desafortunadamente el código que me ofreces como ejemplo es para buscar texto en una base de datos sql, pero lo que necesito es buscar palabras en un archivo plano de block de notas (.txt), le he buscado y probado pero no me da resultados.. Ojala algun maestro del xbrowse me pueda orientar.. Saludos.
Buscar palabra en texto con Xbrowse
TTxtEDit() class is the most suitable class to view and edit any text file. I suggest you try that class for text files instead of xbrowse. The TTxtEDit class has built-in methods for search ,search and replace and many more suitable for text. After trying TTxtEdit, still if you want to use XBrowse, please let us know and we shall guide you further.
Buscar palabra en texto con Xbrowse
There is error while I compile C:\fwh\samples\testtxte.Prg Attached screen file [url:370bwkbj]http&#58;//www&#46;filedropper&#46;com/testtxteerr[/url:370bwkbj]
Buscar palabra en texto con Xbrowse
Saludos Mr. Rao: TTxtEDit() era una de mis opciones, pero esta bastante incompleta en cuanto a funciones literalmente como decimos en mi pais "esta bastante verde", no soporta el uso del Scroll Vertical del Mouse, la Función ::Search( cText, nFromLine ) No funciona, y menos remarca la palabra que se esta buscando, lo más proximo a lo que necesito esta en la clase TTxtFile(), su apariencia no es muy bonita, y no hay ejemplos, para poder usarlo desde recursos me llevo un rato pero funciona, ademas de que presenta errores al cerrar el dialogo que lo contiene, y al volver a abrirlo: TTxtEDit() it was one of my choices, but this very incomplete in terms of functions literally as we say in my country " this pretty green " does not support the use of vertical Scroll Mouse, Function :: Search ( cText , nFromLine ) does not work , and but highlights the word being searched , as close to what I need is in the TTxtFile class () , its appearance is not very nice , and there are no examples , so you can use from resources I take a while but it works, besides having errors when closing the dialog containing it, and reopen it : [code=fw:33goxrxn]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#INCLUDE</span> <span style="color: #ff0000;">"FiveWin.CH"</span><br /><br /><span style="color: #00C800;">Function</span> TextFile<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oDlg, oSay, oIco, oGet, oBtn, oTxt, xText<br />   <span style="color: #00C800;">local</span> cText:= space<span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> aGrad := <span style="color: #000000;">&#123;</span>  <span style="color: #000000;">&#123;</span>  <span style="color: #000000;">1</span>/<span style="color: #000000;">20</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">235</span>, <span style="color: #000000;">244</span>, <span style="color: #000000;">253</span> <span style="color: #000000;">&#41;</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">235</span>, <span style="color: #000000;">244</span>, <span style="color: #000000;">253</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>, ;<br />                     <span style="color: #000000;">&#123;</span>  <span style="color: #000000;">1</span>/<span style="color: #000000;">20</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">125</span>, <span style="color: #000000;">162</span>, <span style="color: #000000;">206</span> <span style="color: #000000;">&#41;</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">125</span>, <span style="color: #000000;">162</span>, <span style="color: #000000;">206</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>, ;<br />                     <span style="color: #000000;">&#123;</span> <span style="color: #000000;">16</span>/<span style="color: #000000;">20</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">220</span>, <span style="color: #000000;">235</span>, <span style="color: #000000;">252</span> <span style="color: #000000;">&#41;</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">193</span>, <span style="color: #000000;">219</span>, <span style="color: #000000;">252</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>, ;<br />                     <span style="color: #000000;">&#123;</span>  <span style="color: #000000;">1</span>/<span style="color: #000000;">20</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">125</span>, <span style="color: #000000;">162</span>, <span style="color: #000000;">206</span> <span style="color: #000000;">&#41;</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">125</span>, <span style="color: #000000;">162</span>, <span style="color: #000000;">206</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>, ;<br />                     <span style="color: #000000;">&#123;</span>  <span style="color: #000000;">1</span>/<span style="color: #000000;">20</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">235</span>, <span style="color: #000000;">244</span>, <span style="color: #000000;">253</span> <span style="color: #000000;">&#41;</span>, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">235</span>, <span style="color: #000000;">244</span>, <span style="color: #000000;">253</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>  <span style="color: #000000;">&#125;</span><br /><br />     <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">ICON</span>    oIco <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"01"</span><br />     <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span>  oDlg <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"HEADERS"</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Revisando Archivos de Texto.."</span> <span style="color: #0000ff;">ICON</span> oIco<br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">SAY</span>     oSay                 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">100</span> <span style="color: #0000ff;">OF</span> oDlg<br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span>     oGet <span style="color: #0000ff;">Var</span> cText       <span style="color: #0000ff;">ID</span> <span style="color: #000000;">200</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">valid</span> <span style="color: #000000;">&#40;</span>xText:= alltrim<span style="color: #000000;">&#40;</span>cText<span style="color: #000000;">&#41;</span>, oTxt:<span style="color: #000000;">Search</span><span style="color: #000000;">&#40;</span>xText,<span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span>,.T.<span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span>  oBtn                 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">400</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span>oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br />   oTxt:= TTxtEdit<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #0000ff;">Redefine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">300</span>, oDlg<span style="color: #000000;">&#41;</span><br />  <br />  oTxt:<span style="color: #000000;">lReadOnly</span> = .T.  <br />  oTxt:<span style="color: #000000;">Load</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Z:<span style="color: #000000;">\P</span>RUEBAS<span style="color: #000000;">\M</span>iEditor<span style="color: #000000;">\T</span>exto.txt"</span><span style="color: #000000;">&#41;</span><br />  oTxt:<span style="color: #000000;">SetLineNumber</span><span style="color: #000000;">&#40;</span>.F.<span style="color: #000000;">&#41;</span><br />  oTxt:<span style="color: #000000;">nClrLineNumber</span> := RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">220</span>,<span style="color: #000000;">220</span>,<span style="color: #000000;">220</span> <span style="color: #000000;">&#41;</span><br /><br />  oDlg:<span style="color: #000000;">lHelpIcon</span>:= .F.<br />   <br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">Centered</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:33goxrxn] [img:33goxrxn]http&#58;//k30&#46;kn3&#46;net/FC6B1281D&#46;jpg[/img:33goxrxn] [quote:33goxrxn]FiveWin Version: FWH 11.11 Windows version: 5.1, Build 2600 Service Pack 3 Time from start: 0 hours 0 mins 8 secs Error occurred at: 07/07/15, 12:39:22 Error description: Error BASE/1004 No exported method: HBRUSH Args: [ 1] = U Stack Calls =========== Called from: => HBRUSH( 0 ) Called from: .\source\classes\TTXTEDIT.PRG => TTXTEDIT:PAINT( 1092 ) Called from: .\source\classes\TTXTEDIT.PRG => (b)TTXTEDIT( 94 ) Called from: .\source\classes\TTXTEDIT.PRG => TTXTEDIT:DISPLAY( 0 ) Called from: .\source\classes\CONTROL.PRG => TTXTEDIT:HANDLEEVENT( 1699 ) Called from: .\source\classes\WINDOW.PRG => _FWH( 3345 ) Called from: => DIALOGBOX( 0 ) Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 286 ) Called from: Headers.prg => TEXTFILE( 28 ) Called from: MiEditor.prg => (b)BUILDRIBBONBAR( 60 ) Called from: .\source\classes\TRBTN.PRG => TRBTN:CLICK( 714 ) Called from: .\source\classes\TRBTN.PRG => TRBTN:LBUTTONUP( 923 ) Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1723 ) Called from: .\source\classes\TRBTN.PRG => TRBTN:HANDLEEVENT( 1596 ) Called from: .\source\classes\WINDOW.PRG => _FWH( 3345 ) Called from: => WINRUN( 0 ) Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE( 1050 ) Called from: MiEditor.prg => PRINCIPAL( 28 ) Called from: MiEditor.prg => MAIN( 14 ) System ====== CPU type: Intel(R) Pentium(R) D CPU 3.20GHz 3200 Mhz Hardware memory: 1022 megs Free System resources: 90 % GDI resources: 90 % User resources: 90 % Windows total applications running: 6 1 , C:\WINDOWS\WinSxS\X86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.5512_x-ww_35d4ce83 2 , C:\WINDOWS\system32\SHLWAPI.dll 3 FiveTech Software tech support forums • Ver Tema - Buscar palabra en texto con Xbrowse, 4 MediaCenter, Z:\PRUEBAS\MiEditor\freeimage.dll 5 MiEditor: Consola de depuración Z:\PRUEBAS\MiEditor\MiEditor.Exe (0 errores, 0 a tener en cuenta "Warnings"), Z:\PRUEBAS\MiEditor\MiEditor.Exe 6 SysFader, C:\WINDOWS\system32\SHELL32.DLL Variables in use ================ Procedure Type Value ========================== HBRUSH Param 1: O Class: ERROR TTXTEDIT:PAINT Local 1: U Local 2: U (b)TTXTEDIT Local 1: U Local 2: U Local 3: A Len: 5 Local 4: U Local 5: S Local 6: U Local 7: N -1895752748 Local 8: A Len: 4 TTXTEDIT:DISPLAY Param 1: O Class: TTXTEDIT TTXTEDIT:HANDLEEVENT _FWH Param 1: N 15 Param 2: N 0 Param 3: N 0 Local 1: U DIALOGBOX Param 1: N 0 Param 2: N 15 Param 3: N 0 Param 4: N 0 Param 5: N 28 Local 1: O Class: TTXTEDIT TDIALOG:ACTIVATE Param 1: N 4194304 Param 2: C "HEADERS" Param 3: N 7537254 Param 4: O Class: TDIALOG TEXTFILE Param 1: U Param 2: U Param 3: U Param 4: L .T. Param 5: U Param 6: L .T. Param 7: U Param 8: U Param 9: U Param 10: L .F. Param 11: L .F. Local 1: N 7537254 Local 2: S Local 3: O Class: TDIALOG (b)BUILDRIBBONBAR Local 1: O Class: TDIALOG Local 2: O Class: TSAY Local 3: O Class: TICON Local 4: O Class: TGET Local 5: O Class: TBUTTON Local 6: O Class: TTXTEDIT Local 7: U Local 8: C " " Local 9: A Len: 5 TRBTN:CLICK Param 1: O Class: TRBTN TRBTN:LBUTTONUP TCONTROL:HANDLEEVENT Param 1: N 60 Param 2: N 39 Param 3: N 0 Local 1: L .T. Local 2: L .T. Local 3: S TRBTN:HANDLEEVENT Param 1: N 514 Param 2: N 0 Param 3: N 3932199 Local 1: U _FWH Param 1: N 514 Param 2: N 0 Param 3: N 3932199 WINRUN Param 1: N 3932199 Param 2: N 514 Param 3: N 0 Param 4: N 3932199 Param 5: N 7 Local 1: O Class: TRBTN TWINDOW:ACTIVATE Param 1: N 7537254 PRINCIPAL Param 1: C "MAXIMIZED" Param 2: U Param 3: U Param 4: U Param 5: U Param 6: U Param 7: U Param 8: B {|| ... } Param 9: U Param 10: U Param 11: U Param 12: U Param 13: U Param 14: U Param 15: U Param 16: U Param 17: B {|| ... } Param 18: U Param 19: U Param 20: L .F. Local 1: O Class: TWINDOW Local 2: U Local 3: U MAIN Local 1: O Class: TICON Linked RDDs =========== DBF DBFFPT DBFBLOB DBFNTX DataBases in use ================ Classes in use: =============== 1 ERROR 2 HBCLASS 3 HBOBJECT 4 MISDATOS 5 TWINDOW 6 TCONTROL 7 TICON 8 TBRUSH 9 TFONT 10 TMSGBAR 11 TRECT 12 TBITMAP 13 TIMAGE 14 TRIBBONBAR 15 TRPANEL 16 TRBGROUP 17 TRBTN 18 TDIALOG 19 TSAY 20 TGET 21 GET 22 TCLIPGET 23 TBUTTON 24 TTXTEDIT 25 TSCROLLBAR 26 TREG32 Memory Analysis =============== 223 Static variables Dynamic memory consume: Actual Value: 0 bytes Highest Value: 0 bytes [/quote:33goxrxn]
Buscar palabras en mysql
Buenas estimado foro: Necesito hacer una busqueda dentro de una tabla, a aquellos registros que en el campo nombre contengan palabras que comiencen con una palabra determinada a buscar, bien sea que vaya en minusculas o mayusculas. Que funciones de mysql debo emplear par construir el query. Gracias
Buscar palabras en mysql
Ernesto: Yo lo hago asi: [code=fw:2av8mzbx]<div class="fw" id="{CB}" style="font-family: monospace;"><br />cVar := <span style="color: #ff0000;">"terMINA"</span><br /><span style="color: #ff0000;">"SELECT * FROM cuenta WHERE UCASE(descripcio) like '%"</span> + UPPER<span style="color: #000000;">&#40;</span>cVar<span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"%' ORDER BY codigo; "</span><br />&nbsp;</div>[/code:2av8mzbx] Atentamente, Rolando. Cochabamba, Bolivia
Buscar palabras en mysql
Quando se utiliza %, não é necessário utilizar UPPER Ronaldo
Buscar texto desconocido en una variable
Hola amigos, estoy molestando nuevamente. Tengo una variable cPaginaWeb, donde está en formato texto, todo el contenido de una página web. Busco y encuentro un ctextoabuscar := ""moneda">D¢lar</p> </div> </td> <td>&nbsp;&nbsp;</td> <td> <div class="linea"> <p class="valor">" Ahora necesito extraer los caracteres siguientes a ese cTextoaBuscar, que en realidad es la cotización del Dólar. Muchas gracias. Saludos Ruben Dario Fernandez
Buscar texto desconocido en una variable
Tengo una variable cPaginaWeb, donde está en formato texto, todo el contenido de una página web. Busco y encuentro un ctextoabuscar := ""moneda">D¢lar</p> </div> </td> <td>&nbsp;&nbsp;</td> <td> <div class="linea"> <p class="valor">" Ahora necesito extraer los caracteres siguientes a ese cTextoaBuscar, que en realidad es la cotización del Dólar. [code=fw:xc3ryqc1]<div class="fw" id="{CB}" style="font-family: monospace;"><br />cValorDolar:=<span style="color: #0000ff;">Substr</span><span style="color: #000000;">&#40;</span>cPaginaweb, <span style="color: #00C800;">At</span> <span style="color: #000000;">&#40;</span> cTextoaBuscar, cPaginaweb <span style="color: #000000;">&#41;</span>+Len<span style="color: #000000;">&#40;</span>cTextoaBuscar<span style="color: #000000;">&#41;</span><span style="color: #000000;">+1</span>, nAnchoValorDolar<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /> </div>[/code:xc3ryqc1] No lo he probado pero debería funcionar. Básicamente localizas la posición del cTextoaBuscar dentro de la cadena y empiezas a coger caracteres desde donde acaba cTextoaBuscar en cPAginaWeb.
Buscar texto desconocido en una variable
Angel muchas gracias. Lo solucioné de la siguiente manera. [code=fw:31ce6dg2]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">FUNCTION</span> BROUCOTIZA<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">LOCAL</span>  cTipodecambio:= <span style="color: #ff0000;">" "</span>  ,cCotiaBuscar:= <span style="color: #ff0000;">""</span>,ct4, ctx := <span style="color: #ff0000;">"D.lar<span style="color: #000000;">\s</span>*<.+?(<span style="color: #000000;">\d</span>+,<span style="color: #000000;">\d</span>+).+?(<span style="color: #000000;">\d</span>+,<span style="color: #000000;">\d</span>+)"</span>  <br />                                                         <br />cTipodecambio := LEERCOTIZACION<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br /><br />ct4 := HB_RegExAtx<span style="color: #000000;">&#40;</span> ctx, cTipodecambio,.F.,.T.  <span style="color: #000000;">&#41;</span><br /><br />cCotiCompra := <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> xTrim<span style="color: #000000;">&#40;</span> ct4<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">1</span>,<span style="color: #000000;">6</span><span style="color: #000000;">&#41;</span>    <span style="color: #B900B9;">/// me da la compra</span><br />cCotiVenta := <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> xTrim<span style="color: #000000;">&#40;</span> ct4<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">1</span>,<span style="color: #000000;">6</span><span style="color: #000000;">&#41;</span>     <span style="color: #B900B9;">/// me da la venta</span><br /><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span>.T.<span style="color: #000000;">&#41;</span> <br /><span style="color: #B900B9;">//---------------------------------------//</span><br /><span style="color: #00C800;">FUNCTION</span> LEERCOTIZACION<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">LOCAL</span> curl:=<span style="color: #ff0000;">"https://www.portal.brou.com.uy/cotizaciones/"</span><br /><span style="color: #00C800;">LOCAL</span> oHttp:= CreateObject<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"winhttp.winhttprequest.5.1"</span><span style="color: #000000;">&#41;</span><br /><br />oHttp:<span style="color: #000000;">SetTimeouts</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">30000</span>, <span style="color: #000000;">30000</span>, <span style="color: #000000;">30000</span>, <span style="color: #000000;">30000</span> <span style="color: #000000;">&#41;</span><br />oHttp:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"GET"</span>, cUrl, .f. <span style="color: #000000;">&#41;</span><br />oHttp:<span style="color: #000000;">Send</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />cTexToHTML:= oHttp:<span style="color: #000000;">ResponseText</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span>cTexToHTML<span style="color: #000000;">&#41;</span><br /><br />   </div>[/code:31ce6dg2] Gracias Saludos Ruben Dario Fernandez
Buscar texto desconocido en una variable
¡Expresiones regulares! [img:2m9rn9fn]https&#58;//s12&#46;postimg&#46;org/6x43lhsr1/De-_Chapeau&#46;jpg[/img:2m9rn9fn]
Buscar texto en un fichero
Hola amigos foreros. Me ha tocado lidiar con ficheros de texto muy grandes (muchos megas). Tengo que encontrar ciertos patrones de texto para procesar lo que va detrás. Mi intención es utilizar las funciones de manejo de ficheros de bajo nivel, tipo FOPEN(), FREAD(), etc.. Pero ¿que hago para la búsqueda? Mi pregunta es, hay alguna forma de encontrar patrones de texto en dichos ficheros sin tener que cargarlos en variables para buscar con AT(). Algunos ficheros miden mas de 15 megas. ¿Existe alguna función de búsqueda de bajo nivel tipo FSCAN() o algo así en xHarbour? Gracias de antemano.
Buscar texto en un fichero
Saludos. En efecto, con las funciones fopen(), fread(), freadstr() puedes leer el archivo binario que quieras y del tamaño que sea. Sin son archivos texto que tengan internamente un delimitador con un "pipe", un CRLF o el que sea, utiliza la freadstr() que te permite leer cadenas de la misma longitud. p.ej. funtion miarchivo() local n,txt,bloque:=256 // numero de caracteres que tenga la cadena txt hasta 65,000 aprox. n:=fopen('archivo',MODO) // modo es segun la apertura de lectura, escritura.... while !empty(txt:=freadstr(n,bloque)) ... aqui puedo ver el contenido de txt end return NIL puedes incluso crear varios archivos txt1,txt2,txt.... usando fwrite() con otro archivo creado Fwh 8.11, xH1.1, bcc55
Buscar texto en un fichero
Las famosas librerías FUNCKY tenían una función llamada [b:26ji9ohp]flocate[/b:26ji9ohp] que era estupenda. La última versión 6 [b:26ji9ohp]NO la tiene[/b:26ji9ohp]. Su descripción: [quote:26ji9ohp] Name: flocate() - locate text in a text file _xkey() - specify no abort in flocate() _xkeyval() - specify key that aborts flocate() Usage: [<integer>] = flocate(<handle>,<string>,[<case>]) [<logical>] = _xkey([<logical>]) [<key>] = _xkeyval(<key>) Params: integer <handle> from a previous fopen() or fcreate() string <string> - the string to locate in the file logical <case> - optional case specifier. If <case> is .T., then the text of the file is converted to uppercase before it is compared to <string>, If <case> is false, then the text is converted to lowercase before it is compared to <string>. If this parameter is left off, then the text is left as is. To search for non case sensitive text, use the appropriate <case> value, and then convert the string to be searched for to either upper or lower case. Note that converting the text in the file to either upper or lower case does not modify the text in the file. _xkey() tells flocate() if the user is allowed to abort an flocate() search via an ESCape key. _xkeyval() tells flocate() what the ESCape key is. The default value for _xkey() is always .T. (aborting allowed). the default abort key is ESCape (27) until you redefine it._xkey() parameters are logical .T. to turn user abort on, .F. to turn it off. _xkeyval() parameters are any valid inkey() value that you want the abort key to be. The default is to have abort capability on using ESCape. Returns: integer equal to the offset of the first byte of the found string. The file pointer is positioned on the first letter of the found string. if a read error occurs flocate() returns a -1. If the string is not found, a -2 is returned and the pointer is returned to the position where it started the search. If the user aborted the search, a -3 is returned and the pointer is returned to the position where it started the search. If no parameters are sent to _xkey() it returns the current state of the _xkey() flag - .T. equals on, .F. equals off. _xkeyval() returns the current abort key value as an integer. ---------------------------------------- Example -------------------- [code=fw:26ji9ohp]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;use names<br />                 handle = fopen<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"names.txt"</span><span style="color: #000000;">&#41;</span><br />                 offset = flocate<span style="color: #000000;">&#40;</span>handle,<span style="color: #ff0000;">"dLESKO"</span><span style="color: #000000;">&#41;</span><br />                 <span style="color: #00C800;">if</span> offset < <span style="color: #000000;">0</span><br />                      ? <span style="color: #ff0000;">"text not found...."</span><br />                 <span style="color: #00C800;">else</span><br />                      m_name = freadline<span style="color: #000000;">&#40;</span>handle<span style="color: #000000;">&#41;</span><br />                      m_address = freadline<span style="color: #000000;">&#40;</span>handle<span style="color: #000000;">&#41;</span><br />                      m_city = freadline<span style="color: #000000;">&#40;</span>handle<span style="color: #000000;">&#41;</span><br />                      m_state = freadline<span style="color: #000000;">&#40;</span>handle<span style="color: #000000;">&#41;</span><br />                      m_zip = freadline<span style="color: #000000;">&#40;</span>handle<span style="color: #000000;">&#41;</span><br />                      replace <span style="color: #0000ff;">name</span> with m_name,;<br />                             address with m_address,;<br />                             city with m_city,;<br />                             state with m_state,;<br />                             zip with m_zip<br />                 <span style="color: #00C800;">endif</span><br /><br />                 fclose<span style="color: #000000;">&#40;</span>handle<span style="color: #000000;">&#41;</span><br />                 close databases</div>[/code:26ji9ohp] Note: Searching takes a about 1 second per 50k of file depending on type of machine used. If a no find occurs, (-2 or -3) the file pointer is left where it started. If a read error occurs (-1), then the file pointer can be anywhere. flocate() starts the search starting at the current pointer position and stops at the first occurrence of the found string. To search for multiple occurrences, find the first occurrence, freadstr() or fseek() past it, and start searching for the next occurrence.[/quote:26ji9ohp]
Buscar texto en un fichero
Saludos Puedes mirar la clase TFile de fivewin
Buscar texto en un fichero
[quote="JmGarcia":3lbpdmmu]La última versión 6 [b:3lbpdmmu]NO la tiene[/b:3lbpdmmu].[/quote:3lbpdmmu] Me adelante a pensar que no la tenía... pues la tiene a traves de COM (common object model). [quote:3lbpdmmu]Locate Locate a string of text in the file -------------------------------------------------------------------------------- FUNCky 6.0® COM Component -------------------------------------------------------------------------------- Syntax obj.Locate( Str [, Flag ] ) Part -------------------------------------------------------------------------------- Description -------------------------------------------------------------------------------- obj A File object returned from a previous call to FUNCky.CreateFile. Str The string of text to look for. Flag The case sensitivity to use. Optional. If omitted, TRUE is assumed. Returns The file pointer position where the first matching string was found, -1 if an error occurred, -2 if the string was not found. Description Locate searches the current file for a specific string of text. The search begins at the current file pointer position and ends when the first occurrence of the string is found, or when the end of file is reached, whichever comes first. The string to search for is specified via the parameter Str. The case sensitivity of the search can be specified via the parameter Flag. When Flag is True, a case sensitive search is performed. When Flag is False, a non-case sensitive searched is performed. If Flag is not specified, True is assumed. If the specified string is found, the file pointer is positioned on the first character in the found string and its offset within the file is returned. If the specified string is not found, -2 is returned and the file pointer position is unchanged. If an error occurred while searching for the string, -1 is returned and the file pointer is left in an undetermined position. If an error occurs, the Error and ErrorMessage properties can be queried for more detailed information. -------------------------------------------------------------------------------- Tip Use the Skip method to rewind the file pointer to the beginning of the line of text where the string is found so that the whole line of text including the string may be read. To search for multiple occurrences of text, find the first occurrence, then add the length of the found string to the Offset property to skip over it. Then just repeat the search. -------------------------------------------------------------------------------- Example [code=fw:3lbpdmmu]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// This example opens a file, searches for the</span><br /><span style="color: #B900B9;">// word "Gadzooks", and if found, the file</span><br /><span style="color: #B900B9;">// pointer is rewound to the start of the line</span><br /><span style="color: #B900B9;">// to read the whole line of text containing the word</span><br />Set File = FUNCky.CreateFile<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">// Open some text file</span><br /><span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> File.Open<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"C:<span style="color: #000000;">\S</span>omeFile.txt"</span>, FConst.O_READONLY<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> Then<br /><br />    <span style="color: #B900B9;">// Locate the word "Gadzooks" using no case sensitivity</span><br />    Offset = File.Locate<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Gadzooks"</span>, <span style="color: #00C800;">False</span> <span style="color: #000000;">&#41;</span><br /><br />    <span style="color: #B900B9;">// Verify found</span><br />    <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> Offset >= <span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span> Then<br /><br />        <span style="color: #B900B9;">// Rewind to the beginning of the line</span><br />        Offset = File.Skip<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br /><br />        <span style="color: #B900B9;">// Read in that line of text</span><br />        Str = File.ReadLine<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />    End <span style="color: #00C800;">If</span><br /><br />    <span style="color: #B900B9;">// All done with file</span><br />    File.Close<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />End <span style="color: #00C800;">If</span></div>[/code:3lbpdmmu] [/quote:3lbpdmmu]
Buscar texto en un fichero
Gracias JmGarcia, es exactamente lo que estaba buscando. Voy a ver si encutro esas librerías por ahí.
Buscar texto en un fichero
Hola JmGarcia He encontrado la web oficial de FUNCky (muy, muy interesant) y tengo una preguntita tonta, ¿Que librería habría que bajar/comprar, la de CLIPPER o la de XBASE? Otra cosa ¿Es FREEWARE? Gracias de antemano
Buscar texto en un fichero
[quote="antolin":2llk5xr1]¿Que librería habría que bajar/comprar, la de CLIPPER o la de XBASE?[/quote:2llk5xr1]No hay que linkar nada. Solo instalar los que ellos llaman "REDISTRIBUTABLES" y se te queda instalado en el PC la tecnología COM (Common Object Model). Un ejemplo de codigo fuente, para la función [b:2llk5xr1]ChrCount[/b:2llk5xr1] de Funcky, sería algo asi: [code=fw:2llk5xr1]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">/*<br />obj.ChrCount( Chr, Str ) <br />obj  A FUNCky Object created by a previous call to CreateObject.  <br />Chr  A string containing the character to search for.  <br />Str  A string to search.  <br />Returns The number of times Chr appears within Str. If Chr is not found to be in Str, 0 is returned. <br />*/</span><br /><span style="color: #00C800;">function</span> main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />oFuncky:=CreateObject<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"FUNCky"</span><span style="color: #000000;">&#41;</span><br /><span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span>oFuncky:<span style="color: #000000;">ChrCount</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"t"</span>,<span style="color: #ff0000;">"Esto es un test"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// Visualiza un 3 (el número "t")</span><br /><span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span>oFuncky:<span style="color: #000000;">ChrCount</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"A"</span>, <span style="color: #ff0000;">"1234567"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// Visualiza 0 (no hay ninguna "A")</span><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:2llk5xr1] Otro ejemplo con la función [b:2llk5xr1]Ping[/b:2llk5xr1] de Funcky: [code=fw:2llk5xr1]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">/*<br />obj.Ping( Server [, Format ] [, Timeout ] ) <br />obj  A FUNCky Object created by a previous call to CreateObject.  <br />Server  The name or IP address of the server to ping.  <br />Format  A format string used to define the output. Optional, the default is "Reply from: xxx.xxx.xxx.xxx RTT: xx TTL: xx.  <br />Timeout  The number of milliseconds to wait before giving up. Optional. The default is 20 seconds.  <br />Returns A string containing the ping results or "" if the ping timed out or the server was not found. <br />*/</span><br /><span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span>oFuncky:<span style="color: #000000;">Ping</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"www.microsoft.com"</span>,<span style="color: #ff0000;">""</span>,<span style="color: #000000;">10000</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// Visualiza la IP del sitio.</span><br /> </div>[/code:2llk5xr1] [quote="antolin":2llk5xr1]¿Es FREEWARE?[/quote:2llk5xr1]No, es de pago.
Buscar texto en un fichero
Perdona que te de la lata, pero: En la pagina de FUNCKY no hay nada para bajar ni instalar, ¿de donde puedo bajar esa libraría? Gracias
Buscar texto en un fichero
Hola sr,,, echale un ojo a este link: [url:3e93prqi]http&#58;//www&#46;ousob&#46;com/ng/53guide/ng4bc9b&#46;php[/url:3e93prqi]
Buscar texto en un fichero
Hola Al parecer Funky no es para Windows 7 alguien me puede confirmar
Buscar texto en un fichero
Antolin: Harbour tiene la libreria hbnf.lib que es la antigua libreria Nanfor.lib Segun veo tiene buenas posibilidades para lo que necesitas, no se si esta toda convetida en harbour, pero no cuesta nada investigar. La ng de la libreria, esta aqui junto con la lib para clipper, solo sirve la ng para ver su funcionamiento. <!-- m --><a class="postlink" href="http://www.the-oasis.net/ftpmaster.php3?content=ftplib.htm">http://www.the-oasis.net/ftpmaster.php3 ... ftplib.htm</a><!-- m --> Para leer la ng necesitas Expert Guide for Windows (WEG). Probado en Win7. <!-- m --><a class="postlink" href="http://www.davep.org/norton-guides/">http://www.davep.org/norton-guides/</a><!-- m --> Saludos
Buscar texto en un fichero
Ok Ruben, muchas gracias. Lo voy a probar a ver que tal. Porque Funcky 6 tiene buena pinta, pero es muy hermetico y oscuro, he instalado la demo pero no se ni donde estan las librerías, ni si funcionaria, ni nada (tampoco he tenido mucho tiempo).
Buscar texto en un fichero
[quote="antolin":2n7mf1dl]...he instalado la demo pero no se ni donde estan las librerías...[/quote:2n7mf1dl] Como te comente es tecnología COM (Common Object Model). Lo que hace es registrar una DLLs que coloca en el directorio [b:2n7mf1dl]c:\windows\system32[/b:2n7mf1dl] y son: [b:2n7mf1dl]FUNCky16.DLL[/b:2n7mf1dl], [b:2n7mf1dl]FUNCky60.DEP[/b:2n7mf1dl], [b:2n7mf1dl]FUNCky60.DLL[/b:2n7mf1dl] y [b:2n7mf1dl]FUNCky60.TLB[/b:2n7mf1dl]
Buscar texto en un fichero
Es cierto JmGarcia, aunque no son exactamente los mismos porque es una demo a 90 dias para xbase (lo unico que he encontrado). Lo que me falta ahora son los ficheros de cabecera (.ch), no los encuentro por ningún lado y eso que en e fichero de ayudas esepcifica que .ch hay que utilizar para cada objeto, pero no dice donde están.
Buscar texto en un fichero
Perdona JmGarcia, leyendo la documetnacion me he dado cuenta que parece ser que me he bajado funcky para delphy. Seguiré buscanso a ver si lo encuntro para clipper/xharbour. Gracias de todas formas.
Buscar texto en un fichero
[quote="antolin":2l3cwv8i]...Lo que me falta ahora son los ficheros de cabecera (.ch),...[/quote:2l3cwv8i] No hacen falta los ficheros de cabecera si usas COM. [color=#0040FF:2l3cwv8i]function main()[/color:2l3cwv8i] [color=#FF0000:2l3cwv8i][b:2l3cwv8i]oFuncky:=CreateObject("FUNCky")[/b:2l3cwv8i] // Aqui esta el truco[/color:2l3cwv8i] [color=#0040FF:2l3cwv8i]msginfo(oFuncky:ChrCount("t","Esto es un test")) // Visualiza un 3 (el número "t") msginfo(oFuncky:ChrCount("A", "1234567")) // Visualiza 0 (no hay ninguna "A") return nil[/color:2l3cwv8i]
Buscar texto en un fichero
Ok JmGarcia, ya entiendo. Más fácil de lo que parecía. Muchas gracias
Buscar texto en un fichero
[quote="Daniel Garcia-Gil":29kjrzuf]Saludos Puedes mirar la clase TFile de fivewin[/quote:29kjrzuf] Antolin disculpa la pregunta, pero encontraste algun problema con la sugerencia que te expuse....??? aqui hay un ejemplo simple del funcionamiento de la clase... el 1ero botton crea un archivo de texto bastante grande y el 2do hace una busqueda [url=http&#58;//www&#46;sitasoft&#46;net/fivewin/samples/testseek&#46;zip:29kjrzuf]descarga el exe desde aqui[/url:29kjrzuf] [code=fw:29kjrzuf]<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: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> nWords := <span style="color: #000000;">0</span><br />   <span style="color: #00C800;">local</span> oBar<br /><br /><br />   <span style="color: #0000ff;">define</span> <span style="color: #0000ff;">window</span> oWnd<br />   <span style="color: #0000ff;">define</span> <span style="color: #0000ff;">buttonbar</span> oBar <span style="color: #0000ff;">of</span> oWnd<br /><br />   <span style="color: #0000ff;">define</span> <span style="color: #0000ff;">button</span> <span style="color: #0000ff;">of</span> oBar <span style="color: #0000ff;">action</span> MsgRun<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Please Wait..."</span>, <span style="color: #ff0000;">"Wait while fill file"</span>, <span style="color: #000000;">&#123;</span>|| FillFileTxt<span style="color: #000000;">&#40;</span> oWnd <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">define</span> <span style="color: #0000ff;">button</span> <span style="color: #0000ff;">of</span> oBar <span style="color: #0000ff;">action</span> FindText<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <br />      <br />   <span style="color: #0000ff;">activate</span> <span style="color: #0000ff;">window</span> oWnd<br />   <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;">Function</span> FillFileTxt<span style="color: #000000;">&#40;</span> oWnd <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> cStr<br />   <span style="color: #00C800;">local</span> oFile  := TTxtFile<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Create</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"testing.txt"</span> <span style="color: #000000;">&#41;</span><br />   <br />   <span style="color: #00C800;">for</span> n = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">500000</span><br />      cStr = StrZero<span style="color: #000000;">&#40;</span> n, <span style="color: #000000;">7</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" "</span> + Time<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" Testing TTxtFile Class "</span> +  StrZero<span style="color: #000000;">&#40;</span> n, <span style="color: #000000;">7</span> <span style="color: #000000;">&#41;</span><br />      oFile:<span style="color: #000000;">Add</span><span style="color: #000000;">&#40;</span> cStr <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">next</span><br />   oFile:<span style="color: #000000;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</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;">Function</span> FindText<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> oFile  := TTxtFile<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"testing.txt"</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> nRec   := <span style="color: #000000;">0</span><br />   <span style="color: #00C800;">local</span> cRec<br />   <br />   <span style="color: #00C800;">if</span> MsgGet<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Number to seek"</span>, <span style="color: #ff0000;">"Number:"</span>,  @nRec  <span style="color: #000000;">&#41;</span><br />      cRec = StrZero<span style="color: #000000;">&#40;</span> nRec, <span style="color: #000000;">7</span> <span style="color: #000000;">&#41;</span><br />      oFile:<span style="color: #000000;">Seek</span><span style="color: #000000;">&#40;</span> cRec <span style="color: #000000;">&#41;</span><br />      ? oFile:<span style="color: #000000;">ReadLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endif</span><br />   <br /> <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><br /> </div>[/code:29kjrzuf]
Buscar texto en un fichero
Daniel, la verdad es que no he tenido mucho tiempo para trabajar. He probado el EXE y va muy bien, la verdad. He aprovechado para echarle un vistaso a esa clase y a la clase ttxfile, pues en mi FW la clase tFile no tiene método ::ReadLine() y me parece muy, muy intersante. De hecho creo que voy a pasar de Funcky y quedarme con lo que tenemos. Gracias
Buscar texto en un fichero
Antolin la clase TTxtFile es una extencion mejorada de TFile
Buscar texto en un fichero
do you make an email exstractor from ......web pages ? this is no legal...!
Buscar texto en un fichero
[quote="Silvio":1teiakk2]do you make an email exstractor from ......web pages ? this is no legal...![/quote:1teiakk2] ???
Buscar un Valor en un Rango de Celda en EXCEL
amigos nuevamente por aca, solicito su ayuda. como puedo pasar esto a fw Public rango As String, valorbuscado As String Sub Encontrarvalores() Dim resultado As Range Dim primerabusqueda As String Dim contador As Double Set resultado = Range(rango).Find(valorbuscado, , xlValues, xlWhole, xlByColumns, xlNext, False, , False) If resultado Is Nothing Then MsgBox "No se encontraron coincidencias." Else primerabusqueda = resultado.Address Do contador = contador + 1 resultado.Interior.ColorIndex = 10 resultado.Font.ColorIndex = 2 Set resultado = Range(rango).FindNext(resultado) Loop While Not resultado Is Nothing And resultado.Address <> primerabusqueda If contador = 1 Then MsgBox "Se encontró " & contador & " coincidencia." Else MsgBox "Se encontró " & contador & " coincidencias." End If End If End Sub Quiero buscar un valor en una planilla excel. Saludos
Buscar un Valor en un Rango de Celda en EXCEL
Te doy algunas notas y creo que usando un for anidado puedes recorrer cada celda y verificar el valor que buscas, saludos... <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: --> [code=fw:2oe2rkbs]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp;oExcel := TOleAuto<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Excel.Application"</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// ACTIVANDO EXCEL</span><br />&nbsp; &nbsp;oExcel:<span style="color: #000000;">Workbooks</span>:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> cFileXls <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// ABRO EL ARCHIVO SELECCIONADO</span><br /><span style="color: #B900B9;">//</span><br />&nbsp; &nbsp;oBook := oExcel:<span style="color: #0000ff;">Get</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ActiveSheet"</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// ACTIVO HOJA EXCEL</span><br />&nbsp; &nbsp;nRows := oBook:<span style="color: #000000;">UsedRange</span>:<span style="color: #000000;">Rows</span>:<span style="color: #0000ff;">Count</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// CANTIDAD LINEAS EXCEL INCLUYENDO LA LINEA 1 QUE ES LA CABECERA</span><br />&nbsp; &nbsp;nCols := oBook:<span style="color: #000000;">UsedRange</span>:<span style="color: #000000;">Columns</span>:<span style="color: #0000ff;">Count</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// CANTIDAD COLUMNAS EXCEL</span><br />&nbsp;</div>[/code:2oe2rkbs] Valor de la celda [code=fw:2oe2rkbs]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oBook:<span style="color: #000000;">Cells</span><span style="color: #000000;">&#40;</span> nRow, nCol <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span><br />&nbsp;</div>[/code:2oe2rkbs] Usando IF [code=fw:2oe2rkbs]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> LEN<span style="color: #000000;">&#40;</span> oBook:<span style="color: #000000;">Cells</span><span style="color: #000000;">&#40;</span> nRow, <span style="color: #000000;">13</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span> <= <span style="color: #000000;">50</span> <span style="color: #B900B9;">// DESDE 1-50</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cSql += <span style="color: #ff0000;">"rep_observa1="</span> + ClipValue2SQL<span style="color: #000000;">&#40;</span> SUBST<span style="color: #000000;">&#40;</span> oBook:<span style="color: #000000;">Cells</span><span style="color: #000000;">&#40;</span> nRow, <span style="color: #000000;">13</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> ,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">1</span>, Len<span style="color: #000000;">&#40;</span> oBook:<span style="color: #000000;">Cells</span><span style="color: #000000;">&#40;</span> nRow, <span style="color: #000000;">13</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">", "</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cSql += <span style="color: #ff0000;">"rep_observa1="</span> + ClipValue2SQL<span style="color: #000000;">&#40;</span> SUBST<span style="color: #000000;">&#40;</span> oBook:<span style="color: #000000;">Cells</span><span style="color: #000000;">&#40;</span> nRow, <span style="color: #000000;">13</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">50</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">", "</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br />&nbsp;</div>[/code:2oe2rkbs] Espero te ayude o de idea de como hacerlo, a la orden por cualquier ayuda.
Buscar un archivo en un disco y sus directorios
Saludos estimados No se si existe en FWH o en xHB alguna funcion que realice la busqueda de un archivo en una unidad y sus directorios y subdirectorios ?? si alguien tiene el dato o alguna funcion se lo agradecere ...
Buscar un archivo en un disco y sus directorios
Prueba con [quote:1gbj6jv8] Xbrowse( HB_DirScan( "C:\", "mifile.txt", "A" ) ) [/quote:1gbj6jv8]
Buscar un archivo en un disco y sus directorios
Saludos, GRACIAS efectivamente es los que necesito, pero hay un problema, es de Harbour y Yo uso xHarbour, estuve buscando la equivalencia en xHb pero no la encuentro, existira ?? Gracias nuevamente.
Buscar un archivo en un disco y sus directorios
No me habia dado cuenta del detalle de que sigues utilizando xHarbour Aqui tienes el source [code=fw:2j15coao]<div class="fw" id="{CB}" style="font-family: monospace;"><br />https:<span style="color: #B900B9;">//github.com/harbour/core/blob/master/src/rtl/dirscan.prg</span><br />&nbsp;</div>[/code:2j15coao]
Buscar un archivo en un disco y sus directorios
Very good: [url:3uqeo048]https&#58;//vivaclipper&#46;wordpress&#46;com/tag/directory/[/url:3uqeo048] Saludos.
Buscar un archivo en un disco y sus directorios
Excelente, más solo funciona con Harbour. [code=fw:bez6fxkr]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"directry.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fileio.ch"</span><br /><br />PROC TestDScan<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> aFFList := HB_DirScan<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"C:<span style="color: #000000;">\T</span>EMP"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> x1Row<br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">/*<br />&nbsp; &nbsp;FOR EACH x1Row IN aFFList<br /><br />&nbsp; &nbsp; &nbsp; ? PAD( x1Row[ 1 ], 23 ), ; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Name<br />&nbsp; &nbsp; &nbsp; &nbsp; TRAN( x1Row[ 2 ], '999,999,999,999' ), ; &nbsp; &nbsp; // Size<br />&nbsp; &nbsp; &nbsp; &nbsp; x1Row[ 3 ], ; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// Date<br />&nbsp; &nbsp; &nbsp; &nbsp; x1Row[ 4 ], ; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// Time<br />&nbsp; &nbsp; &nbsp; &nbsp; x1Row[ 5 ] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Attributes<br />&nbsp; &nbsp;NEXT x1Row<br />&nbsp; &nbsp;*/</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">Xbrowse</span><span style="color: #000000;">&#40;</span> HB_DirScan<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"C:<span style="color: #000000;">\T</span>EMP"</span>, <span style="color: #ff0000;">"TESTE"</span>, <span style="color: #ff0000;">"A"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span> <span style="color: #B900B9;">// TestDScan()</span><br /><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> hb_doScan<span style="color: #000000;">&#40;</span> cPath, cMask, cAttr, cPathSep <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> aFile<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> lMatch<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> aResult := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">FOR</span> EACH aFile IN hb_vfDirectory<span style="color: #000000;">&#40;</span> cPath + hb_osFileMask<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, cAttr + <span style="color: #ff0000;">"D"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; lMatch := hb_FileMatch<span style="color: #000000;">&#40;</span> aFile<span style="color: #000000;">&#91;</span> F_NAME <span style="color: #000000;">&#93;</span>, cMask <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> <span style="color: #ff0000;">"D"</span> $ aFile<span style="color: #000000;">&#91;</span> F_ATTR <span style="color: #000000;">&#93;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">IF</span> lMatch .AND. <span style="color: #ff0000;">"D"</span> $ cAttr<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AAdd<span style="color: #000000;">&#40;</span> aResult, aFile <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">IF</span> !<span style="color: #000000;">&#40;</span> aFile<span style="color: #000000;">&#91;</span> F_NAME <span style="color: #000000;">&#93;</span> == <span style="color: #ff0000;">"."</span> .OR. aFile<span style="color: #000000;">&#91;</span> F_NAME <span style="color: #000000;">&#93;</span> == <span style="color: #ff0000;">".."</span> .OR. aFile<span style="color: #000000;">&#91;</span> F_NAME <span style="color: #000000;">&#93;</span> == <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AEval<span style="color: #000000;">&#40;</span> hb_DoScan<span style="color: #000000;">&#40;</span> cPath + aFile<span style="color: #000000;">&#91;</span> F_NAME <span style="color: #000000;">&#93;</span> + cPathSep, cMask, cAttr, cPathSep <span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span>| x | x<span style="color: #000000;">&#91;</span> F_NAME <span style="color: #000000;">&#93;</span> := aFile<span style="color: #000000;">&#91;</span> F_NAME <span style="color: #000000;">&#93;</span> + cPathSep + x<span style="color: #000000;">&#91;</span> F_NAME <span style="color: #000000;">&#93;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AAdd<span style="color: #000000;">&#40;</span> aResult, x <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp; &nbsp; ELSEIF lMatch<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AAdd<span style="color: #000000;">&#40;</span> aResult, aFile <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">NEXT</span><br /><br /><span style="color: #00C800;">RETURN</span> aResult<br /><br /><span style="color: #00C800;">FUNCTION</span> hb_DirScan<span style="color: #000000;">&#40;</span> cPath, cFileMask, cAttr <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span> hb_DoScan<span style="color: #000000;">&#40;</span> hb_DirSepAdd<span style="color: #000000;">&#40;</span> hb_defaultValue<span style="color: #000000;">&#40;</span> cPath, <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, &nbsp; &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp;iif<span style="color: #000000;">&#40;</span> HB_ISSTRING<span style="color: #000000;">&#40;</span> cFileMask <span style="color: #000000;">&#41;</span>, cFileMask, hb_osFileMask<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp;hb_defaultValue<span style="color: #000000;">&#40;</span> cAttr, <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp;hb_ps<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">FUNCTION</span> hb_DirRemoveAll<span style="color: #000000;">&#40;</span> cDir <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> aFile, cPath, cFile, nAttr<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> ! Empty<span style="color: #000000;">&#40;</span> cDir <span style="color: #000000;">&#41;</span> .AND. hb_vfDirExists<span style="color: #000000;">&#40;</span> cDir <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; cPath := hb_DirSepDel<span style="color: #000000;">&#40;</span> cDir <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> hb_vfAttrGet<span style="color: #000000;">&#40;</span> cPath, @nAttr <span style="color: #000000;">&#41;</span> .AND. ! hb_bitAnd<span style="color: #000000;">&#40;</span> nAttr, HB_FA_READONLY <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hb_vfAttrSet<span style="color: #000000;">&#40;</span> cPath, hb_bitXor<span style="color: #000000;">&#40;</span> nAttr, HB_FA_READONLY <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp; &nbsp; cPath := hb_DirSepAdd<span style="color: #000000;">&#40;</span> cPath <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">FOR</span> EACH aFile IN hb_vfDirectory<span style="color: #000000;">&#40;</span> cPath + hb_osFileMask<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">"HSDL"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">IF</span> <span style="color: #ff0000;">"D"</span> $ aFile<span style="color: #000000;">&#91;</span> F_ATTR <span style="color: #000000;">&#93;</span> .AND. ! <span style="color: #ff0000;">"L"</span> $ aFile<span style="color: #000000;">&#91;</span> F_ATTR <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> !<span style="color: #000000;">&#40;</span> aFile<span style="color: #000000;">&#91;</span> F_NAME <span style="color: #000000;">&#93;</span> == <span style="color: #ff0000;">"."</span> .OR. aFile<span style="color: #000000;">&#91;</span> F_NAME <span style="color: #000000;">&#93;</span> == <span style="color: #ff0000;">".."</span> .OR. aFile<span style="color: #000000;">&#91;</span> F_NAME <span style="color: #000000;">&#93;</span> == <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">IF</span> ! hb_DirRemoveAll<span style="color: #000000;">&#40;</span> cPath + aFile<span style="color: #000000;">&#91;</span> F_NAME <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> .F.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cFile := cPath + aFile<span style="color: #000000;">&#91;</span> F_NAME <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> <span style="color: #ff0000;">"R"</span> $ aFile<span style="color: #000000;">&#91;</span> F_ATTR <span style="color: #000000;">&#93;</span> .AND. hb_vfAttrGet<span style="color: #000000;">&#40;</span> cFile, @nAttr <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hb_vfAttrSet<span style="color: #000000;">&#40;</span> cFile, hb_bitAnd<span style="color: #000000;">&#40;</span> nAttr, hb_bitNot<span style="color: #000000;">&#40;</span> HB_FA_READONLY <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> ! hb_vfErase<span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">RETURN</span> .F.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">NEXT</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> hb_vfDirRemove<span style="color: #000000;">&#40;</span> cDir <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">RETURN</span> .T.<br /><br /><span style="color: #00C800;">FUNCTION</span> hb_FileDelete<span style="color: #000000;">&#40;</span> cFileMask, cAttr <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> lAny := .F., aFile, cPath, cFile, cAttrMask, nAttr<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> HB_ISSTRING<span style="color: #000000;">&#40;</span> cFileMask <span style="color: #000000;">&#41;</span> .AND. ! Empty<span style="color: #000000;">&#40;</span> cFileMask <span style="color: #000000;">&#41;</span> .AND. ;<br />&nbsp; &nbsp; &nbsp; ! hb_vfDirExists<span style="color: #000000;">&#40;</span> cFileMask <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; cPath := hb_FNameDir<span style="color: #000000;">&#40;</span> cFileMask <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; cAttrMask := StrTran<span style="color: #000000;">&#40;</span> hb_defaultValue<span style="color: #000000;">&#40;</span> cAttr, <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">"D"</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"L"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">FOR</span> EACH aFile IN hb_vfDirectory<span style="color: #000000;">&#40;</span> cFileMask, cAttrMask <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cFile := cPath + aFile<span style="color: #000000;">&#91;</span> F_NAME <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">IF</span> <span style="color: #ff0000;">"R"</span> $ aFile<span style="color: #000000;">&#91;</span> F_ATTR <span style="color: #000000;">&#93;</span> .AND. hb_vfAttrGet<span style="color: #000000;">&#40;</span> cFile, @nAttr <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hb_vfAttrSet<span style="color: #000000;">&#40;</span> cFile, hb_bitAnd<span style="color: #000000;">&#40;</span> nAttr, hb_bitNot<span style="color: #000000;">&#40;</span> HB_FA_READONLY <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</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> hb_vfErase<span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lAny := .T.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">NEXT</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">RETURN</span> lAny<br />&nbsp;</div>[/code:bez6fxkr] Saludos.
Buscar un archivo en un disco y sus directorios
Saludos y gracias Es correcto solo funciona en HB para xHB he tenido que usar : DirectoryRecurse() , pues trate de compilar el source pero daba muchos errores.
Buscar un registro con ADORDD
Buenos dias Estoy con un tema que me tiene frito, no soy capaz de encontrar un dato mediante ADORDD en una tabla, siempre me da algun tipo de error, o simplemente no lo busca. Tengo el siguiente codigo completo: [code=fw:zjdrxczk]<div class="fw" id="{CB}" style="font-family: monospace;">** ************************************<br />** ------------------------------------<br />** RUTINAS PARA&nbsp;LA GESTION DE Avisos<br />** ------------------------------------<br />** ************************************<br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"adordd.ch"</span> <br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Report.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"dtpicker.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"ord.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"calendar.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">'hbcompat.ch'</span><br /><span style="color: #00C800;">STATIC</span> oReport<br /><span style="color: #B900B9;">//-----------------------------------------</span><br />memvar Publicas<br />memvar ccomentario<br />memvar cincidencia<br />memvar cruta<br />memvar ccodpro<br />memvar cpro1<br />memvar cdomi1<br />memvar ctel1<br /><span style="color: #00C800;">FUNCTION</span> Paginaweb<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> cTitulo<br />cTitulo:=<span style="color: #ff0000;">"Trato&nbsp;de albaranes en&nbsp;pagina web"</span><br />Publicas:<span style="color: #000000;">cserver1</span>:=<span style="color: #ff0000;">"Localhost"</span><br />Publicas:<span style="color: #000000;">cUser1</span> :=<span style="color: #ff0000;">"root"</span><br />Publicas:<span style="color: #000000;">cPassword1</span><span style="color: #ff0000;">""</span><br />Publicas:<span style="color: #000000;">cPuerto</span>:=<span style="color: #ff0000;">"3306"</span><br />Publicas:<span style="color: #000000;">cBase</span>:=<span style="color: #ff0000;">"Base"</span><br />Publicas:<span style="color: #000000;">cTabla</span>:=<span style="color: #ff0000;">"podwin"</span><br /><br /><span style="color: #B900B9;">//-------------------</span><br />&nbsp; &nbsp;trataweb<span style="color: #000000;">&#40;</span>cTitulo<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><span style="color: #B900B9;">//-------------------</span><br /><br /><span style="color: #B900B9;">///////////// AVISOS EN&nbsp;INTERNET</span><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span>&nbsp;trataweb<span style="color: #000000;">&#40;</span>ctitulo<span style="color: #000000;">&#41;</span> <br /><span style="color: #00C800;">local</span> oDlg, oLbx,oBrw<br /><span style="color: #00C800;">LOCAL</span> oServer<br /><span style="color: #00C800;">LOCAL</span> oRs<br /><span style="color: #00C800;">local</span> hdc :=CreateDc<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"DISPLAY"</span>,<span style="color: #ff0000;">""</span>,<span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> nHor:=GetDeviceCaps<span style="color: #000000;">&#40;</span>hdc,<span style="color: #000000;">8</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> nVer:=GetDeviceCaps<span style="color: #000000;">&#40;</span>hdc,<span style="color: #000000;">10</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> x1:=<span style="color: #000000;">30</span><br /><span style="color: #00C800;">local</span> y1:=<span style="color: #000000;">30</span><br /><span style="color: #00C800;">local</span> x2:=nver<span style="color: #000000;">-160</span><br /><span style="color: #00C800;">local</span> y2:=nHor<span style="color: #000000;">-30</span><br /><span style="color: #00C800;">local</span> oBar<br /><span style="color: #00C800;">IF</span> <span style="color: #000000;">&#40;</span> oServer :=&nbsp;ConectaP<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> !=&nbsp;<span style="color: #00C800;">NIL</span> &nbsp; <br />&nbsp; oRS =&nbsp;PodSet<span style="color: #000000;">&#40;</span>&nbsp;oServer&nbsp;<span style="color: #000000;">&#41;</span><br />&nbsp;<span style="color: #0000ff;">DEFINE</span>&nbsp;<span style="color: #0000ff;">WINDOW</span> oDlg <span style="color: #0000ff;">MDICHILD</span> <span style="color: #0000ff;">ICON</span> Publicas:<span style="color: #000000;">oIco</span>;<br />&nbsp; &nbsp; <span style="color: #0000ff;">OF</span> Publicas:<span style="color: #000000;">oWPpal</span>;<br />&nbsp; &nbsp; <span style="color: #0000ff;">FROM</span> x1,y1;<br />&nbsp; &nbsp; <span style="color: #0000ff;">TO</span> x2,y2;<br />&nbsp; &nbsp; <span style="color: #0000ff;">COLOR</span> CLR_BLACK,CLR_WHITE;<br />&nbsp; &nbsp; <span style="color: #0000ff;">PIXEL</span><br /><br />&nbsp; oDlg:<span style="color: #000000;">cTitle</span>:=cTitulo<br />&nbsp; <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTONBAR</span> oBar&nbsp;TOP 3D <span style="color: #0000ff;">OF</span> oDlg<br />&nbsp; &nbsp; <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"CAMBIA"</span>&nbsp;<span style="color: #0000ff;">OF</span> oBar&nbsp;NOBORDER <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"Subir&nbsp;Imagenes"</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span>Subeimagen<span style="color: #000000;">&#40;</span>oServer,oRs,oBrw<span style="color: #000000;">&#41;</span>,oDlg:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TOOLTIP&nbsp;<span style="color: #ff0000;">"Subir Imagenes&nbsp;escaneadas"</span><br />&nbsp; &nbsp; <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"SALIR"</span>&nbsp; <span style="color: #0000ff;">OF</span> oBar&nbsp;NOBORDER <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"Salir"</span> &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> oDlg:<span style="color: #000000;">END</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TOOLTIP&nbsp;<span style="color: #ff0000;">"Salir"</span><br />&nbsp; @ <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">xbrowse</span> oBrw object oRS ;<br />&nbsp; &nbsp; COLUMNS <span style="color: #ff0000;">"no_pedido"</span>,<span style="color: #ff0000;">"no_manif"</span>,<span style="color: #ff0000;">"Fecha"</span> ,<span style="color: #ff0000;">"Fechapod"</span> &nbsp; ,<span style="color: #ff0000;">"horapod"</span>&nbsp;,<span style="color: #ff0000;">"webacces1"</span> ,<span style="color: #ff0000;">"Compania"</span>,<span style="color: #ff0000;">"Origen"</span>,<span style="color: #ff0000;">"Destino"</span>,<span style="color: #ff0000;">"Imagen"</span>,<span style="color: #ff0000;">"Importe"</span>,<span style="color: #ff0000;">"Segmer"</span>,<span style="color: #ff0000;">"Bultos"</span> ;<br />&nbsp; &nbsp; HEADERS <span style="color: #ff0000;">"Orden"</span>&nbsp; ,<span style="color: #ff0000;">"Albaran"</span> ,<span style="color: #ff0000;">"Fecha"</span> ,<span style="color: #ff0000;">"Fecha_ega"</span> &nbsp;,<span style="color: #ff0000;">"Hora_ega"</span> &nbsp;,<span style="color: #ff0000;">"Codigo"</span> &nbsp; &nbsp;,<span style="color: #ff0000;">"Nombre"</span> &nbsp;,<span style="color: #ff0000;">"Origen"</span>,<span style="color: #ff0000;">"Destino"</span>,<span style="color: #ff0000;">"Imagen"</span>,<span style="color: #ff0000;">"Importe"</span>,<span style="color: #ff0000;">"Refa"</span> &nbsp;,<span style="color: #ff0000;">"Bultos"</span> ; <br />&nbsp; &nbsp; COLSIZES <span style="color: #000000;">100</span>,<span style="color: #000000;">60</span>,<span style="color: #000000;">60</span>,<span style="color: #000000;">60</span>,<span style="color: #000000;">60</span>,<span style="color: #000000;">80</span>,<span style="color: #000000;">250</span>,<span style="color: #000000;">250</span>,<span style="color: #000000;">250</span>,<span style="color: #000000;">20</span>,<span style="color: #000000;">60</span>,<span style="color: #000000;">150</span>,<span style="color: #000000;">40</span> ; <br />&nbsp; &nbsp; <span style="color: #0000ff;">AUTOCOLS</span> LINES CELL<br />&nbsp; &nbsp; oBrw:<span style="color: #000000;">lColDividerComplete</span>:= .f.<br />&nbsp; &nbsp; oBrw:<span style="color: #000000;">nTop</span>&nbsp; &nbsp;&nbsp; &nbsp; := oDlg:<span style="color: #000000;">nTop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; oBrw:<span style="color: #000000;">lKineticBrw</span>&nbsp; &nbsp; := .f.<br />&nbsp; &nbsp; oBrw:<span style="color: #000000;">nMarqueeStyle</span>&nbsp; := MARQSTYLE_HIGHLROW <span style="color: #B900B9;">// Con cursor de todo el renglón</span><br />&nbsp; &nbsp; oBrw:<span style="color: #000000;">nBottom</span>&nbsp; &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">152</span><br />&nbsp; &nbsp; oBrw:<span style="color: #000000;">nRight</span>&nbsp;&nbsp; &nbsp; := oDlg:<span style="color: #000000;">nWidth</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; oBrw:<span style="color: #000000;">nStretchCol</span>&nbsp; &nbsp; := STRETCHCOL_LAST<br />&nbsp; &nbsp; oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; oDlg:<span style="color: #000000;">oClient</span> = oBrw<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oDlg&nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MAXIMIZED</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ON</span> RESIZE <span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">nWidth</span>:=oDlg:<span style="color: #000000;">nWidth</span><span style="color: #000000;">-10</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBrw:<span style="color: #000000;">nHeight</span>:=oDlg:<span style="color: #000000;">nHeight</span><span style="color: #000000;">-95</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,.t. <span style="color: #000000;">&#41;</span><br /><br />&nbsp;<span style="color: #00C800;">ENDIF</span><br /><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">////-------------DESCARGA DE INTERNET</span><br /><span style="color: #B900B9;">///////////////////////////////////</span><br /><span style="color: #00C800;">FUNCTION</span> PodSet<span style="color: #000000;">&#40;</span> oServer <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> oRS, oError, cQry,cCant<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">TRY</span> <br />&nbsp; &nbsp; &nbsp; oRS = CreateObject<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ADODB.RecordSet"</span> <span style="color: #000000;">&#41;</span>&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;CATCH oError<br />&nbsp; &nbsp; &nbsp; ?&nbsp;<span style="color: #ff0000;">"Ha fallado el inicio!!!"</span><br />&nbsp; &nbsp; &nbsp; ShowError<span style="color: #000000;">&#40;</span> oError&nbsp;<span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br />&nbsp; &nbsp;END&nbsp; &nbsp;<br /><br />&nbsp; &nbsp;cQry&nbsp;= <span style="color: #ff0000;">"SELECT NO_PEDIDO,NO_MANIF,FECHA,FECHAPOD,FIRMAPOD,HORAPOD,WEBACCES1,COMPANIA,ORIGEN,DESTINO,IMAGEN,IMPORTE,SEGMER,BULTOS FROM podwin ORDER BY no_pedido"</span><br />&nbsp; &nbsp;oRS:<span style="color: #000000;">cursorLocation</span> =&nbsp;adUseClient<br />&nbsp; &nbsp;oRS:<span style="color: #000000;">lockType</span>&nbsp; &nbsp; &nbsp; &nbsp;=&nbsp;adLockOptimistic<br />&nbsp; &nbsp;oRS:<span style="color: #000000;">cursorType</span> &nbsp; &nbsp; =&nbsp;adOpenDynamic<br />&nbsp; &nbsp;oRS:<span style="color: #000000;">source</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=&nbsp;cQry<br />&nbsp; &nbsp;oRS:<span style="color: #000000;">activeConnection</span>&nbsp;= &nbsp;oServer<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">TRY</span> <br />&nbsp; &nbsp; &nbsp; oRS:<span style="color: #000000;">open</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;CATCH oError<br />&nbsp; &nbsp; &nbsp; ?&nbsp;<span style="color: #ff0000;">"Ha fallado la orden de&nbsp;seleccion!!!"</span><br />&nbsp; &nbsp; &nbsp; ShowError<span style="color: #000000;">&#40;</span> oError&nbsp;<span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br />&nbsp; &nbsp;END&nbsp; &nbsp;<br /><br /><span style="color: #00C800;">return</span> oRS<br /><br /><span style="color: #B900B9;">//-----------------------------------------//</span><br /><br /><span style="color: #00C800;">FUNCTION</span> ConecTaP<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> oServer &nbsp; := <span style="color: #00C800;">NIL</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> cServer:=Publicas:<span style="color: #000000;">cserver1</span> &nbsp; <br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> cUser :=Publicas:<span style="color: #000000;">cUser1</span> &nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> cPassword :=Publicas:<span style="color: #000000;">cPassword1</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> nPort &nbsp; &nbsp; <br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> cDBName &nbsp; <br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> nFlags &nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> oErr<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> cConString<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> lRet &nbsp; &nbsp; &nbsp;:= .T.<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> cTable<br /><br />&nbsp; &nbsp;nPort &nbsp; &nbsp; := Publicas:<span style="color: #000000;">cPuerto</span><br />&nbsp; &nbsp;cDBName &nbsp; := Publicas:<span style="color: #000000;">cBase</span><br />&nbsp; &nbsp;cTable &nbsp; &nbsp;:= Publicas:<span style="color: #000000;">cTabla</span><br />&nbsp; &nbsp;nFlags &nbsp; &nbsp;:= <span style="color: #000000;">0</span><br />&nbsp; &nbsp;cConString := <span style="color: #ff0000;">"Driver={MySQL ODBC 5.1 Driver}"</span> &nbsp; &nbsp;+ ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">";Server="</span> + cServer &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;+ ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">";DefaultDatabase="</span> + cDBName &nbsp; &nbsp; &nbsp; + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">";Database="</span> + cDBName &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;+ ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">";Port="</span> + nPort &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;+ ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">";User="</span> + cUser &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;+ ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">";Password="</span> + cPassword &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;+ ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">";Option=3;"</span> &nbsp; <br />&nbsp; &nbsp;<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">TRY</span><br />&nbsp; &nbsp; &nbsp;oServer := CreateObject<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ADODB.Connection"</span> <span style="color: #000000;">&#41;</span> &nbsp; &nbsp; <br />&nbsp; &nbsp;CATCH oErr<br />&nbsp; &nbsp; &nbsp; ? <span style="color: #ff0000;">"Ha fallado el inicio del Servidor!!!"</span><br />&nbsp; &nbsp; &nbsp; ShowError<span style="color: #000000;">&#40;</span> oErr <span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br />&nbsp; &nbsp;END &nbsp; <br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oServer:<span style="color: #000000;">ConnecTionString</span> := cConString<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">TRY</span><br />&nbsp; &nbsp; &nbsp;oServer:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;CATCH oErr<br />&nbsp; &nbsp; &nbsp;? <span style="color: #ff0000;">"Ha fallado la conexion con el servidor!!!"</span><br />&nbsp; &nbsp; &nbsp;ShowError<span style="color: #000000;">&#40;</span> oErr <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;END &nbsp; <br />&nbsp; &nbsp;<br /><span style="color: #00C800;">RETURN</span> oServer<br /><br /><span style="color: #B900B9;">//-----------------------------------------</span><br /><span style="color: #00C800;">Static</span> <span style="color: #00C800;">function</span>&nbsp;subeimagen<span style="color: #000000;">&#40;</span>oServer,oRs,oBrw<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> oDlg,i,osay,oini,ofin,oboton,oboton1<br /><span style="color: #00C800;">local</span> continua:=.F.<br /><span style="color: #00C800;">local</span> aAlias<br /><span style="color: #00C800;">local</span> cIni:= Date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> cFin:= Date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">local</span> norden,cAwb,cFile<br />aAlias:= cargaAlias<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />dbUseArea<span style="color: #000000;">&#40;</span>.T.,,Publicas:<span style="color: #000000;">cUnidad</span>+Publicas:<span style="color: #000000;">cSubd</span>+<span style="color: #ff0000;">"<span style="color: #000000;">\A</span>LBARAN"</span>,aAlias<span style="color: #000000;">&#91;</span><span style="color: #000000;">24</span><span style="color: #000000;">&#93;</span>,.T.<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #000000;">&#40;</span>aAlias<span style="color: #000000;">&#91;</span><span style="color: #000000;">24</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>OrdSetFocus<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Fecha"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #000000;">&#40;</span>aAlias<span style="color: #000000;">&#91;</span><span style="color: #000000;">24</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> dbGotop<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span>&nbsp;oDlg <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"DESDE"</span> <span style="color: #0000ff;">BRUSH</span> Publicas:<span style="color: #000000;">oBrush1</span> TRANSPARENT <span style="color: #0000ff;">Font</span> Publicas:<span style="color: #000000;">oWPpal</span>:<span style="color: #000000;">ofont</span><br />&nbsp; &nbsp; <span style="color: #00C800;">for</span> i&nbsp; &nbsp;= <span style="color: #000000;">10</span> <span style="color: #0000ff;">to</span>&nbsp;<span style="color: #000000;">11</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">SAY</span> osay <span style="color: #0000ff;">ID</span> i <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">COLOR</span> CLR_GREEN<br />&nbsp; &nbsp; <span style="color: #00C800;">next</span> i<br />&nbsp; &nbsp; <span style="color: #0000ff;">REDEFINE</span> Dtpicker oini <span style="color: #0000ff;">VAR</span> cIni <span style="color: #0000ff;">ID</span> <span style="color: #000000;">101</span> <span style="color: #0000ff;">OF</span> oDlg <br />&nbsp; &nbsp; <span style="color: #0000ff;">REDEFINE</span> Dtpicker ofin <span style="color: #0000ff;">VAR</span> cFin <span style="color: #0000ff;">ID</span> <span style="color: #000000;">102</span> <span style="color: #0000ff;">OF</span> oDlg <br />&nbsp; &nbsp; <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> oboton <span style="color: #0000ff;">ID</span> <span style="color: #000000;">550</span>&nbsp; &nbsp;<span style="color: #0000ff;">OF</span> oDlg&nbsp;<span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Aceptar"</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span>Continua := .T., oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> oboton1 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">551</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PROMPT</span>&nbsp; &nbsp;<span style="color: #ff0000;">"Cancelar"</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span>oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> CANCEL<br />&nbsp; <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br />&nbsp; <span style="color: #00C800;">if</span> Continua<br />&nbsp; &nbsp; <span style="color: #000000;">&#40;</span>aAlias<span style="color: #000000;">&#91;</span><span style="color: #000000;">24</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>Ordscope<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span>,cIni<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #000000;">&#40;</span>aAlias<span style="color: #000000;">&#91;</span><span style="color: #000000;">24</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>Ordscope<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span>,cFin<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #000000;">&#40;</span>aAlias<span style="color: #000000;">&#91;</span><span style="color: #000000;">24</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>Dbgotop<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> !<span style="color: #000000;">&#40;</span>aAlias<span style="color: #000000;">&#91;</span><span style="color: #000000;">24</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>Eof<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; norden:=alltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>aAlias<span style="color: #000000;">&#91;</span><span style="color: #000000;">24</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>->Orden,<span style="color: #000000;">7</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; cAwb:=PADL<span style="color: #000000;">&#40;</span>norden,<span style="color: #000000;">7</span>,<span style="color: #ff0000;">"0"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; cFile:=Publicas:<span style="color: #000000;">cDocs</span>+cAwb+<span style="color: #ff0000;">".JPG"</span><br />&nbsp; &nbsp; <span style="color: #00C800;">IF</span> FILE<span style="color: #000000;">&#40;</span>cFile<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; oRs:<span style="color: #000000;">Seek</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"no_pedido="</span>+norden<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; oRs:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Imagen"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> := <span style="color: #000000;">1</span><br />&nbsp; &nbsp; <span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp; &nbsp; &nbsp; oRs:<span style="color: #000000;">Seek</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"no_pedido="</span>+norden<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; oRs:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Imagen"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> := <span style="color: #000000;">0</span><br />&nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp; <span style="color: #000000;">&#40;</span>aAlias<span style="color: #000000;">&#91;</span><span style="color: #000000;">24</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>-><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 />&nbsp; &nbsp; <span style="color: #00C800;">enddo</span><br />&nbsp; &nbsp; <span style="color: #000000;">&#40;</span>aAlias<span style="color: #000000;">&#91;</span><span style="color: #000000;">24</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>Ordscope<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span>,<span style="color: #00C800;">Nil</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #000000;">&#40;</span>aAlias<span style="color: #000000;">&#91;</span><span style="color: #000000;">24</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>Ordscope<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span>,<span style="color: #00C800;">Nil</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; <span style="color: #000000;">&#40;</span>aAlias<span style="color: #000000;">&#91;</span><span style="color: #000000;">24</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>Dbclosearea<span style="color: #000000;">&#40;</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 />&nbsp;</div>[/code:zjdrxczk] Este proyecto lo estoy compilando en xharbour y creo que con la versión de Abril de 2011 de FWH, aunque tengo las posteriores, pero tengo tantas rutinas y librerías de terceros que no me merece la pena actualizar el proyecto. A ver si algun alma caritativa me da la luz. Un saludo
Buscar un registro con ADORDD
Solamente añadir que todos los comandos como Movefirst, MoveLast, etc, funcionan perfectamente, sólamente el comando Seek, Find, Locate, que la verdad es que no sé si lo estoy haciendo del modo correcto.
Buscar un registro con ADORDD
Creo que necesitas añadir unas comillas simples, porque la variable norden es un String. [code=fw:i12crbj8]<div class="fw" id="{CB}" style="font-family: monospace;">      oRs:<span style="color: #000000;">Seek</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"no_pedido="</span>+<span style="color: #ff0000;">"'"</span> + norden + <span style="color: #ff0000;">"'"</span><span style="color: #000000;">&#41;</span></div>[/code:i12crbj8]
Buscar un registro con ADORDD
Buenas Gracias por contestar me da este error: ************************************************************ Application =========== Path and name: C:\five\fuentes\gespaq08\gespaqn.Exe (32 bits) Size: 1,456,128 bytes Time from start: 0 hours 0 mins 38 secs Error occurred at: 04/03/19, 14:06:53 Error description: Error ADODB.RecordSet/6 DISP_E_UNKNOWNNAME: SEEK Args: [ 1] = C no_pedido='1920645' ************************************************************** Y ese número no lo debe encontrar, ya que no está en la base de datos Mysql, pero no sé si el error es debido a que no lo encuentra, y entonces habría que hacer algo, o por el contrario es un error en la forma de construir el seek. Saludos
Buscar un registro con ADORDD
Yo no uso ADORDD. Para la búsqueda por una columna uso el método find de ADO.[code=fw:16z4wc4g]<div class="fw" id="{CB}" style="font-family: monospace;">   oRs:<span style="color: #000000;">Find</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"no_pedido="</span>+<span style="color: #ff0000;">"'"</span> + norden + <span style="color: #ff0000;">"'"</span><span style="color: #000000;">&#41;</span></div>[/code:16z4wc4g] Que se sitúa en la fila que cumpla la condición, si no se ha encontrado oRS:Eof es true. No sé si te servirá. Un saludo.
Buscar un registro con ADORDD
Hola, Ya se ve que por aquí sólo constestamos los que no usamos ADORDD. A ver. Yo no uso ADORDD, pero su uso es totalmente transparente. Esto debe funcionar tal cual: SELECT Articulos SEEK cCodigo Si no funciona es porque te falte poner algo al principio del programa. Creo que habia que poner la lista de indices que se iban a usar o algo asi. En el github del proyecto habia informacion al respecto Saludos
Buscar un registro con ADORDD
Buenas El caso es que como podeis ver en el código no es ADORDD, es ADO, lo que pasa es que estoy probando tanto con ADO como con ADORDD, y no ha manera de encontrar un dato, no soy capaz de construir un fuente que me busque. hago de todo, añadir, reemplazar, borrar, etc, todo menos buscar. Quiero buscar en una tabla mysql un dato (en este caso un número) que se encuentra en una DBF, y en función de si lo encuentra o nó, que cambie el valor de otro campo de la tabla mysql por 0 o por 1. Ya me estoy quemando <!-- s:evil: --><img src="{SMILIES_PATH}/icon_evil.gif" alt=":evil:" title="Evil or Very Mad" /><!-- s:evil: -->
Buscar un registro con ADORDD
Hola, si la búsqueda la haces por un campo numérico no necesitas las comillas simples. Prueba a hacer [code=fw:3mspfb6p]<div class="fw" id="{CB}" style="font-family: monospace;">oRs:<span style="color: #000000;">Find</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"no_pedido="</span>+norden<span style="color: #000000;">&#41;</span><br />? oRs:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"no_pedido"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>, oRs:<span style="color: #000000;">Eof</span></div>[/code:3mspfb6p] Si lo ha encontrado te mostrará en pantalla el valor norden y .f. para el Eof. En este caso mira a ver si te falta un oRs:Update() en [code=fw:3mspfb6p]<div class="fw" id="{CB}" style="font-family: monospace;">     oRs:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Imagen"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> := <span style="color: #000000;">1</span><br />    oRs:<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /> </div>[/code:3mspfb6p] Un saludo.
Buscar un registro con ADORDD
José Luis Intenta con [code=fw:bhawm89a]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oRs:<span style="color: #000000;">Find</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"no_pedido = "</span> + <span style="color: #ff0000;">"'"</span> + STR<span style="color: #000000;">&#40;</span>norden,<span style="color: #000000;">7</span>,<span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"'"</span> <span style="color: #000000;">&#41;</span><br /> </div>[/code:bhawm89a] Nota: el número 7 lo ajustas dependiendo del tipo de campo (TINY, INTEGER, SMALLINT, etc etc) y longitud que hayas definido al crear la tabla, y recuerda que MySQL prácticamente todo lo almacena como alfabético. Saludos
Buscar un registro con ADORDD
Buenas Mi preguta es, ¿podría ser que no encuentra el dato por los espacios? Es decir, el dato a buscar es "1234567", y en la tabla mysql los datos de esa columna son " 1234567". he hecho: [code=fw:2awcsql6]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp; &nbsp; &nbsp; oRs:<span style="color: #000000;">Find</span><span style="color: #000000;">&#40;</span>trim<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"no_pedido"</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" = "</span> + <span style="color: #ff0000;">"'"</span> + norden + <span style="color: #ff0000;">"'"</span> <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:2awcsql6] y fallo en algo. Luego para ver resultados con msginfo hago [code=fw:2awcsql6]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp; <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span>oRs:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"no_pedido"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">trim</span><span style="color: #000000;">&#40;</span>value<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:2awcsql6] y me da error al compilar Como podría poner trim, primero para que quite los espacios en la busqueda del dato en la tabla, y luego en Fields para ver si realmente quita los espacios.
Buscar un registro con ADORDD
José Luis: Con el ejemplo que te puse, cual fue el resultado? Asumo que no_pedido es un campo numérico. Saludos
Buscar un registro con ADORDD
Buenas Ya está resuelto. A veces te obcecas en algo y no ves que es mas simple, efectivamente era un campo alfanumérico, y los espacios en blanco impedían que lo encontrara. La solución, simple ha sido al construir el qry poner: cQry= "SELECT TRIM(NO_PEDIDO) AS NO_PEDIDO....... Muchas gracias por todo
Buscar un registro con ADORDD
Buenas Como te hago referencia anteriormente, lo he probado, y como te digo, el campo es alfanumérico, y para que coincidan tengo que quitar los espacios. Si pongo oRs:Find("no_pedido"..... etc, no lo encuentra, ya que no_pedido es " 1234537", y norden es "1234567", entonces no se donde poner el trim en el Find como te comento anteriormente, a fin de que busque en la columna no_pedido, pero que quite los espacios. oRs:Find(Trim("no_pedido")...... no funciona
Buscar un registro con ADORDD
José luis: El tipo de campo es importante, si es alfanumérico definitivamente es por los espacios, primero se los quitas y despues haces la busqueda, así. [code=fw:3m8q852m]<div class="fw" id="{CB}" style="font-family: monospace;"><br />norden := ALLTRIM<span style="color: #000000;">&#40;</span>norden<span style="color: #000000;">&#41;</span>     <span style="color: #B900B9;">// Primero le quitas los espacios</span><br /><br />oRs:<span style="color: #000000;">Find</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"no_pedido = "</span> + <span style="color: #ff0000;">"'"</span> + norden + <span style="color: #ff0000;">"'"</span> <span style="color: #000000;">&#41;</span><br /> </div>[/code:3m8q852m] Prueba y avisas. Saludos
Buscar un registro con ADORDD
Buenas Gracias por contestar Como te digo anteriormente, los espacios los tengo quitados en norden, el problema es que no se como quitarlos en "no_pedido", ya que es un campo de una tabla.
Buscar un registro con ADORDD
José Luis: Ahh, entiendo. Solo una idea, en lugar de tratar de quitar los espacios a no_pedido agrégalos a npedido con PADL(), así igualas los valores. Aunque en mi personal opinión, cuando los valores son alfanuméricos el control EDIT lo debes poner con ajuste a la izquierda. Saludos
Buscar un texto a bajo nivel
Saludos, Uso la función MemoRead para buscar palabras en ficheros .txt Cuando el fichero .txt se guarda en formato ANSI, las palabras se encuentran, pero si se guarda en formato UNICODE, entonces, la función no me encuentra la palabra, incluso aunque typee el fichero y yo pueda verla. Os agradecería cualquier sugerencia para resolver este problema. Saludos Javier. <!-- s:? --><img src="{SMILIES_PATH}/icon_confused.gif" alt=":?" title="Confused" /><!-- s:? -->
Buscar un texto a bajo nivel
Busca en este foro por UTF-8 o UNITO8, Kevin, etc... hay un post sobre como trabajar con UNICODE, y tiene funciones de búsqueda, etc...
Buscar y Extraer Informacion Archivo TXT
Amigo aca nuevamente, resulta que quiero buscar cierta informacion en un archivo plano y luego mostrarla,, Por Ejemplo: ARCHIVO error_032015.txt que contiene esto: Folio: 13 Tipo DTE: 33 Operación: COMPRA Fecha/Hora Proceso: 2015-03-09T16:08:14 Archivo: compra.txt Error: El Documento tipo (33) folio (13) la fecha de emision no puede superar el periodo actual Folio: 10 Tipo DTE: 33 Operación: COMPRA Fecha/Hora Proceso: 2015-03-09T16:09:25 Archivo: compra.txt Error: En los <TotalesCompra> el monto neto, no cuadra con el I.V.A. aplicado.- Folio: 9 Tipo DTE: 33 Operación: COMPRA Fecha/Hora Proceso: 2015-03-09T16:10:37 Archivo: compra.txt Error: Error message not available. QUIERO BUSCAR EL FOLIO 10 y TRAERME TODO LO QUE SE REFIERA A ESE CODIGO TODA SU INFORMACIO; Saludos
Buscar y Extraer Informacion Archivo TXT
jbrita quizas esto te ayude [code=fw:p3obbnf0]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp;cTexto:=MemoRead<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"error_032015.txt"</span><span style="color: #000000;">&#41;</span><br />&nbsp;cFolio:=Subs<span style="color: #000000;">&#40;</span>cTexto,<span style="color: #00C800;">AT</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Folio: 10"</span>,cTexto<span style="color: #000000;">&#41;</span>,<span style="color: #00C800;">AT</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Folio: 11"</span>,cTexto<span style="color: #000000;">&#41;</span><span style="color: #000000;">-1</span><span style="color: #000000;">&#41;</span><br />&nbsp;?cFolio<br />&nbsp;</div>[/code:p3obbnf0] Saludos, Adhemar
Buscar y Extraer Informacion Archivo TXT
[quote="jbrita":vretc0t2]Amigo aca nuevamente, resulta que quiero buscar cierta informacion en un archivo plano y luego mostrarla,, Por Ejemplo: ARCHIVO error_032015.txt que contiene esto: Folio: 13 Tipo DTE: 33 Operación: COMPRA Fecha/Hora Proceso: 2015-03-09T16:08:14 Archivo: compra.txt Error: El Documento tipo (33) folio (13) la fecha de emision no puede superar el periodo actual Folio: 10 Tipo DTE: 33 Operación: COMPRA Fecha/Hora Proceso: 2015-03-09T16:09:25 Archivo: compra.txt Error: En los <TotalesCompra> el monto neto, no cuadra con el I.V.A. aplicado.- Folio: 9 Tipo DTE: 33 Operación: COMPRA Fecha/Hora Proceso: 2015-03-09T16:10:37 Archivo: compra.txt Error: Error message not available. QUIERO BUSCAR EL FOLIO 10 y TRAERME TODO LO QUE SE REFIERA A ESE CODIGO TODA SU INFORMACIO; Saludos[/quote:vretc0t2] Puedes utilizar la clase TFILE(), cada cuota esta separada por lineas vacias, aqui podras saber cuando concluye cada FOLIO
Buscar y Seleccionar un archivo
Estimados como puedo hacer por medio de un rutina el usuario pueda buscar en las carpetas del disco y visualizar los archivos con una determinada extención y lo pueda seleccionar, osea que el nombre dicho archivo seleccionado me quede cargado en una variable... me explique ?? David argentina
Buscar y Seleccionar un archivo
David :Busca en \fwh\manual\fwfun.chm la sintaxis de esta función :[code:3w0xg1nw]cGetFile32&#40; <cFileMask>, <cTitle>, &#91;<nDefaultMask>&#93;, &#91;<cInitialDirectory>&#93;, &#91;lSave&#93;, &#91;nFlags&#93;, &#91;cInitialFile&#93; &#41; --> cFileName [/code:3w0xg1nw]
Buscar y Seleccionar un archivo
Saludos David:La sintaxis para guardar archivos es la siguiente:[code:kg14nqbb] cFile&#58;= cGetFile&#40; "Documento de MS Word | *&#46;Doc", "Guardar Reporte", 1, "C&#58;\", &#46;T&#46;, &#46;T&#46;&#41; msginfo&#40;cFile&#41; [/code:kg14nqbb] y este es para abrir archivos de uno o varios tipos: [code:kg14nqbb] gcFile&#58;= cGetFile32&#40; "JPEG &#40;*&#46;jpg&#41;| *&#46;jpg|" +; "BITMAP &#40;*&#46;bmp&#41;| *&#46;bmp|"+; "GIF &#40;*&#46;gif&#41;| *&#46;gif|" +; "PCX &#40;*&#46;pcx&#41;| *&#46;pcx|" +; "Seleccione un archivo de Imagen",3&#41; msginfo&#40;gcFile&#41; [/code:kg14nqbb]Espero te sirva