topic
stringlengths
1
63
text
stringlengths
1
577k
COPY FILE issue
Is there a way to copy a file that has a comma "," in the file name. With COPY FILE &cSource TO &cDest I get a DOS Error 123. I cannot control the original filename so I have to somehow work with the "," in the filename. I will also need to be able to delete this file without generating an error.
COPY FILE issue
You might try COPY FILE (cSource) TO (cDest) or maybe filecopy( cSource, cDest )
COPY FILE issue
Hi Gale, Same error <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( -->
COPY FILE issue
I wonder if the error is in source or destination definition. Can you change the destination name to one without comma? COPY FILE (cSource) TO ('test.tst') If it can copy to normal filename without error then you might have a work around. Maybe filemove( cSource, 'test.tst' )
COPY FILE issue
Jeff, I don't have xharbour available to test with but the following code works in harbour. [code=fw:2erxnqn1]<div class="fw" id="{CB}" style="font-family: monospace;"><br />procedure main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cSource := <span style="color: #ff0000;">"te,st.prg"</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cTarget := cSource + <span style="color: #ff0000;">".bak"</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> FileCopy<span style="color: #000000;">&#40;</span> cSource, cTarget <span style="color: #000000;">&#41;</span> != <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; ? <span style="color: #ff0000;">"Copy okay"</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; ? <span style="color: #ff0000;">"Copy failed."</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">return</span><br />&nbsp;</div>[/code:2erxnqn1] Robb
COPY FILE issue
Thanks Robb ... unfortunately with xharbour I get "Copy Failed" <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( -->
COPY FILE issue
[code=fw:qk204fb0]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">static</span> cTarget := <span style="color: #ff0000;">"c:<span style="color: #000000;">\F</span>ive"</span><br /><br /><span style="color: #00C800;">function</span> CopyFiles<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;cTarget = AllTrim<span style="color: #000000;">&#40;</span> cTarget <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> ! File<span style="color: #000000;">&#40;</span> cTarget <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; lMkDir<span style="color: #000000;">&#40;</span> cTarget <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;LZCopyFile<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"d:<span style="color: #000000;">\F</span>ive<span style="color: #000000;">\F</span>ive.lib"</span>, cTarget + <span style="color: #ff0000;">"Five.lib"</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:qk204fb0] 
COPY FILE issue
Jeff I know with Sql you can put things in brackets .. perhaps Copy file ( "[Some,File]" ) to ( "[ Some,Where ]" ) .. untested .. just a shot in the dark. Rick Lipkin
COPY FILE issue
[quote="Jeff Barnes":3l8z6pg6]Is there a way to copy a file that has a comma "," in the file name. With COPY FILE &cSource TO &cDest I get a DOS Error 123. I cannot control the original filename so I have to somehow work with the "," in the filename. I will also need to be able to delete this file without generating an error.[/quote:3l8z6pg6] This FWH function works with both xHarbour and Harbour [code=fw:3l8z6pg6]<div class="fw" id="{CB}" style="font-family: monospace;">? CopyFile<span style="color: #000000;">&#40;</span> cSourceFile, cDestFile, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span></div>[/code:3l8z6pg6]
COPY FILE issue
Thanks everyone. I got it working <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
COPY SQLTABLE from 1 SERVER to ANOTHER
Hi, How can i copy one table from a database located on one server to another database located on an other server . Thanks for your help and samples , Philippe
COPY SQLTABLE from 1 SERVER to ANOTHER
Very easy if you use FWH built-in MySql library. [code=fw:gm0l8mma]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oServer1 := maria_Connect<span style="color: #000000;">&#40;</span> .... <span style="color: #000000;">&#41;</span><br />oServer2 := maria_Connect<span style="color: #000000;">&#40;</span>....<span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">// now copy from oServer1 to oServer2</span><br />oCn:<span style="color: #000000;">CopyTableToServer</span><span style="color: #000000;">&#40;</span> cTableName, oServer2 <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:gm0l8mma]
COPY SQLTABLE from 1 SERVER to ANOTHER
Thanks for this answer but i 'll a sample for Microsoft MS SQL Server . Thanks Philippe
COPY TO SDF
Desde hace años, tengo una aplicación de recibos (primero con Clipper y ahora Clipper+FW23, que prepara un fichero txt, según la norma CSB19, para su cobro a través de Bancos. Hasta ahora ningún problema, pero un cliente que lo utiliza, me dice que su banco ha detectado un error, porque en la última línea del fichero, aparece la señal del marcador de fin de fichero (1A hex). He observado que con Clipper no pasa, pero si con FW. El funcionamiento y el mandato que utilizo es el mismo que en Clipper: Tengo los datos en un fichero dbf y desde el realizo la copia a un fichero txt de la siguiente forma: COPY TO (nombre del fichero) SDF ¿Alguno sabe como puedo suprimir este marcador de fin de fichero? Un saludo Manuel
COPY TO SDF
Manuel, Prueba a quitarle el último byte de esta forma: cTemp = MemoRead( <nombre_fichero> ) MemoWrit( <nombre_fichero>, SubStr( cTemp, 1, Len( cTemp ) - 1 ) )
COPY TO SDF
Antonio, eres un monstruo. Ha funcionado perfectamente. Un saludo Manuel
COPY TO SDF
Hola Manuel, precisamente estoy haciendo una aplicación de recibos y el cliente me ha pedido poder generar un fichero para las domiciliaciones. Creo que se trata de la norma bancaria 19 ¿Podrías orientarme sobre la estructura del fichero o donde encontrar documentación? Un saludo, Manuel Aranda
COPY TO SDF
Manuel, De esta dirección, puedes bajarte el cuardeno CSB-19 <!-- m --><a class="postlink" href="http://comercios.lacaixa.es/Canales/Contenido/0,1059,1-26-486-1,00.html">http://comercios.lacaixa.es/Canales/Con ... -1,00.html</a><!-- m --> En el se detallan como tiene que ir el fichero. Léetelo y si quieres despues hablamos. Lo que necesites, nada mas tienes que pedirmelo. Un saludo desde Málaga Manuel [quote="Manuel Aranda":26zu95zk]Hola Manuel, precisamente estoy haciendo una aplicación de recibos y el cliente me ha pedido poder generar un fichero para las domiciliaciones. Creo que se trata de la norma bancaria 19 ¿Podrías orientarme sobre la estructura del fichero o donde encontrar documentación? Un saludo, Manuel Aranda[/quote:26zu95zk]
COPY TO SDF
Muchas gracias Manuel por tu información y disposición a ayudarme. Me lo bajo y ya hablaremos si es caso. Un saludo, Manuel Aranda
COPY TO oddness
The code snippet below gave me a surprising result. The 2nd file() returns .f.. This would only happen if 'set default' isn't respected. In Clipper, a similar code would've return .t.. Test environment: FWH10.5, xHarbour 1.2.1 r6714, BCC 5.82 Could anyone else confirm that they experience this too please? [code=fw:3a7vwbud]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span>                       <br />                                            <br /><span style="color: #00C800;">function</span> main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>                             <br />  <span style="color: #00C800;">local</span> cTmp := <span style="color: #ff0000;">"tmp123"</span>                    <br />                                            <br />  makedir<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">".<span style="color: #000000;">\d</span>ata"</span><span style="color: #000000;">&#41;</span>                         <br />  set <span style="color: #00C800;">default</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">&#40;</span><span style="color: #ff0000;">".<span style="color: #000000;">\d</span>ata"</span><span style="color: #000000;">&#41;</span>                   <br />                                            <br />  dbcreate<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"ta_poll"</span>,<span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"id"</span>, <span style="color: #ff0000;">"c"</span>, <span style="color: #000000;">3</span>, <span style="color: #000000;">0</span><span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />  ? file<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"ta_poll.dbf"</span><span style="color: #000000;">&#41;</span>                     <br />                                            <br />  use ta_poll                               <br />  copy <span style="color: #0000ff;">to</span> <span style="color: #000000;">&#40;</span>cTmp<span style="color: #000000;">&#41;</span>                            <br />  ? file<span style="color: #000000;">&#40;</span>cTmp+<span style="color: #ff0000;">".dbf"</span><span style="color: #000000;">&#41;</span>                       <br />                                            <br />                                            <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span>                                  <br /> </div>[/code:3a7vwbud] TIA
COPY TO oddness
Oddly enough, when I compile the program as a xHarbour console program, I get the correct result. Only when I linked-in FWH10.5 will I get the error. Anyone has any suggestion? Just in case it helps, this is the batch file that I'm using. [code=fw:3h4g9rn9]<div class="fw" id="{CB}" style="font-family: monospace;"><br />@ECHO OFF<br />CLS<br />ECHO ??????????????????????????????????????????????????????????????????????????????<br />ECHO ? FiveWin <span style="color: #00C800;">for</span> xHarbour <span style="color: #000000;">10.5</span> - May. <span style="color: #000000;">2010</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xHarbour development <span style="color: #0000ff;">power</span> ??<br />ECHO ? <span style="color: #000000;">&#40;</span>c<span style="color: #000000;">&#41;</span> FiveTech, <span style="color: #000000;">1993</span><span style="color: #000000;">-2010</span> &nbsp; &nbsp; <span style="color: #00C800;">for</span> Microsoft Windows 9X/NT/200X/ME/XP/Vista/<span style="color: #000000;">7</span> ??<br />ECHO ???????????????????????????????????????????????????????????????????????????????<br />ECHO   ?????????????????????????????????????????????????????????????????????????????<br /><br /><span style="color: #00C800;">if</span> A%<span style="color: #000000;">1</span> == A GOTO :<span style="color: #000000;">SINTAX</span><br /><span style="color: #00C800;">if</span> NOT EXIST %<span style="color: #000000;">1</span>.prg GOTO :<span style="color: #000000;">NOEXIST</span><br /><br />ECHO Compiling...<br /><br /><span style="color: #00C800;">if</span> <span style="color: #ff0000;">"%FWDIR%"</span> == <span style="color: #ff0000;">""</span> set FWDIR=j:\harbour\fwh<br /><span style="color: #00C800;">if</span> <span style="color: #ff0000;">"%XHDIR%"</span> == <span style="color: #ff0000;">""</span> set XHDIR=j:\harbour\xhb<br />rem <span style="color: #00C800;">if</span> <span style="color: #ff0000;">"%2"</span> == <span style="color: #ff0000;">"/b"</span> set GT=gtwin<br />rem <span style="color: #00C800;">if</span> not <span style="color: #ff0000;">"%2"</span> == <span style="color: #ff0000;">"/b"</span> set GT=gtgui<br />set GT=gtgui<br /><br />set hdir=%XHDIR%<br />set hdirl=%hdir%\lib<br />set bcdir=j:\harbour\bcc55<br />set fwh=%FWDIR%<br /><br />%hdir%\bin\harbour %<span style="color: #000000;">1</span> /n /p /i%fwh%\include;%hdir%\include /w /p %<span style="color: #000000;">2</span> %<span style="color: #000000;">3</span> > comp.log<br /><span style="color: #00C800;">IF</span> ERRORLEVEL <span style="color: #000000;">1</span> GOTO COMPILEERRORS<br />@type comp.log<br /><br />echo -O2 -e%<span style="color: #000000;">1</span>.exe -I%hdir%\include -I%bcdir%\include %<span style="color: #000000;">1</span>.c > b32.bc<br />%bcdir%\bin\bcc32 -M -c -v @b32.bc<br />:<span style="color: #000000;">ENDCOMPILE</span><br /><br /><span style="color: #00C800;">IF</span> EXIST %<span style="color: #000000;">1</span>.rc %bcdir%\bin\brc32 -r %<span style="color: #000000;">1</span><br /><br />echo %bcdir%\lib\c0w32.obj + > b32.bc<br />echo %<span style="color: #000000;">1</span>.obj, + >> b32.bc<br />echo %<span style="color: #000000;">1</span>.exe, + >> b32.bc<br />echo %<span style="color: #000000;">1</span>.map, + >> b32.bc<br />echo %fwh%\lib\Fivehx.lib %fwh%\lib\FiveHC.lib + >> b32.bc<br />echo %hdirl%\rtl.lib + >> b32.bc<br />echo %hdirl%\vm.lib + >> b32.bc<br />echo %hdirl%\%GT%.lib + >> b32.bc<br />echo %hdirl%\lang.lib + >> b32.bc<br />echo %hdirl%\macro.lib + >> b32.bc<br />echo %hdirl%\rdd.lib + >> b32.bc<br />echo %hdirl%\dbfntx.lib + >> b32.bc<br />echo %hdirl%\dbfcdx.lib + >> b32.bc<br />echo %hdirl%\dbffpt.lib + >> b32.bc<br />echo %hdirl%\hbsix.lib + >> b32.bc<br />echo %hdirl%\debug.lib + >> b32.bc<br />echo %hdirl%\common.lib + >> b32.bc<br />echo %hdirl%\pp.lib + >> b32.bc<br />echo %hdirl%\pcrepos.lib + >> b32.bc<br />echo %hdirl%\ct.lib + >> b32.bc<br /><br />rem Uncomment these two lines <span style="color: #0000ff;">to</span> use Advantage RDD<br />rem echo %hdir%\lib\rddads.lib + >> b32.bc<br />rem echo %hdir%\lib\Ace32.lib + >> b32.bc<br /><br />echo %bcdir%\lib\cw32.lib + >> b32.bc<br />echo %bcdir%\lib\import32.lib + >> b32.bc<br />echo %bcdir%\lib\uuid.lib + >> b32.bc<br />echo %bcdir%\lib\psdk\odbc32.lib + >> b32.bc<br />echo %bcdir%\lib\psdk\rasapi32.lib + >> b32.bc<br />echo %bcdir%\lib\psdk\nddeapi.lib + >> b32.bc<br />echo %bcdir%\lib\psdk\msimg32.lib + >> b32.bc<br />echo %bcdir%\lib\psdk\iphlpapi.lib, >> b32.bc<br /><br /><span style="color: #00C800;">IF</span> EXIST %<span style="color: #000000;">1</span>.res echo %<span style="color: #000000;">1</span>.res >> b32.bc<br /><br />rem uncomment this line <span style="color: #0000ff;">to</span> use the debugger and comment the following one<br /><span style="color: #00C800;">if</span> %GT% == gtwin %bcdir%\bin\ilink32 -Gn -Tpe -s -v @b32.bc<br /><span style="color: #00C800;">IF</span> ERRORLEVEL <span style="color: #000000;">1</span> GOTO LINKERROR<br /><span style="color: #00C800;">if</span> %GT% == gtgui %bcdir%\bin\ilink32 -Gn -aa -Tpe -s -v @b32.bc<br /><span style="color: #00C800;">IF</span> ERRORLEVEL <span style="color: #000000;">1</span> GOTO LINKERROR<br />ECHO * Application successfully built *<br />%<span style="color: #000000;">1</span><br />GOTO EXIT<br />ECHO<br /><br />rem delete temporary files<br />@del %<span style="color: #000000;">1</span>.c<br /><br />:<span style="color: #000000;">COMPILEERRORS</span><br />@type comp.log<br />ECHO * Compile errors *<br />GOTO EXIT<br /><br />:<span style="color: #000000;">LINKERROR</span><br />ECHO * Linking errors *<br />GOTO EXIT<br /><br />:<span style="color: #000000;">SINTAX</span><br />ECHO &nbsp; &nbsp;SYNTAX: <span style="color: #000000;">Build</span> <span style="color: #000000;">&#91;</span>Program<span style="color: #000000;">&#93;</span> &nbsp; &nbsp; <span style="color: #000000;">&#123;</span>-- No especifiques la extensión PRG<br />ECHO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span>-- Don<span style="color: #ff0000;">'t specify .PRG extension<br />GOTO EXIT<br /><br />:NOEXIST<br />ECHO The specified PRG %1 does not exist<br /><br />:EXIT<br /></span></div>[/code:3h4g9rn9]
COPY TO oddness
Just to rule out a possibility, I checked the ppo between console and windows program. Seems COPY TO are pre-processed to the same syntax. Running out of idea here
COPY TO oddness
As a last resort, I downloaded an older binary from <!-- m --><a class="postlink" href="http://downloads.sourceforge.net/xharbour/xharbour-1.20.01.bin.w32.bcc32.5.82.zip">http://downloads.sourceforge.net/xharbo ... 2.5.82.zip</a><!-- m --> and that seem to solve the problem. Not ideal, but being the only programmer here I'm always in a rush <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
COPY TO oddness
Hello [b:1ffylx8r]xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6714) Copyright 1999-2010, <!-- m --><a class="postlink" href="http://www.xharbour.org">http://www.xharbour.org</a><!-- m --> <!-- m --><a class="postlink" href="http://www.harbour-project.org/">http://www.harbour-project.org/</a><!-- m -->[/b:1ffylx8r] [code=fw:1ffylx8r]<div class="fw" id="{CB}" style="font-family: monospace;"><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> cTmp := <span style="color: #ff0000;">"tmp123"</span><br /><br />  makedir<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">".<span style="color: #000000;">\d</span>ata"</span><span style="color: #000000;">&#41;</span><br />  set <span style="color: #00C800;">default</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">&#40;</span><span style="color: #ff0000;">".<span style="color: #000000;">\d</span>ata"</span><span style="color: #000000;">&#41;</span><br /><br />  dbcreate<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"ta_poll"</span>,<span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"id"</span>, <span style="color: #ff0000;">"c"</span>, <span style="color: #000000;">3</span>, <span style="color: #000000;">0</span><span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span>, <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #000000;">&#41;</span><br />  ? file<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"ta_poll.dbf"</span><span style="color: #000000;">&#41;</span>  <span style="color: #B900B9;">// RETURN ( .T. )</span><br /><br />  use ta_poll VIA <span style="color: #ff0000;">"DBFCDX"</span><br />  copy <span style="color: #0000ff;">to</span> <span style="color: #000000;">&#40;</span>cTmp<span style="color: #000000;">&#41;</span><br />  ? file<span style="color: #000000;">&#40;</span>cTmp+<span style="color: #ff0000;">".dbf"</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//RETURN( .F. )</span><br /><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:1ffylx8r]
COPY TO oddness
Yes, that's the bug that I encountered. The 2nd file() is returning .f., not the expected .t.. Thank you for the test Patricio. At least I now know it's not something that happens just to me.
COPY TO oddness
I have also experienced COPY TO failing unexpectedly I concluded it was a xhb compiler bug and worked around it Using xHb build 1.21 intl simplex rev 6406
COPY TO oddness
Hi Peter, I initially thought it was a bug in xHarbour but when I created a console program to make my case I get the correct result. When I linked it with FWH, I get the wrong result. Since COPY TO is pre-processed into __dbCopy() I tried grepping for that in FWH's source but none was found. To further confuse the matter, when I stepped down from rev 6714 to rev 6406 the bug seems to go away. I guess the only way to diffuse this ticking time bomb is to write a workaround for COPY TO. Someone mentioned even COPY FILE is showing similar bug in [url=http&#58;//groups&#46;google&#46;com/group/comp&#46;lang&#46;xharbour/browse_thread/thread/c208efbbdceb9d62#:20u2jkqi]this thread[/url:20u2jkqi]
COPY TO oddness
The problem is in xHarbour and it's there with or without FWH. I'm going to look at it. EMG
COPY TO oddness
Thanks Enrico! <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> Finding the source of this bug and fixing it is beyond my capability
COPY TO oddness
Any update on this Enrico?
COPY TO oddness
Unfortunately not. Fixing that bug would create another serious path incompatibility that I'm not able to solve. We have to wait for anybody else to fix it, sorry. EMG
COPY TO oddness
Thank you for the update Enrico <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
COPY TO oddness
Does this issue still exist in latest xHarbour? TIA
COPY TO oddness
Try with this: In your code use: [b:30sdv7cj]copy to (cTmp+".dbf")[/b:30sdv7cj] instead of: copy to (cTmp)
COPY TO oddness
[quote="hua":152c9j6p]Does this issue still exist in latest xHarbour? TIA[/quote:152c9j6p] Yes. <!-- s:-( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":-(" title="Sad" /><!-- s:-( --> EMG
COPY TO oddness
@Verhoven - thanks for the reply but I'm not looking for a workaround. I was hoping that the bug is squashed so I don't have to alway remember not to upgrade my xHarbour @Enrico - thanks for the feedback. That's unfortunate to hear <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( -->
COPY TO oddness
I think that the solution i wrote is not workaround. Why?: This code is inexact and inconsistent: copy to (cTmp) ? file(cTmp+".dbf") Because in the firt line you refer a file only using the variable cTmp and in the second line you add the extension ".dbf". Did you try with "? file(cTmp)". And because in its first line, working under windows or DOS, you can generate a file called cTmp+".dbf" or even cTmp+".DBF" because the reference to both names is the same but not in UNIX. In UNIX is not the same a file called cTmp+".dbf" than a file with name cTmp+".DBF" So it is much more accurate to say the exact name of the file you want to generate and not to leave to the compiler the interpretation of the name you want. This behavior you call a "bug" force you to be more accurate. Clipper was designed for DOS and xHarbour was for UNIX, DOS and windows this is the reason why i think it can not be that all the instructions must work excatly in clipper than in xHarbour bacause they can not be the same for all the O.S.
COPY TO oddness
[quote="Verhoven":1vs2hfdm]Try with this: In your code use: [b:1vs2hfdm]copy to (cTmp+".dbf")[/b:1vs2hfdm] instead of: copy to (cTmp)[/quote:1vs2hfdm] Just tried: no change. EMG
COPY TO oddness
[quote="Verhoven":3tufmhez]I think that the solution i wrote is not workaround. Why?: This code is inexact and inconsistent: copy to (cTmp) ? file(cTmp+".dbf") Because in the firt line you refer a file only using the variable cTmp and in the second line you add the extension ".dbf". Did you try with "? file(cTmp)".[/quote:3tufmhez] Why would I need to when Clipper documentation for COPY TO clearly states "[i:3tufmhez][b:3tufmhez]TO <xcFile>[/b:3tufmhez] specifies the name of the target file. The filename can be specified either as a literal filename or as a character expression enclosed in parentheses. If SDF or DELIMITED is specified, (.txt) is the default extension. Otherwise, (.dbf) is the default extension."[/i:3tufmhez]? [quote:3tufmhez] And because in its first line, working under windows or DOS, you can generate a file called cTmp+".dbf" or even cTmp+".DBF" because the reference to both names is the same but not in UNIX. In UNIX is not the same a file called cTmp+".dbf" than a file with name cTmp+".DBF" So it is much more accurate to say the exact name of the file you want to generate and not to leave to the compiler the interpretation of the name you want. This behavior you call a "bug" force you to be more accurate.[/quote:3tufmhez] Yes I'm aware that linux uses a case-sensitive filesystem but that is irrelevant to me because I don't program on linux. You are aware that the bug that I was pointing out is with regard to COPY TO not following path in SET DEFAULT not something to do with filename? Someone on xHarbour's NG pointed out another command that doesn't respect the path in SET DEFAULT can't remember what though
COPY falla en XP cuando son muchos
Esto me ha sucedido desde siempre.En un directorio tengo en existencia cerca de 4 mil archivos Tif por dia, estas imagenes las muevo a otra carpeta cuando ya no se necesitan.Resulta que de cada 400 imagenes que yo intento copiar y luego borrar... 2 ó 3 ni se copian, ni se borran.Actualmente lo tengo asiCOPY FILE ( cImgTif ) TO ( cImgDestino )¿A alguien le sucede algo parecido?¿Hay otra manera para mover un archivo y luego eliminarlo?GraciasFernando LealMéxico, DF
COPY falla en XP cuando son muchos
Hola, haces asi, que funcionara.[code:20attgk6] COPYFILE&#40; "C&#58;\PIZZAS\CLIENTES&#46;DBF", "C&#58;\PIZZAS\COPIA\CLIENTES&#46;DBF", &#46;F&#46; &#41; [/code:20attgk6]
COPY falla en XP cuando son muchos
Tambien halle este post de JamesCopyFile( cSource, cTarget ) DLL32 FUNCTION CopyFile( cExFile AS LPSTR, cNewFile AS LPSTR, lFailIfEx AS LONG ); AS BOOL PASCAL FROM "CopyFileA" LIB "Kernel32.dll" Gracias,voy a probar.
CORRIENDO 2 EXE A LA VEZ
compañeros: necesito desde mi EXe llamar a otro EXE mediante Winexec, pero antes de llamarlo [b:1i0ekdkq]quiero saber si ya está corriendo[/b:1i0ekdkq]. ¿como lo puedo saber? Intenté con la función GetTasks(), haciendo esto: funct llamarfun if AScan( GetTasks(), 'post-it.exe') == 0 winexec('.\post-it\post-it.exe') else msginfo('Ya está corriendo') endif return ... pero no resultó... siempre abre el EXE. Alguna sugerencia??? mil gracias. LORENZO
CORRIENDO 2 EXE A LA VEZ
[code:2rmm3qkk] IF IsExeRunning&#40;cFileName&#40;GetModuleFileName&#40;GetInstance&#40;&#41;&#41;&#41;&#41; msgalert&#40;"Program already running!"+CRLF+"This program cannot be started more than one instance!"&#41; QUIT ENDIF [/code:2rmm3qkk]
CORRUPCIÓN EN MEMO FILE
Alguien sabe como puedo solucionar una corrupción en un fichero memo. dbfcdx saludos
CORRUPCIÓN EN MEMO FILE
Que versión/build de Harbour/xHarbour usas ?
CORRUPCIÓN EN MEMO FILE
[quote="Antonio Linares":3q3c50vv]Que versión/build de Harbour/xHarbour usas ?[/quote:3q3c50vv] Hola antonio uso fw25, pero el problema no es del compilador, necesito saber si conoceis de algún programa que me regenere los indices del fpt. gracias.
COlor en las columnas con twbrowse
No puedo darle colores distintos a las columnas, utilizo el twbrowse,, alguna sugerencia??Salu2
COlor en las columnas con twbrowse
Solucionado.,. sorry..oLbxR:bTextColor := { |nRow,nCol|ColorRegComVen(nCol))}Function ColorRegComVen(nCol)DO CASE CASE nCol = 1 .OR. nCol = 4 .OR. nCol = 9 // fecha y ruc Return CLR_GREEN CASE nCol = 2 // valores Return CLR_HBLUE CASE nCol = 3 // valores Return CLR_BLUE CASE nCol = 5 .OR. nCol = 6 .OR. nCol = 7 .OR. nCol = 8 // valores Return CLR_HBLUEENDCASEReturn CLR_BLACK
COnversion de cadena a numero
Buenas, tengo un campo cadena de un fichero dbf funcionando en entorno Windows donde los usuarios graban una tasa (numerico con 2 decimales) de la siguiente forma: 3.22 2.10 ... Utilizando la funcion: val( campo ) me devuelve un valor numerico con 2 decimales. Pero, desde FWPPC me devuelve 0 y creo que es por el . decimal que no lo admite ¿Es asi? o ¿simplemte tengo que seleccionar el lenguaje español en el programa ? La funcion MsgYsNo me sale en Ingles ¿Que estoy haciendo mal? Gracias y espero ayuda Juan José.
COnversion de cadena a numero
Juan José, Este código funciona correctamente en FWPPC: MsgInfo( Val( "3.22" ) ) > La funcion MsgYsNo me sale en Ingles ¿Que estoy haciendo mal? MsgYesNo() admite dos parámetros: MsgYesNo( "¿ Desea finalizar ?", "Seleccione" )
COnversion de cadena a numero
Antonio, MsgYesno, se como funciona, pero el caso es que el dialogo me aparece en ingles y creo que todo mi problema está en que no se como decirle a la aplicacion que funciones en castellano. Juanjosé
COnversion de cadena a numero
Juan José, El diálogo te saldrá en inglés si usas un Pocket PC con idioma inglés, ya que MsgYesNo() usa una función propia del API de Windows. Configura el idioma de tu Pocket PC. Otra opción es crear tu mismo un diálogo semejante al de MsgYesNo().
COnversion de cadena a numero
Tengo lo siguiente en el programa: SET DELETED ON SET DATE TO ITALIAN SET SOFTSEEK ON SET CENTURY ON SET EPOCH TO 2000 SET SOFTSEEK ON HB_LANGSELECT( "ESWIN" ) HB_SetCodePage("ESWIN") // Para ordenación (arrays, cadenas, etc..) HB_LangSelect('ES') REQUEST HB_LANG_ES // Para establecer español para Mensajes, fechas, etc.. REQUEST HB_CODEPAGE_ESWIN // Para establecer código de página a Español (Ordenación, etc..) REQUEST DBFCDX RddSetDefault("DBFCDX") Con esto, supongo que ya tengo el idioma en castellano(Lo he visto en algún ejemplo). Pues en el emulador y en la PDA me aparece el dichoso MsgYesNo en ingles, y en ambos la configuracion regional está en Español - Alfabetizacion Internacional. No se donde puede estar el problema. Un saludo Juan José
CP 852
Hi to all <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> I want to use CP 852 in my FW/Harbour program. I use: HB_CdpSelect ("HR852") but not all characters are displayed correctly. Regards, NB
CP 852
<!-- m --><a class="postlink" href="http://harbourlanguage.blogspot.com/2010/06/harbour-codepage.html">http://harbourlanguage.blogspot.com/201 ... epage.html</a><!-- m -->
CP 852
Thanks Antonio, I know this text, but it doesn't help me. I will try to explain the problem. In plain Harbour, this program use CP 852 codepage: [code=fw:3ag4zur9]<div class="fw" id="{CB}" style="font-family: monospace;">REQUEST HB_CODEPAGE_HR852<br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cName := Chr<span style="color: #000000;">&#40;</span><span style="color: #000000;">143</span><span style="color: #000000;">&#41;</span> + Chr<span style="color: #000000;">&#40;</span><span style="color: #000000;">134</span><span style="color: #000000;">&#41;</span> + Chr<span style="color: #000000;">&#40;</span><span style="color: #000000;">172</span><span style="color: #000000;">&#41;</span> + Chr<span style="color: #000000;">&#40;</span><span style="color: #000000;">159</span><span style="color: #000000;">&#41;</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Chr<span style="color: #000000;">&#40;</span><span style="color: #000000;">166</span><span style="color: #000000;">&#41;</span> + Chr<span style="color: #000000;">&#40;</span><span style="color: #000000;">167</span><span style="color: #000000;">&#41;</span> + Chr<span style="color: #000000;">&#40;</span><span style="color: #000000;">230</span><span style="color: #000000;">&#41;</span> + Chr<span style="color: #000000;">&#40;</span><span style="color: #000000;">231</span><span style="color: #000000;">&#41;</span> + Chr<span style="color: #000000;">&#40;</span><span style="color: #000000;">209</span><span style="color: #000000;">&#41;</span> + Chr<span style="color: #000000;">&#40;</span><span style="color: #000000;">208</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; HB_CdpSelect <span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"HR852"</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; ? cName<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:3ag4zur9] This program writes: [b:3ag4zur9]????ŽžŠš??[/b:3ag4zur9] as I expected. But, this is not working in FiveWin version. Can anyone help me to make a similar FiveWin program that uses CP 852? I apologize if I asked a stupid question, searched the manual and the forum and did not find a solution to this problem. Regards, Nenad
CP 852
[code=fw:3htevqcm]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br />REQUEST HB_CODEPAGE_HR852<br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cName := Chr<span style="color: #000000;">&#40;</span><span style="color: #000000;">143</span><span style="color: #000000;">&#41;</span> + Chr<span style="color: #000000;">&#40;</span><span style="color: #000000;">134</span><span style="color: #000000;">&#41;</span> + Chr<span style="color: #000000;">&#40;</span><span style="color: #000000;">172</span><span style="color: #000000;">&#41;</span> + Chr<span style="color: #000000;">&#40;</span><span style="color: #000000;">159</span><span style="color: #000000;">&#41;</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Chr<span style="color: #000000;">&#40;</span><span style="color: #000000;">166</span><span style="color: #000000;">&#41;</span> + Chr<span style="color: #000000;">&#40;</span><span style="color: #000000;">167</span><span style="color: #000000;">&#41;</span> + Chr<span style="color: #000000;">&#40;</span><span style="color: #000000;">230</span><span style="color: #000000;">&#41;</span> + Chr<span style="color: #000000;">&#40;</span><span style="color: #000000;">231</span><span style="color: #000000;">&#41;</span> + Chr<span style="color: #000000;">&#40;</span><span style="color: #000000;">209</span><span style="color: #000000;">&#41;</span> + Chr<span style="color: #000000;">&#40;</span><span style="color: #000000;">208</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; HB_CdpSelect <span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"HR852"</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; ? hb_strtoutf8<span style="color: #000000;">&#40;</span> cName <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:3htevqcm]
CP 852
Thank you, although I wrote too simple example <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->) How do I create GET of such variables? Regards, NB
CPU al 100%
Antonio, a que puede ser debido que cuando consulto el rendimiento tanto los programas compilados con harbour y fwh25 y los antiguos hechos con versiones mas antiguas de fw20 y clipper me de que el uso de la CPU este al 100% y no baja, osea se mantiene durante todo el uso del programa. No es que funcionen mal puesto que los programas responden rapidamente y funcionan a las mil maravillas, pero parece que en algunos ordenadores los mas antiguos su rendimiento no parece ser optimo. Seguro que es algo que puedo estar haciendo mal, pero no se me ocurre por donde empezar para mirar el problema, si es que es un problema de los programas. Se presenta el problema tanto en win2000 como en xp. Saludos
CPU al 100%
Andrés, Con Clipper sería algo más normal, ya que se usa la capa de wow (windows on windows) para ejecutar 16 bits en 32 bits. Con Harbour no debería ocurrir. Usas algún bucle principal desde donde llames a SysRefresh() ?
CPU al 100%
Antonio me he dado cuenta que eso solo le pasa cuando gestiono la base de datos el tcbrowse lo paro con un: [code:vmh5ht62] ACTIVATE WINDOW oWndEdit MAXIMIZED ; ON RESIZE oSpl&#58;AdjRight&#40;&#41;; VALID &#40; lExit&#58;= &#46;T&#46; , &#46;T&#46; &#41; //? "si no sale otro mensaje me paro antes del syswait" DO WHILE !lExit //Esto para la pantalla para que no siga y cierre la base de datos SysWait&#40;&#46;1&#41; ENDDO //clos_base[/code:vmh5ht62] Puede ser esto lo que me produzca los problemas de consumo de cpu, mientras esta en modo presentacion con el menu y el bmp de inicio no hace ese fallo solo cuando ataco la base de datos
CPU al 100%
Andrés, La ventana oWndEdit es una ventana MDI child ?
CPU al 100%
Sí, depende de la principal. [code:1cwdifp3] DEFINE FONT oFont NAME "Ms Sans Serif" SIZE 0,-8 DEFINE WINDOW oWndEdit MDICHILD OF oWnd TITLE x_tit //Ventana child de la principal oWnd FROM 2, 2 TO 20, 50 DEFINE BUTTONBAR oBar SIZE 50,40 _3d OF oWndEdit [/code:1cwdifp3]
CPU al 100%
Andrés, Este código no es necesario en absoluto: [code:31sftcc8] DO WHILE ! lExit SysWait&#40;&#46;1&#41; ENDDO [/code:31sftcc8] una ventana MDI child es siempre no modal. Dices que se cierra la base de datos, y es normal, puesto que has de cerrar la base de datos cuando se cierre la ventana y no antes: ACTIVATE WINDOW oWndEdit VALID (DbCloseArea(), .t.)
CPU al 100%
Indudablemente este es el motivo, cuando quito el syswait el consumo del procesador oscila entre los 40% y el 85% pero no se posiciona como antes al 100%. El problema es que es heredado de la programcion del antiguo clipper y de esta manera me evitaba modelar mucho codigo. Voy a ver como lo soluciono. Gracias Antonio
CPU core
To all, How can we detect the number of cores and how to bind an Fivewin-exe to a certain core. Thanks in advance Otto
CPU core
Otto, Not sure if this may help: [url:2xvcsvxf]https&#58;//technet&#46;microsoft&#46;com/en-us/magazine/ee851672&#46;aspx[/url:2xvcsvxf]
CRAR ARCHIVO PLANO SIN USAR TDOSPRN
Estimados, alguno me podria indicar como crear un archivo de texto sin ocupar TDOSPRN Muchas gracias!
CRAR ARCHIVO PLANO SIN USAR TDOSPRN
yo lo hago así : function creatxt() local cFile := " c:\nombre.txt" local cText:= "" cText += " lo que quieras en la linea 1 " +CRLF cText += " lo que quieras en la linea 2 " +CRLF ........ memoWrite( MEMOWRIT( cFile, cText, .f. ) return nil
CRAR ARCHIVO PLANO SIN USAR TDOSPRN
Ozono: Otra opción es usar las funciones FCREATE() FWRITE() FCLOSE() Échales una mirada. Saludos
CRAR ARCHIVO PLANO SIN USAR TDOSPRN
Ozono: Encontré un ejemplo [code=fw:rdj0s11h]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp; nHandle := FCreate<span style="color: #000000;">&#40;</span>cFile,FC_NORMAL<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">IF</span> nHandle <= <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; MsgStop<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"No pude crear el archivo "</span> + cFile + <span style="color: #ff0000;">" !"</span>,oApp:<span style="color: #000000;">cAplicacion</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span>.T.<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br />....<br />....<br />.....<br />&nbsp; &nbsp; &nbsp; &nbsp; FWRITE<span style="color: #000000;">&#40;</span>nHandle,STRZERO<span style="color: #000000;">&#40;</span>nNum,<span style="color: #000000;">9</span>,<span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span> +;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SPACE<span style="color: #000000;">&#40;</span><span style="color: #000000;">16</span><span style="color: #000000;">&#41;</span> +;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"99"</span> +;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oRsEmp:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"EMP_CTA"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> + SPACE<span style="color: #000000;">&#40;</span><span style="color: #000000;">15</span> - LEN<span style="color: #000000;">&#40;</span>oRsEmp:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"EMP_CTA"</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> +;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SPACE<span style="color: #000000;">&#40;</span><span style="color: #000000;">05</span><span style="color: #000000;">&#41;</span> +;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; STRZERO<span style="color: #000000;">&#40;</span>INT<span style="color: #000000;">&#40;</span>nNeto<span style="color: #000000;">&#41;</span>,<span style="color: #000000;">13</span>,<span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span> +;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; STRZERO<span style="color: #000000;">&#40;</span>INT<span style="color: #000000;">&#40;</span>nDeci * <span style="color: #000000;">100</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">2</span>,<span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span> +;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cAyN + SPACE<span style="color: #000000;">&#40;</span><span style="color: #000000;">40</span> - LEN<span style="color: #000000;">&#40;</span>cAyN<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; <span style="color: #ff0000;">"001001"</span><span style="color: #000000;">&#41;</span><br />.....<br />.....<br />.....<br />&nbsp; &nbsp; FCLOSE<span style="color: #000000;">&#40;</span>nHandle<span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:rdj0s11h] Saludos
CRC of a file
How can I find out the CRC of a file without loading it into a variable ?
CRC of a file
Dear Yuri, You can use FWH function nFileCRC( cFileName [, lJumpFirst32bytesForDBFs] )
CRC of a file
Thank you, Antonio!
CRC8
Hola de nuevo En relación a la factura electrónica y su comunicación a las Haciendas vascas necesito generar un CRC8 para validar el código identificativo y el QR que debemos insertar en la factura. Todo lo que encuentro es para CRC16 ó CRC32 y no me sirve. La administración ha publicado un código de CRC8 en java y necesito ayuda para compilarlo y enlazarlo con mi aplicacion FWH + xHarbour pasandole el dato del código a validar y recuperando el valor que retorna. //--------------------------------------------------------------- package net.ticketbai; import java.io.UnsupportedEncodingException; public class CRC8{ private static final String UTF_8 = "UTF-8"; // CRC-8, // Poly = x^8 + x^2 + x^1 + x^0 // Init = 0 // RefIn = false // RefOut = false // XorOut = 0 private static final byte[] crc8_table= new byte[] { (byte) 0x00, (byte) 0x07, (byte) 0x0E, (byte) 0x09, (byte) 0x1C, (byte) 0x1B, (byte) 0x12, (byte) 0x15, (byte) 0x38, (byte) 0x3F, (byte) 0x36, (byte) 0x31, (byte) 0x24, (byte) 0x23, (byte) 0x2A, (byte) 0x2D, (byte) 0x70, (byte) 0x77, (byte) 0x7E, (byte) 0x79, (byte) 0x6C, (byte) 0x6B, (byte) 0x62, (byte) 0x65, (byte) 0x48, (byte) 0x4F, (byte) 0x46, (byte) 0x41, (byte) 0x54, (byte) 0x53, (byte) 0x5A, (byte) 0x5D, (byte) 0xE0, (byte) 0xE7, (byte) 0xEE, (byte) 0xE9, (byte) 0xFC, (byte) 0xFB, (byte) 0xF2, (byte) 0xF5, (byte) 0xD8, (byte) 0xDF, (byte) 0xD6, (byte) 0xD1, (byte) 0xC4, (byte) 0xC3, (byte) 0xCA, (byte) 0xCD, (byte) 0x90, (byte) 0x97, (byte) 0x9E, (byte) 0x99, (byte) 0x8C, (byte) 0x8B, (byte) 0x82, (byte) 0x85, (byte) 0xA8, (byte) 0xAF, (byte) 0xA6, (byte) 0xA1, (byte) 0xB4, (byte) 0xB3, (byte) 0xBA, (byte) 0xBD, (byte) 0xC7, (byte) 0xC0, (byte) 0xC9, (byte) 0xCE, (byte) 0xDB, (byte) 0xDC, (byte) 0xD5, (byte) 0xD2, (byte) 0xFF, (byte) 0xF8, (byte) 0xF1, (byte) 0xF6, (byte) 0xE3, (byte) 0xE4, (byte) 0xED, (byte) 0xEA, (byte) 0xB7, (byte) 0xB0, (byte) 0xB9, (byte) 0xBE, (byte) 0xAB, (byte) 0xAC, (byte) 0xA5, (byte) 0xA2, (byte) 0x8F, (byte) 0x88, (byte) 0x81, (byte) 0x86, (byte) 0x93, (byte) 0x94, (byte) 0x9D, (byte) 0x9A, (byte) 0x27, (byte) 0x20, (byte) 0x29, (byte) 0x2E, (byte) 0x3B, (byte) 0x3C, (byte) 0x35, (byte) 0x32, (byte) 0x1F, (byte) 0x18, (byte) 0x11, (byte) 0x16, (byte) 0x03, (byte) 0x04, (byte) 0x0D, (byte) 0x0A, (byte) 0x57, (byte) 0x50, (byte) 0x59, (byte) 0x5E, (byte) 0x4B, (byte) 0x4C, (byte) 0x45, (byte) 0x42, (byte) 0x6F, (byte) 0x68, (byte) 0x61, (byte) 0x66, (byte) 0x73, (byte) 0x74, (byte) 0x7D, (byte) 0x7A, (byte) 0x89, (byte) 0x8E, (byte) 0x87, (byte) 0x80, (byte) 0x95, (byte) 0x92, (byte) 0x9B, (byte) 0x9C, (byte) 0xB1, (byte) 0xB6, (byte) 0xBF, (byte) 0xB8, (byte) 0xAD, (byte) 0xAA, (byte) 0xA3, (byte) 0xA4, (byte) 0xF9, (byte) 0xFE, (byte) 0xF7, (byte) 0xF0, (byte) 0xE5, (byte) 0xE2, (byte) 0xEB, (byte) 0xEC, (byte) 0xC1, (byte) 0xC6, (byte) 0xCF, (byte) 0xC8, (byte) 0xDD, (byte) 0xDA, (byte) 0xD3, (byte) 0xD4, (byte) 0x69, (byte) 0x6E, (byte) 0x67, (byte) 0x60, (byte) 0x75, (byte) 0x72, (byte) 0x7B, (byte) 0x7C, (byte) 0x51, (byte) 0x56, (byte) 0x5F, (byte) 0x58, (byte) 0x4D, (byte) 0x4A, (byte) 0x43, (byte) 0x44, (byte) 0x19, (byte) 0x1E, (byte) 0x17, (byte) 0x10, (byte) 0x05, (byte) 0x02, (byte) 0x0B, (byte) 0x0C, (byte) 0x21, (byte) 0x26, (byte) 0x2F, (byte) 0x28, (byte) 0x3D, (byte) 0x3A, (byte) 0x33, (byte) 0x34, (byte) 0x4E, (byte) 0x49, (byte) 0x40, (byte) 0x47, (byte) 0x52, (byte) 0x55, (byte) 0x5C, (byte) 0x5B, (byte) 0x76, (byte) 0x71, (byte) 0x78, (byte) 0x7F, (byte) 0x6A, (byte) 0x6D, (byte) 0x64, (byte) 0x63, (byte) 0x3E, (byte) 0x39, (byte) 0x30, (byte) 0x37, (byte) 0x22, (byte) 0x25, (byte) 0x2C, (byte) 0x2B, (byte) 0x06, (byte) 0x01, (byte) 0x08, (byte) 0x0F, (byte) 0x1A, (byte) 0x1D, (byte) 0x14, (byte) 0x13, (byte) 0xAE, (byte) 0xA9, (byte) 0xA0, (byte) 0xA7, (byte) 0xB2, (byte) 0xB5, (byte) 0xBC, (byte) 0xBB, (byte) 0x96, (byte) 0x91, (byte) 0x98, (byte) 0x9F, (byte) 0x8A, (byte) 0x8D, (byte) 0x84, (byte) 0x83, (byte) 0xDE, (byte) 0xD9, (byte) 0xD0, (byte) 0xD7, (byte) 0xC2, (byte) 0xC5, (byte) 0xCC, (byte) 0xCB, (byte) 0xE6, (byte) 0xE1, (byte) 0xE8, (byte) 0xEF, (byte) 0xFA, (byte) 0xFD, (byte) 0xF4, (byte) 0xF3 }; /** * Calculate the CRC value with data from input string. * @param input input string * @returnThe calculated CRC value. Left padding with zeros. * @throws UnsupportedEncodingException */ public static String calculate(String input) throws UnsupportedEncodingException { byte[] data = input.getBytes(UTF_8); int len = data.length; byte crc = 0; for (int i = 0; i < len; i++) crc = crc8_table[(crc ^ data [i]) & 0xff]; return String.format("%03d", crc & 0xFFL); }} //--------------------------------------------------------------- Toda ayuda será bienveida. Gracias por su atencion Pedro
CRC8
[code=fw:2klokmb3]<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> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cStr, nCrc8<br /><br />&nbsp; &nbsp;cStr &nbsp;:= <span style="color: #ff0000;">"This is a sentence"</span><br />&nbsp; &nbsp;nCrc8 := FW_CRC8<span style="color: #000000;">&#40;</span> cStr <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;? cStr, nCrc8<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: #00D7D7;">#pragma</span> BEGINDUMP<br /><br /><span style="color: #00D7D7;">#include</span> <hbapi.h><br /><br /><span style="color: #00C800;">static</span> unsigned char crc8_table<span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> =<br /><span style="color: #000000;">&#123;</span><br />0x00, 0x07, 0x0E, 0x09, 0x1C, 0x1B, 0x12, 0x15,<br />0x38, 0x3F, 0x36, 0x31, 0x24, 0x23, 0x2A, 0x2D,<br />0x70, 0x77, 0x7E, 0x79, 0x6C, 0x6B, 0x62, 0x65,<br />0x48, 0x4F, 0x46, 0x41, 0x54, 0x53, 0x5A, 0x5D,<br />0xE0, 0xE7, 0xEE, 0xE9, 0xFC, 0xFB, 0xF2, 0xF5,<br />0xD8, 0xDF, 0xD6, 0xD1, 0xC4, 0xC3, 0xCA, 0xCD,<br />0x90, 0x97, 0x9E, 0x99, 0x8C, 0x8B, 0x82, 0x85,<br />0xA8, 0xAF, 0xA6, 0xA1, 0xB4, 0xB3, 0xBA, 0xBD,<br />0xC7, 0xC0, 0xC9, 0xCE, 0xDB, 0xDC, 0xD5, 0xD2,<br />0xFF, 0xF8, 0xF1, 0xF6, 0xE3, 0xE4, 0xED, 0xEA,<br />0xB7, 0xB0, 0xB9, 0xBE, 0xAB, 0xAC, 0xA5, 0xA2,<br />0x8F, 0x88, 0x81, 0x86, 0x93, 0x94, 0x9D, 0x9A,<br />0x27, 0x20, 0x29, 0x2E, 0x3B, 0x3C, 0x35, 0x32,<br />0x1F, 0x18, 0x11, 0x16, 0x03, 0x04, 0x0D, 0x0A,<br />0x57, 0x50, 0x59, 0x5E, 0x4B, 0x4C, 0x45, 0x42,<br />0x6F, 0x68, 0x61, 0x66, 0x73, 0x74, 0x7D, 0x7A,<br />0x89, 0x8E, 0x87, 0x80, 0x95, 0x92, 0x9B, 0x9C,<br />0xB1, 0xB6, 0xBF, 0xB8, 0xAD, 0xAA, 0xA3, 0xA4,<br />0xF9, 0xFE, 0xF7, 0xF0, 0xE5, 0xE2, 0xEB, 0xEC,<br />0xC1, 0xC6, 0xCF, 0xC8, 0xDD, 0xDA, 0xD3, 0xD4,<br />0x69, 0x6E, 0x67, 0x60, 0x75, 0x72, 0x7B, 0x7C,<br />0x51, 0x56, 0x5F, 0x58, 0x4D, 0x4A, 0x43, 0x44,<br />0x19, 0x1E, 0x17, 0x10, 0x05, 0x02, 0x0B, 0x0C,<br />0x21, 0x26, 0x2F, 0x28, 0x3D, 0x3A, 0x33, 0x34,<br />0x4E, 0x49, 0x40, 0x47, 0x52, 0x55, 0x5C, 0x5B,<br />0x76, 0x71, 0x78, 0x7F, 0x6A, 0x6D, 0x64, 0x63,<br />0x3E, 0x39, 0x30, 0x37, 0x22, 0x25, 0x2C, 0x2B,<br />0x06, 0x01, 0x08, 0x0F, 0x1A, 0x1D, 0x14, 0x13,<br />0xAE, 0xA9, 0xA0, 0xA7, 0xB2, 0xB5, 0xBC, 0xBB,<br />0x96, 0x91, 0x98, 0x9F, 0x8A, 0x8D, 0x84, 0x83,<br />0xDE, 0xD9, 0xD0, 0xD7, 0xC2, 0xC5, 0xCC, 0xCB,<br />0xE6, 0xE1, 0xE8, 0xEF, 0xFA, 0xFD, 0xF4, 0xF3 <span style="color: #000000;">&#125;</span>;<br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> FW_CRC8 <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp;unsigned char * <span style="color: #00C800;">data</span> = hb_parc<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp;int iLen = hb_parclen<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp;int i;<br />&nbsp; &nbsp;unsigned char crc = <span style="color: #ff0000;">'<span style="color: #000000;">\0</span>'</span>;<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> <span style="color: #000000;">&#40;</span> i = <span style="color: #000000;">0</span>; i < iLen; i++ <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; &nbsp; crc = crc8_table<span style="color: #000000;">&#91;</span> <span style="color: #000000;">&#40;</span>crc ^ <span style="color: #00C800;">data</span><span style="color: #000000;">&#91;</span> i <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> & 0xff <span style="color: #000000;">&#93;</span>;<br />&nbsp; &nbsp;<span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;hb_retni<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> int <span style="color: #000000;">&#41;</span> crc <span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00D7D7;">#pragma</span> ENDDUMP<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br />&nbsp;</div>[/code:2klokmb3]
CRC8
Thank you very much Mr. Rao, it works perfectly!!!
CREACDOR DE REPORTE FIVEWIN IMPRIMIR TAMAÑO DE HOJA LEGAL
Hola amigos, me gustaría saber como puedo imprimir en una hoja legal, un reporte de nómina de empleados, ya que la hoja 8 1/2 x 11 en horizonta no me cabe. Gracias, Juan Fco. Rep. Dom.
CREACDOR DE REPORTE FIVEWIN IMPRIMIR TAMAÑO DE HOJA LEGAL
Prueba con oPrn:SetPage( 5 ) // Legal 8 1/2 x 14 in Saludos
CREACDOR DE REPORTE FIVEWIN IMPRIMIR TAMAÑO DE HOJA LEGAL
No me funciono le puse OPRN:SETPAG(5) Y después use OREPORT:SETPAGE(5), esta última es la que usa el creador de reporte. Gracias, Juan Fco.
CREACDOR DE REPORTE FIVEWIN IMPRIMIR TAMAÑO DE HOJA LEGAL
Hola, con REPORT oReport, intenta asi: [code=fw:264pnenz]<div class="fw" id="{CB}" style="font-family: monospace;">     PrnSetSize<span style="color: #000000;">&#40;</span><span style="color: #000000;">2160</span>,<span style="color: #000000;">3560</span><span style="color: #000000;">&#41;</span>  <span style="color: #B900B9;">// Legal</span><br />     PrnLandScape<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>         <span style="color: #B900B9;">// Horizontal</span><br /> </div>[/code:264pnenz] Saludos.
CREACDOR DE REPORTE FIVEWIN IMPRIMIR TAMAÑO DE HOJA LEGAL
Hermano, muchas gracias, así llo resolvi. Bendiciones, Juan Fco. |Rep. Dom
CREAR ARCHIVO DE TEXTO
Amigos al hacer esto: oPrn:=TDosPrn():New( "ARCHIVO.TXT" ) oPrn:Say(1,1,"HOLA;QUE TAL" ) oPrn:End() el resultado es HOLA;QUE TAL y (al final me aparece un cuadradito)
CREAR ARCHIVO DE TEXTO
Jose, Edita el fichero de texto con un editor hexadecimal y comprueba que byte tiene al final
CREAR ARCHIVO DE TEXTO
Yo lo hago asi: [code=fw:2iqkf33y]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; cFileTxt := <span style="color: #ff0000;">"texto.txt"</span><br />&nbsp; <br />&nbsp; nHandle:= FCREATE<span style="color: #000000;">&#40;</span> cFileTxt <span style="color: #000000;">&#41;</span><br />&nbsp; FWRITE<span style="color: #000000;">&#40;</span>nHandle, <span style="color: #ff0000;">"HOLA;QUE TAL"</span><span style="color: #000000;">&#41;</span><br />&nbsp; FCLOSE<span style="color: #000000;">&#40;</span>nHandle<span style="color: #000000;">&#41;</span><br />&nbsp; WinExec<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"NotePad.exe "</span>+cFileTxt<span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:2iqkf33y]
CREAR CODIGO EN DLL PARA USAR CON VBA EXCEL
Estoy necesitando crar un archivo dll con codigo ejecutable, que luego pueda abrir en VBA de Excel, la idea es que esa dll me permita leer y grabar registros en un archivo DBFNTX (para que actualice los indices, ppalmente). Esto es Posible ?, y si lo es, como armo la dll ?
CREAR SELECT CON DATOS DE OTRO SELECT O SELECT ANIDADOS
Saludos, estoy usando MYSQL y la clase TDolphin y se me presenta el siguiente caso, tengo 2 tablas, una donde tengo maestro de clientes, y otra donde hay movimientos de esos clientes, cada cliente puede tener N cantidad de movimientos, el punto esta en lo siguiente, hago un select de la tabla de maestro de clientes que cumplan una condicion, y eso esta fino y me filtra solo los que quiero, ahora necesito hacer un 2do. SELECT en la tabla de movimientos, pero que tenga los movimientos de cada uno de los clientes filtrado, con un solo cliente no tengo problema, pero resulta que son varios clientes y es variante el codigo del cliente que es el que tengo relacionado como indice en la tabla de movimientos, hice 2do while anidados y me hace el trabajo, pero la tabla de movimientos es bastante grande y cada vez que cambia de codigo de cliente, vuelve hacer el recorrido de todos los registros de la tabla de movimientos, haciendose muy largo el proceso. Mi pregunta, como hago un SELECT que solo tenga los movimientos de los clientes que esten filtrados en el SELECT de clientes.? solo traigo los campos que necesito trabajar, no todos los de las tablas. Coloco lo que estoy haciendo y acepto sugerencias e ideas, gracias y saludos... <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: --> // VAR CON LOS CAMPOS NECESARIOS EN EL QRY A CONSTRUIR... cCamposINS := "numero, apellido1, nombre1, grupo, plazomeses, status, producto, mtocontratar, cuotamensual, licitaciones" // QUERY INSC.CON FILTRO DE: GRUPO, STATUS(estado) Y BIEN ADQUIRIR cQryINS := "SELECT " + cCamposINS + " FROM " + aTablas[1] + " WHERE grupo = '" + cGrupo + ; "' AND cuotaspagadas > '" + ClipValue2SQL( 0 ) + ; "' AND plazomeses = '" + ClipValue2SQL( nCol ) + "' ORDER BY numero ASC" // TABLA inscripcion // ABRO LAS TABLAS incs Y p_cutas SEGUN FILTRO TRY oQryINS := TDolphinQry():New( cQryINS, oDatos:oConex ) CATCH oError MSGALERT( oError:description + CRLF + CRLF +; "Error Abriendo Tabla (" + aTablas[1] + "), Ejecucion de Sentencia: " +; CRLF + CRLF + cQryINS, oDatos:cTitMsg ) RETURN( NIL ) END // CAMPOS NECESARIOS PARA QRY CUOTAS cCamposCuo := "num_insc, num_leyenda, fch_vence, fch_pago, mto_aporte" cQryPCUO := "SELECT " + cCamposCuo + " FROM " + aTablas[2] + " ORDER BY num_insc, num_cuota ASC" // TABLA p_cuotas TRY oQryPCUO := TDolphinQry():New( cQryPCUO, oDatos:oConex ) CATCH oError MSGALERT( oError:description + CRLF + CRLF +; "Error Abriendo Tabla (" + aTablas[2] + "), Ejecucion de Sentencia: " +; CRLF + CRLF + cQryPCUO, oDatos:cTitMsg ) RETURN( NIL ) END // LEO INSC. DEL QRY FILTRADO PARA TOMAR NOMBRE Y No.INSC(contrato) oQryINS:GOTOP() DO WHILE !oQryINS:EOF() nCantiINS ++ // CONTADOR DE INSC.COINCIDENTES cNombre := ALLTRIM(oQryINS:apellido1) + " " + ALLTRIM(oQryINS:nombre1) nCuotas := oQryINS:plazomeses // CANT.CUOTAS SEGUN GRUPO - ESTO ES LO MISMO QUE nCol // LLENO ARRAY UNA SOLA DIMENSION CON DATOS DE TABLA insc Y LUEGO AGREGO cuotas // 1RA.COL.INSC(contrato) AADD( aReg, oQryINS:numero ) // 2DA.COL.NOMBRE CLIENTE AADD( aReg, cNombre ) // 3RA.COL.CHECK LIST - INICIALIZO TODAS LAS CUOTAS EN CERO 0(.f.) POR DEFECTO PARA SU ADJUDICACION AADD( aReg, 0 ) // 4TA.COL.GRUPO AADD( aReg, oQryINS:grupo ) // 5TA.COL.MESES(cantidad de cuotas) AADD( aReg, oQryINS:plazomeses ) // 6TA.COL.STATUS(estado) AADD( aReg, oQryINS:status ) // 7MA.COL.PRODCUTO(bien adquirir) AADD( aReg, oQryINS:producto ) // 8VA.COL.MTO.CONTRATADO AADD( aReg, oQryINS:mtocontratar ) // 9NA.COL.MTO.CUOTA(aporte mensual) AADD( aReg, oQryINS:cuotamensual ) // 10MA.COL.CANTIDAD LICITACIONES OFRECIDAS AADD( aReg, oQryINS:licitaciones ) // FIN LLENO ARRAY UNA SOLA DIMENSION CON DATOS DE TABLA insc Y LUEGO AGREGO cuotas // AHORA LEO CUOTAS IGUAL A LA INSC.Y AGREGO A aReg PARA COMPLETAR REGISTRO oQryPCUO:GOTOP() DO WHILE !oQryPCUO:EOF() // LEO CUOTAS COMPARANDOLAS CON INS. Y LLENO ARRAY IF oQryPCUO:num_insc == oQryINS:numero AADD( aReg ,; IF( oQryPCUO:num_leyenda == 0 .and. oQryPCUO:fch_vence < DATE(), 9, oQryPCUO:num_leyenda ) ) ENDIF // SUMO COBRADO CUOTAS DEL MES DE TODOS LAS INSC. POR INSC.FILTRADAS IF MONTH( oQryPCUO:fch_pago ) == MONTH( DATE() ) .AND. ; YEAR( oQryPCUO:fch_pago ) == YEAR( DATE() ) .AND. ; oQryPCUO:num_insc == oQryINS:numero aVar[5] := aVar[5] + oQryPCUO:mto_aporte // SUMO COBRADO CUOTAS DEL MES ENDIF oQryPCUO:SKIP() ENDDO AADD( aDatos, aReg ) // LLENO aDatos PARA EL xBROWSE aReg := {} // LIMPIO ARRAY DE INSC. oQryINS:SKIP() ENDDO
CREAR SELECT CON DATOS DE OTRO SELECT O SELECT ANIDADOS
Jose Luis,prueba a adaptar este codigo MySql. [code=fw:1noxjg3j]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">SELECT</span> Codigo,nombre,fecha,debe,haber <span style="color: #0000ff;">FROM</span> transacc &nbsp;<br /><span style="color: #0000ff;">WHERE</span> codigo IN<br />&nbsp; &nbsp; <span style="color: #000000;">&#40;</span><span style="color: #0000ff;">SELECT</span> codigo <span style="color: #0000ff;">FROM</span> catalogo<br />&nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">WHERE</span> codigo=<span style="color: #ff0000;">'1210004099'</span> OR codigo=<span style="color: #ff0000;">'1210003099'</span><span style="color: #000000;">&#41;</span> ; &nbsp; <span style="color: #B900B9;">//aqui tu condicion</span><br />&nbsp;</div>[/code:1noxjg3j] Saludos.
CREAR SELECT CON DATOS DE OTRO SELECT O SELECT ANIDADOS
joseluisysturiz, Haber si entendi, por ejemplo. Cliente con campos Cliente Calle Numero Etc Detalle de clientes Cliente Cargos Abonos Fecha Etc [code=fw:2bjsmpdb]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">SELECT</span> a.cliente, a.calle, a.numero, b.cargo, b.abono, b.fecha <span style="color: #0000ff;">FROM</span> clientes AS a INNER <span style="color: #0000ff;">JOIN</span> detalle_clientes AS b <span style="color: #0000ff;">ON</span> b.cliente=a.cliente <span style="color: #0000ff;">WHERE</span> b.fecha = <span style="color: #000000;">20121111</span> <span style="color: #0000ff;">ORDER BY</span> a.cliente, b.fecha</div>[/code:2bjsmpdb] Espero te ayude.
CREAR SELECT CON DATOS DE OTRO SELECT O SELECT ANIDADOS
Francisco, esa idea fuera buena si los codigos fuesen fijos y limitados, pero el select de clientes varia en cantidad de clientes y diferentes codigos dependiendo del filtro que haya hecho el usuario, por eso es que use los do while !eof() para que en base a el recorrido que voy haciendo, voy buscando los movimientos en la tabla movimientos del cliente seleccionado en su momento, por eso no puedo usar .or., igual por alli va la idea, gracias...saludos... <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: -->
CREAR SELECT CON DATOS DE OTRO SELECT O SELECT ANIDADOS
Jose Luis: [color=#FF0000:sch4ah9k]WHERE codigo='1210004099' OR codigo='1210003099') ; //aqui tu condicion[/color:sch4ah9k] Es solo un ejemplo; es aqui donde vas a poner la condicion de filtrado de tu tabla de clientes, sobre cuyo filtro se mostrarán los datos de tu tabla de transacciones de clientes. Es decir, solo se mostrarán las transacc de los clientes filtrados en tu tabla clientes. Por otro lado, el codigo de William trabaja excelente, mas veloz que el mío (ya lo probé), pero parece que no contiene la condicion de filtrado en la tabla de clientes, de la que hablas. Disculpame William si estoy equivocado. Saludos.
CREAR SELECT CON DATOS DE OTRO SELECT O SELECT ANIDADOS
Willian, doy un ejemplo de los datos que pueden suceder, ya que no es sobre un solo registro sino de varios clientes: Ejemplo, en el select de cliente basado en un filtro obtuve: ccod_cliente nombre 001 cliente 1 002 cliente 2 003 cliente 3 etc, etc, etc ahora en un select de movimientos necesitos, todos los movimientos que correspondan a los codigo de clientes 001, 002, 003, etc, donde cada cliente puede tener N cantidad de movimientos, por eso es que hice los DO WHILE anidados pero el detalle esta que por cada cliente hago el recorrido de toda la tabla de movimientos y eso me hace el proceso muy lento...saludos... <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: -->
CREAR SELECT CON DATOS DE OTRO SELECT O SELECT ANIDADOS
Jose Luiz, Puedes crear indices en las tablas y en los campos donde tu haces las busquedas.
CREAR SELECT CON DATOS DE OTRO SELECT O SELECT ANIDADOS
FranciscoA, El condicional lo puedes aplicar segun tus necesidades, me refiero puedes filtar por detalle y tambien por el maestro de catalogos. Es cuestion de jugarle con los campos... joseluisysturiz, Efectivamente puedes hacer lo que requieres segun lo comentado en los post, pero, no he entendido bien la idea, aunque una consulta "relacionada" se puede hacer perfectamente en SQL...
CREAR SELECT CON DATOS DE OTRO SELECT O SELECT ANIDADOS
[quote="wmormar":3f1lbtn8]FranciscoA, El condicional lo puedes aplicar segun tus necesidades, me refiero puedes filtar por detalle y tambien por el maestro de catalogos. Es cuestion de jugarle con los campos... [/quote:3f1lbtn8] Hola William, tienes toda la razón. Hice los cambios pertinentes y funciona perfectamente. Gracias. Saludos.
CREAR SELECT CON DATOS DE OTRO SELECT O SELECT ANIDADOS
[quote="wmormar":237vbu8a]FranciscoA, El condicional lo puedes aplicar segun tus necesidades, me refiero puedes filtar por detalle y tambien por el maestro de catalogos. Es cuestion de jugarle con los campos... joseluisysturiz, Efectivamente puedes hacer lo que requieres segun lo comentado en los post, pero, no he entendido bien la idea, aunque una consulta "relacionada" se puede hacer perfectamente en SQL...[/quote:237vbu8a] Saludos Willian, disculpa no habia respondido, anoche me senti mal y no hice mas nada hasta ahortia que reviso el foro, no he probado lo de la consulta relacionada ni lo que uds me sugirieron, mi idea es lo siguiente, con los detalles que filtro creo un array que cada registro contiene algunos campos del maestro de cliente y todos los registros de pago de ese cliente y luego esa array lo deposito en un xbrowse para hacer un cronograma de pago de cada cliente y asi saber que debe y que no, adjunto la imagen de mi resultado, ya que por los momentos con los do while anidados funciona, pero tarda demasiado, saludos... [url=http&#58;//imageshack&#46;us/photo/my-images/89/cronogramae&#46;jpg/:237vbu8a][img:237vbu8a]http&#58;//img89&#46;imageshack&#46;us/img89/32/cronogramae&#46;jpg[/img:237vbu8a][/url:237vbu8a] Uploaded with [url=http&#58;//imageshack&#46;us:237vbu8a]ImageShack.us[/url:237vbu8a]
CREAR SELECT CON DATOS DE OTRO SELECT O SELECT ANIDADOS
Jose Luis. He creado esta consulta, basada en el ejemplo de William, que deberia funcionar. Solo agregale las ' ,", + y ; donde correspondan, y las adaptaciones que estimes necesarias. (Es solo un codigo ejemplo) [code=fw:1gsjtz0w]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">SELECT</span> a.numero, a.apellido1, a.nombre1, a.grupo, a.plazomeses, a.status, a.producto, a.mtocontratar, a.cuotamensual, a.licitaciones,b.num_insc, b.num_leyenda, b.fch_vence, b.fch_pago, b.mto_aporte  <span style="color: #0000ff;">FROM</span>  aTablas<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> AS a<br />INNER <span style="color: #0000ff;">JOIN</span>  aTablas<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> AS b <span style="color: #0000ff;">ON</span> b.num_insc=a.numero<br /><span style="color: #0000ff;">WHERE</span> a.grupo = cGrupo  AND a.cuotaspagadas > ClipValue2SQL<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span> AND a.plazomeses =  ClipValue2SQL<span style="color: #000000;">&#40;</span> nCol<span style="color: #000000;">&#41;</span><br /><span style="color: #0000ff;">ORDER BY</span> a.numero <span style="color: #0000ff;">ASC</span><br /> </div>[/code:1gsjtz0w]Saludos.
CREAR SELECT CON DATOS DE OTRO SELECT O SELECT ANIDADOS
jose luis prueba asi SELECT id,campo1,campo2,campo3,campo4 FROM movimientos WHERE id IN (SELECT id,campo1,campo2 FROM clientes WHERE "tu condicion filtrado de cliente ") asi te debe funciionar sin problemas saludos paco
CREATE CLASS...
Buenas tardes a Tod@s como her que funcione en modharbour la creación de clases [code=fw:67btikqb]<div class="fw" id="{CB}" style="font-family: monospace;">CREATE <span style="color: #00C800;">CLASS</span> tReporteVentas<br /><br />    <span style="color: #0000ff;">VAR</span> lEmision    AS LOGICAL<br />    <span style="color: #0000ff;">VAR</span> dDesde      AS DATE<br /><br /><span style="color: #B900B9;">//-----------------------------------------------------------------------------------------------------------------------</span><br /><span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> tReporteVentas<br /><br />    ::<span style="color: #000000;">lEmision</span>  := .t.<br />    ::<span style="color: #000000;">dDesde</span>    := dateAds<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> <span style="color: #00C800;">Self</span> <span style="color: #000000;">&#41;</span><br /> </div>[/code:67btikqb]//-----------------------------------------------------------------------------------------------------------------------