topic
stringlengths
1
63
text
stringlengths
1
577k
coordinates mouse
Its a function of fivewin that return X,Y position of mouse. [url:31aus275]http://msdn.microsoft.com/en-us/library/windows/desktop/ms648390%28v=vs.85%29.aspx[/url:31aus275]
coordinates mouse
Enrico, Lailton: Muchas gracias. Saludos.
coordinates of Wnd
How I can determinate the max position of bottom and the max position right of a window because I must pen a listbox Size X,Y x= oWnd:nbottom y= oWnd:nRight ---------------------------
coordinates of computer/tablet
can we Know the size of screen of our pc or tablet to pen a Dialog with max sizes
coordinates of computer/tablet
Silvio, [quote:hk1rbnth]can we Know the size of screen of our pc or tablet to pen a Dialog with max sizes[/quote:hk1rbnth] there are 2 functions to get the max size [color=#0000FF:hk1rbnth][b:hk1rbnth]nH := ScreenHeight() nW := ScreenWidth() DEFINE DIALOG oDlg SIZE nW, nH PIXEL TRUEPIXEL FONT oFont [/b:hk1rbnth][/color:hk1rbnth] regards Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
coordinates of computer/tablet
thanks
copiar muchisimos archivos de texto
[code=fw:31fp6wnv]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// Usando ROBOCOPY.EXE del windows,</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br />MEMVAR cOrigen<br />MEMVAR cDestino<br />MEMVAR cFiles<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;cOrigen &nbsp;:= Curdrive<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">":<span style="color: #000000;">\f</span>wh1701<span style="color: #000000;">\s</span>amples"</span><br />&nbsp; &nbsp;cDestino := Curdrive<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">":<span style="color: #000000;">\b</span>ackup"</span><br />&nbsp; &nbsp;cFiles &nbsp; := <span style="color: #ff0000;">"*.dbf"</span><br /><br />&nbsp; &nbsp;MsgRun<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Copia archivos en 5 segundos"</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"Copia archivos ahora"</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span> | oDlg | CopiaArch<span style="color: #000000;">&#40;</span> oDlg <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</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> CopiaArch<span style="color: #000000;">&#40;</span> oDlg <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nFor, nStart, cComando<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">If</span> .not. Lisdir<span style="color: #000000;">&#40;</span> cDestino <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; LMkdir<span style="color: #000000;">&#40;</span> cDestino <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">Endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> nFor := <span style="color: #000000;">4</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">0</span> step <span style="color: #000000;">-1</span><br /><br />&nbsp; &nbsp; &nbsp; nStart = GetTickCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">while</span> <span style="color: #000000;">&#40;</span> GetTickCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> - nStart <span style="color: #000000;">&#41;</span> < <span style="color: #000000;">1000</span><br />&nbsp; &nbsp; &nbsp; end<br /><br />&nbsp; &nbsp; &nbsp; oDlg:<span style="color: #000000;">cMsg</span> := <span style="color: #ff0000;">"Copia archivos en "</span>+;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> nFor <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" segundos"</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nFor > <span style="color: #000000;">1</span>, <span style="color: #ff0000;">"s"</span>, <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; oDlg:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; SysRefresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">next</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// ROBOCOPY C:\FWH\SAMPLES C:\BACKUP *.PRG</span><br />&nbsp; &nbsp;cComando = <span style="color: #ff0000;">"ROBOCOPY "</span>+cOrigen+<span style="color: #ff0000;">" "</span>+cDestino+<span style="color: #ff0000;">" "</span>+cFiles <span style="color: #B900B9;">// /MIR - Subcarpetas</span><br /><br />&nbsp; &nbsp;MYRUN<span style="color: #000000;">&#40;</span> cComando <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;nMsgBox<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Copia Normal"</span>, <span style="color: #ff0000;">"Ok, Bye, Bye!"</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br />***************************<br /><span style="color: #00C800;">Function</span> MYRUN<span style="color: #000000;">&#40;</span> cComando <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;***************************<br />&nbsp; &nbsp;<span style="color: #00C800;">Local</span> oShell, RET, lOk:=.T.<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">TRY</span><br />&nbsp; &nbsp; &nbsp; #IFDEF __XHARBOUR__<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oShell := CreateObject<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"WScript.Shell"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; #ELSE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oShell := Win_OleCreateObject<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"WScript.Shell"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; #ENDIF<br /><br />&nbsp; &nbsp;CATCH<br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">TRY</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#IFDEF __XHARBOUR__<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oShell := CreateObject<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"WScript.Shell"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#ELSE<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oShell := Win_OleCreateObject<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"WScript.Shell"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#ENDIF<br /><br />&nbsp; &nbsp; &nbsp; CATCH<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;lOk:=.F.<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; END<br />&nbsp; &nbsp;END<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> lOk<br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">TRY</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//.F. = Nao espera a aplicacao fechar, .T. espera.</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oShell:<span style="color: #000000;">Run</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"%comspec% /c "</span> + cComando, <span style="color: #000000;">0</span>, .T. <span style="color: #000000;">&#41;</span> <br /><br />&nbsp; &nbsp; &nbsp; CATCH<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lOk:=.F.<br /><br />&nbsp; &nbsp; &nbsp; END<br /><br />&nbsp; &nbsp; &nbsp; oShell := <span style="color: #00C800;">NIL</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">//-- &nbsp; RET := oShell:Run( "%comspec% /c " + cComando, 0) &nbsp;//, .T. )</span><br /><br /><span style="color: #00C800;">RETURN</span> lOk<br />&nbsp;</div>[/code:31fp6wnv]
copiar muchisimos archivos de texto
compañeros buenos dias Estoy tratando de crear un utilitario para respaldar archivos xml de un disco duro a otro en un servidor, el problema es que son muchos miles de ellos en el orden de 500000 archivos, lo estoy haciendo con cFilein = 'z:\sistemas\xml\123456789.xml' cFileOut = 'r:\respaldos\sistemas\xml\123456789.xml' copy file ( cFilein ) to ( cFIleOut ) el programa se queda congelado ya he tratado de porner sysrefresh, estoy utilizando una window para esto ademas no me funcionan los meter que he puesto, la lectura la hago son directory() y me demora un minuto en la lectura pero al procesarlos se congela aca algo del codigo donde se queda congelada la ventana [code=fw:5400ncm5]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">method</span> respaldo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">class</span> tWg_AlmacenXml<br /><br />&nbsp; &nbsp; <span style="color: #00C800;">local</span> i<br />&nbsp; &nbsp; <span style="color: #00C800;">local</span> j<br />&nbsp; &nbsp; <span style="color: #00C800;">local</span> k<br />&nbsp; &nbsp; <span style="color: #00C800;">local</span> nLen<br />&nbsp; &nbsp; <span style="color: #00C800;">local</span> cFile<br />&nbsp; &nbsp; <span style="color: #00C800;">local</span> cFileOut<br />&nbsp; &nbsp; <span style="color: #00C800;">for</span> i = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> len<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aCaminosfe</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//para cada almacen</span><br />&nbsp; &nbsp; &nbsp; &nbsp; sysrefresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">oInterfaz</span>:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">SetMsg</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aCaminosFe</span><span style="color: #000000;">&#91;</span> i <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">oInterfaz</span>:<span style="color: #000000;">oMeter</span>:<span style="color: #000000;">nTotal</span> = len<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aDirsfe</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">oInterfaz</span>:<span style="color: #000000;">oMeter</span>:<span style="color: #000000;">set</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">oInterfaz</span>:<span style="color: #000000;">oMeter</span>:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">cPathFe</span> &nbsp; &nbsp;= ::<span style="color: #000000;">aCaminosFe</span><span style="color: #000000;">&#91;</span> i <span style="color: #000000;">&#93;</span> <span style="color: #B900B9;">//apunte al almacen</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lStop</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit<br />&nbsp; &nbsp; &nbsp; &nbsp; end<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">for</span> j = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> len<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aDirsfe</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//dentro del almacen cada directorio de data</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">oInterfaz</span>:<span style="color: #000000;">oMeter</span>:<span style="color: #000000;">set</span><span style="color: #000000;">&#40;</span> j <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">oInterfaz</span>:<span style="color: #000000;">oMeter</span>:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">cSectionFe</span> = ::<span style="color: #000000;">aDirsfe</span><span style="color: #000000;">&#91;</span> j <span style="color: #000000;">&#93;</span> &nbsp; <span style="color: #B900B9;">//'compgen\autorizados\' &nbsp;//apunte a directorio de data dentro del almacen</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">cMascara</span> &nbsp; = ::<span style="color: #000000;">aMascaras</span><span style="color: #000000;">&#91;</span> j <span style="color: #000000;">&#93;</span> <span style="color: #B900B9;">// *.xml la terminacion de los archivos dentro de ese directorio</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">oInterfaz</span>:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">SetMsg</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'leyendo .. '</span> + ::<span style="color: #000000;">cPathfe</span> + ::<span style="color: #000000;">cSectionFe</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//msginfo('voy a leer')</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">leeData</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #B900B9;">//leo los datos</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nLen = len<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aData</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">oInterfaz</span>:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">SetMsg</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'proc .. '</span> + alltrim<span style="color: #000000;">&#40;</span> str<span style="color: #000000;">&#40;</span> nLen <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">' archs '</span> + ::<span style="color: #000000;">cPathRespaldo</span> + ::<span style="color: #000000;">cSectionFe</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sysrefresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//msginfo('ya lei')</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; makedir<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cPathRespaldo</span> + ::<span style="color: #000000;">cSectionFe</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//crea si no existe el directorio destino</span><br /><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">oInterfaz</span>:<span style="color: #000000;">oMeter1</span>:<span style="color: #000000;">nTotal</span> = nLen<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">oInterfaz</span>:<span style="color: #000000;">oMeter1</span>:<span style="color: #000000;">set</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">oInterfaz</span>:<span style="color: #000000;">oMeter1</span>:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">oInterfaz</span>:<span style="color: #000000;">oWnd</span>:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">for</span> k = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> nLen<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> k % <span style="color: #000000;">10</span> == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sysrefresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">//msginfo('acabo de refrescar')</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">oInterfaz</span>:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">SetMsg</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cPathRespaldo</span> + ::<span style="color: #000000;">cSectionFe</span> + str<span style="color: #000000;">&#40;</span> k, <span style="color: #000000;">8</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">' / '</span> + str<span style="color: #000000;">&#40;</span> nLen, <span style="color: #000000;">8</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">lStop</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">oInterfaz</span>:<span style="color: #000000;">oMeter1</span>:<span style="color: #000000;">set</span><span style="color: #000000;">&#40;</span> k <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">oInterfaz</span>:<span style="color: #000000;">oMeter1</span>:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cFile &nbsp; &nbsp;= ::<span style="color: #000000;">cPathFe</span> &nbsp; &nbsp; &nbsp; + ::<span style="color: #000000;">cSectionFe</span> + ::<span style="color: #000000;">aData</span><span style="color: #000000;">&#91;</span> k, <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cFileOut = ::<span style="color: #000000;">cPathRespaldo</span> + ::<span style="color: #000000;">cSectionFe</span> + ::<span style="color: #000000;">aData</span><span style="color: #000000;">&#91;</span> k, <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">//msginfo( cFile + CRLF + cFileOut )</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> !file<span style="color: #000000;">&#40;</span> cFileOut <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;copy file <span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">&#40;</span> cFileOut <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">next</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">aData</span> = <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">next</span><br />&nbsp; &nbsp; <span style="color: #00C800;">next</span><br /><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:5400ncm5] el codigo de la ventana es [code=fw:5400ncm5]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">method</span> ventana<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">class</span> tWg_InterfazAlmacenXml<br /><br />&nbsp; &nbsp; <span style="color: #00C800;">local</span> oSelf := <span style="color: #00C800;">Self</span><br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> ::<span style="color: #000000;">oWnd</span> <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">450</span>, <span style="color: #000000;">600</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Manejador de almacenes xml de facturación electrónica"</span> <span style="color: #0000ff;">PIXEL</span><br /><br />&nbsp; &nbsp; @ <span style="color: #000000;">050</span>, <span style="color: #000000;">10</span> METER ::<span style="color: #000000;">oMeter</span> &nbsp;<span style="color: #0000ff;">VAR</span> ::<span style="color: #000000;">nActual</span> &nbsp;TOTAL ::<span style="color: #000000;">nTotal</span> &nbsp;<span style="color: #0000ff;">OF</span> ::<span style="color: #000000;">oWnd</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">235</span>, <span style="color: #000000;">50</span> <span style="color: #0000ff;">PIXEL</span><br />&nbsp; &nbsp; @ <span style="color: #000000;">150</span>, <span style="color: #000000;">10</span> METER ::<span style="color: #000000;">oMeter1</span> <span style="color: #0000ff;">VAR</span> ::<span style="color: #000000;">nActual1</span> TOTAL ::<span style="color: #000000;">nTotal1</span> <span style="color: #0000ff;">OF</span> ::<span style="color: #000000;">oWnd</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">235</span>, <span style="color: #000000;">50</span> <span style="color: #0000ff;">PIXEL</span><br />&nbsp; &nbsp; @ <span style="color: #000000;">250</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"&Parar Respaldo"</span> <span style="color: #0000ff;">OF</span> ::<span style="color: #000000;">oWnd</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">50</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> oSelf:<span style="color: #000000;">oAlmacen</span>:<span style="color: #000000;">lStop</span> := .t. <span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">PIXEL</span><br /><br />&nbsp; &nbsp; <span style="color: #B900B9;">//@ 350, 10 SAY ::oSay PROMPT "leyenda aca ...." OF ::oWnd SIZE 300, 50</span><br /><br />&nbsp; &nbsp; SET <span style="color: #0000ff;">MESSAGE</span> <span style="color: #0000ff;">OF</span> oSelf:<span style="color: #000000;">oWnd</span> <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">'mensajes del sistema de repaldos'</span> NOINSET CLOCK DATE KEYBOARD<br /><br />&nbsp; &nbsp; ::<span style="color: #000000;">oWnd</span>:<span style="color: #0000ff;">Say</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">350</span>, <span style="color: #000000;">10</span>, <span style="color: #ff0000;">'leyendas van aca......'</span>, , , , .t. <span style="color: #000000;">&#41;</span><br /><br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> ::<span style="color: #000000;">oWnd</span> <span style="color: #0000ff;">on</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span> oSelf:<span style="color: #000000;">oAlmacen</span>:<span style="color: #000000;">oInterfaz</span> := oSelf &nbsp;,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oSelf:<span style="color: #000000;">oAlmacen</span>:<span style="color: #000000;">leeconfig</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; ,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oSelf:<span style="color: #000000;">oAlmacen</span>:<span style="color: #000000;">respaldo</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oSelf:<span style="color: #000000;">oWnd</span>:<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 /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:5400ncm5] alguien ha hecho algo parecido ? me podrian dar unos consejos al respecto, muchas gracias de antemano he probado con comando xcopy y se sale sin dar errores y no termina la copia, la idea es hacerlo de una manera automatizada ademas de la forma que lo estoy haciendo tengo el inconveniente que las fechas son cambiadas de los ficheros si alguien sabe como copiarlos respetando la fecha de creacion att Wilson Gamboa A Quito Ecuador
copiar muchisimos archivos de texto
Hola, Lo que yo haría sería primero determinar donde se produce el cuelgue del sistema. Para ello pondría unas trazas. También quitaría momentaneamente los meters, para saber si originan el problema. Para copiar con misma fecha: <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=6&t=205&start=0">viewtopic.php?f=6&t=205&start=0</a><!-- l --> Salu2
copiar muchisimos archivos de texto
muchsa gracias por rsponder he quitado los meters y he puesto esa funcion que usa Rafa Carmona, ya copia con la misma fecha pero sigue congelandose la ventana el problema esta cuando escribe en disco parece que se queda alli ya que ni siquiera aparece la leyenda que pongo cada 10 archivos copiados aca [code=fw:ru5lxm92]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">for</span> k = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> nLen<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> k % <span style="color: #000000;">10</span> == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sysrefresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">//msginfo('acabo de refrescar')</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">oInterfaz</span>:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">SetMsg</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cPathRespaldo</span> + ::<span style="color: #000000;">cSectionFe</span> + str<span style="color: #000000;">&#40;</span> k, <span style="color: #000000;">8</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">' / '</span> + str<span style="color: #000000;">&#40;</span> nLen, <span style="color: #000000;">8</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> ::<span style="color: #000000;">lStop</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">//::oInterfaz:oMeter1:set( k )</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">//::oInterfaz:oMeter1:refresh()</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cFile &nbsp; &nbsp;= ::<span style="color: #000000;">cPathFe</span> &nbsp; &nbsp; &nbsp; + ::<span style="color: #000000;">cSectionFe</span> + ::<span style="color: #000000;">aData</span><span style="color: #000000;">&#91;</span> k, <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cFileOut = ::<span style="color: #000000;">cPathRespaldo</span> + ::<span style="color: #000000;">cSectionFe</span> + ::<span style="color: #000000;">aData</span><span style="color: #000000;">&#91;</span> k, <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">//msginfo( cFile + CRLF + cFileOut )</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> !file<span style="color: #000000;">&#40;</span> cFileOut <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">//copy file ( cFile ) to ( cFileOut )</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MYCOPYFILE<span style="color: #000000;">&#40;</span> cFile , cFileOut, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">next</span><br />&nbsp;</div>[/code:ru5lxm92] esa leyenda no llega a aparecer en la ventana a pesar que si esta copiandose los archivos estoy probando con 20000 archivos por directorio son como 3 y si funciona pero se queda congelado hasta terminar podrias darme una idea de como poner una traza ? perdon por la ignoracia saludos Wilson
copiar muchisimos archivos de texto
Hola Wilson, Mi idea de trazas se basa en grabar en un fichero log pistas de por donde va el proceso. He comentado algunas cosas y puesto trazas [code=fw:2g0yj861]<div class="fw" id="{CB}" style="font-family: monospace;">nH:= FCreate<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Trazas.Log"</span><span style="color: #000000;">&#41;</span><br />           <span style="color: #00C800;">for</span> k = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> nLen<br /><br /><span style="color: #B900B9;">// <<--               if k % 10 == 0</span><br /><span style="color: #B900B9;">// <<--                   sysrefresh()</span><br /><span style="color: #B900B9;">// <<--                   //msginfo('acabo de refrescar')</span><br /><span style="color: #B900B9;">// <<--                   ::oInterfaz:oWnd:SetMsg( ::cPathRespaldo + ::cSectionFe + str( k, 8 ) + ' / ' + str( nLen, 8 ) )</span><br /><span style="color: #B900B9;">// <<--               end</span><br /><span style="color: #B900B9;">// <<--               if ::lStop</span><br /><span style="color: #B900B9;">// <<--                   exit</span><br /><span style="color: #B900B9;">// <<--               end</span><br />               <span style="color: #B900B9;">//::oInterfaz:oMeter1:set( k )</span><br />               <span style="color: #B900B9;">//::oInterfaz:oMeter1:refresh()</span><br />               cFile    = ::<span style="color: #000000;">cPathFe</span>       + ::<span style="color: #000000;">cSectionFe</span> + ::<span style="color: #000000;">aData</span><span style="color: #000000;">&#91;</span> k, <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span><br />               cFileOut = ::<span style="color: #000000;">cPathRespaldo</span> + ::<span style="color: #000000;">cSectionFe</span> + ::<span style="color: #000000;">aData</span><span style="color: #000000;">&#91;</span> k, <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span><br />               <span style="color: #B900B9;">//msginfo( cFile + CRLF + cFileOut )</span><br /><br />               FWrite<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Antes del IF "</span>+ cFile+ Space<span style="color: #000000;">&#40;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#41;</span>+ cFileOut+ Space<span style="color: #000000;">&#40;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#41;</span>+ Transform<span style="color: #000000;">&#40;</span>File<span style="color: #000000;">&#40;</span>cFile<span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span>+ Space<span style="color: #000000;">&#40;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#41;</span>+ Transform<span style="color: #000000;">&#40;</span>File<span style="color: #000000;">&#40;</span>cFileOut<span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />               <span style="color: #00C800;">if</span> !file<span style="color: #000000;">&#40;</span> cFileOut <span style="color: #000000;">&#41;</span><br />                   <span style="color: #B900B9;">//copy file ( cFile ) to ( cFileOut )</span><br />                   FWrite<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Antes de copiar "</span>+ Time<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <br />                      MYCOPYFILE<span style="color: #000000;">&#40;</span> cFile , cFileOut, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />                   FWrite<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Despues de copiar "</span>+ Transform<span style="color: #000000;">&#40;</span>File<span style="color: #000000;">&#40;</span>cFileOut<span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span>+ Space<span style="color: #000000;">&#40;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#41;</span>+ Time<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />               end<br />            <span style="color: #00C800;">next</span><br /><br />FClose<span style="color: #000000;">&#40;</span>nH<span style="color: #000000;">&#41;</span><br /><br /> </div>[/code:2g0yj861] En todo caso, para la prueba, apaga antivirus momentaneamente. Salu2
copiar muchisimos archivos de texto
[code=fw:1ruojo1j]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// Just for FW 32 bits - C:\FWH..\SAMPLES\DLGFILE.PRG</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #00D7D7;">#define</span> FO_MOVE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x0001<br /><span style="color: #00D7D7;">#define</span> FO_COPY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x0002<br /><span style="color: #00D7D7;">#define</span> FO_DELETE &nbsp; &nbsp; &nbsp; &nbsp; 0x0003<br /><span style="color: #00D7D7;">#define</span> FO_RENAME &nbsp; &nbsp; &nbsp; &nbsp; 0x0004<br /><br /><span style="color: #00D7D7;">#define</span> FOF_MULTIDESTFILES &nbsp; &nbsp; &nbsp; &nbsp; 0x0001<br /><span style="color: #00D7D7;">#define</span> FOF_CONFIRMMOUSE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x0002<br /><span style="color: #00D7D7;">#define</span> FOF_SILENT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0x0004 &nbsp;<span style="color: #B900B9;">// don't create progress/report</span><br /><span style="color: #00D7D7;">#define</span> FOF_RENAMEONCOLLISION &nbsp; &nbsp; &nbsp;0x0008<br /><span style="color: #00D7D7;">#define</span> FOF_NOCONFIRMATION &nbsp; &nbsp; &nbsp; &nbsp; 0x0010 &nbsp;<span style="color: #B900B9;">// Don't prompt the user.</span><br /><span style="color: #00D7D7;">#define</span> FOF_WANTMAPPINGHANDLE &nbsp; &nbsp; &nbsp;0x0020 &nbsp;<span style="color: #B900B9;">// Fill in SHFILEOPSTRUCT.hNameMappings</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// Must be freed using SHFreeNameMappings</span><br /><span style="color: #00D7D7;">#define</span> FOF_ALLOWUNDO &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x0040<br /><span style="color: #00D7D7;">#define</span> FOF_FILESONLY &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x0080 &nbsp;<span style="color: #B900B9;">// on *.*, do only files</span><br /><span style="color: #00D7D7;">#define</span> FOF_SIMPLEPROGRESS &nbsp; &nbsp; &nbsp; &nbsp; 0x0100 &nbsp;<span style="color: #B900B9;">// means don't show names of files</span><br /><span style="color: #00D7D7;">#define</span> FOF_NOCONFIRMMKDIR &nbsp; &nbsp; &nbsp; &nbsp; 0x0200 &nbsp;<span style="color: #B900B9;">// don't confirm making any needed dirs</span><br /><span style="color: #00D7D7;">#define</span> FOF_NOERRORUI &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x0400 &nbsp;<span style="color: #B900B9;">// don't put up error UI</span><br /><span style="color: #00D7D7;">#define</span> FOF_NOCOPYSECURITYATTRIBS &nbsp;0x0800 &nbsp;<span style="color: #B900B9;">// dont copy NT file Security Attributes</span><br /><span style="color: #00D7D7;">#define</span> FOF_NORECURSION &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0x1000 &nbsp;<span style="color: #B900B9;">// don't recurse into directories.</span><br /><br /><span style="color: #00C800;">static</span> oDlg<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 />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"System Files management Dialogs"</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;@ <span style="color: #000000;">0.5</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"&Copy"</span> <span style="color: #0000ff;">ACTION</span> CopyFile<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"*.XML"</span>, <span style="color: #ff0000;">"C:<span style="color: #000000;">\T</span>ESTE"</span> <span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">30</span>, <span style="color: #000000;">12</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">/*<br />&nbsp; &nbsp;@ 1.5, 1 BUTTON "&Delete" ACTION DeleteFile( "c:\dlgfile.exe" ) ;<br />&nbsp; &nbsp; &nbsp; SIZE 30, 12<br /><br />&nbsp; &nbsp;@ 2.5, 1 BUTTON "&Move" ACTION MoveFile( "dlgfile.exe", "c:\dlgfile.exe" ) ;<br />&nbsp; &nbsp; &nbsp; SIZE 30, 12<br />&nbsp; &nbsp;*/</span><br /><br />&nbsp; &nbsp;<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><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> CopyFile<span style="color: #000000;">&#40;</span> cSource, cDestination <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> SHFile<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">hWnd</span>, FO_COPY, cSource + Chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>, cDestination <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> DeleteFile<span style="color: #000000;">&#40;</span> cFileName <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> SHFile<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">hWnd</span>, FO_DELETE, cFileName + Chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> MoveFile<span style="color: #000000;">&#40;</span> cSource, cDestination <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> SHFile<span style="color: #000000;">&#40;</span> oDlg:<span style="color: #000000;">hWnd</span>, FO_MOVE, cSource + Chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>, cDestination <span style="color: #000000;">&#41;</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 /><span style="color: #00D7D7;">#include</span> <Windows.h><br /><span style="color: #00D7D7;">#include</span> <ShellApi.h><br /><span style="color: #00D7D7;">#include</span> <ShlObj.h><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> SHFILE <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp;SHFILEOPSTRUCT sh;<br /><br />&nbsp; &nbsp;memset<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> char * <span style="color: #000000;">&#41;</span> &sh, <span style="color: #000000;">0</span>, sizeof<span style="color: #000000;">&#40;</span> sh <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<br /><br />&nbsp; &nbsp;sh.hwnd &nbsp; = <span style="color: #000000;">&#40;</span> HWND <span style="color: #000000;">&#41;</span> hb_parnl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp;sh.wFunc &nbsp;= <span style="color: #000000;">&#40;</span> UINT <span style="color: #000000;">&#41;</span> hb_parnl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp;sh.pFrom &nbsp;= <span style="color: #000000;">&#40;</span> LPSTR <span style="color: #000000;">&#41;</span> hb_parc<span style="color: #000000;">&#40;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp;sh.pTo &nbsp; &nbsp;= <span style="color: #000000;">&#40;</span> LPSTR <span style="color: #000000;">&#41;</span> hb_parc<span style="color: #000000;">&#40;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp;sh.fFlags = <span style="color: #000000;">&#40;</span> FILEOP_FLAGS <span style="color: #000000;">&#41;</span> hb_parnl<span style="color: #000000;">&#40;</span> <span style="color: #000000;">5</span> <span style="color: #000000;">&#41;</span>;<br /><br />&nbsp; &nbsp;hb_retnl<span style="color: #000000;">&#40;</span> SHFileOperation<span style="color: #000000;">&#40;</span> &sh <span style="color: #000000;">&#41;</span> <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:1ruojo1j]
copiar muchisimos archivos de texto
Muchisimas gracias Karinha voy a hacer lo que me dices y tu codigo con 20000 archivos funciona excelente supongo es del API de windows muchas gracias voy a seguir a ver si lo sacon con mi docigo sino usare lo que me has enviado Gracias nuevamente att Wilson desde Quito Ecuador
copiar muchisimos archivos de texto
[code=fw:1jxevlar]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; oFs &nbsp; := CreateObject<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Scripting.FileSystemObject"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oFs:<span style="color: #000000;">CopyFile</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"z:<span style="color: #000000;">\s</span>ystems<span style="color: #000000;">\x</span>ml<span style="color: #000000;">\*</span>.xml"</span> , <span style="color: #ff0000;">"r:<span style="color: #000000;">\b</span>ackups<span style="color: #000000;">\s</span>ystems<span style="color: #000000;">\x</span>ml<span style="color: #000000;">\"</span>, .t. ) // .t. for overwrite<br /></span></div>[/code:1jxevlar]
copiar muchisimos archivos de texto
Perfect mister Rao. Many thanks. [code=fw:5hwpmf2i]<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;">static</span> oWnd<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 />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> oBar, cOrigen, cDestino<br /><br />&nbsp; &nbsp;cOrigen &nbsp;:= Curdrive<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">":<span style="color: #000000;">\f</span>wh1701<span style="color: #000000;">\s</span>amples<span style="color: #000000;">\*</span>.prg"</span><br /><br />&nbsp; &nbsp;cDestino := Curdrive<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">":<span style="color: #000000;">\b</span>ackup<span style="color: #000000;">\"</span><br /><br /><br />&nbsp; &nbsp;DEFINE WINDOW oWnd TITLE "</span>Copiar Archivos<span style="color: #ff0000;">"<br /><br />&nbsp; &nbsp;DEFINE BUTTONBAR oBar _3D OF oWnd<br /><br />&nbsp; &nbsp;DEFINE BUTTON OF oBar ACTION( Copiar( cOrigen, cDestino ), oWnd:End() )<br /><br />&nbsp; &nbsp;SET MESSAGE OF oWnd TO "</span>Copiar Archivos<span style="color: #ff0000;">" NOINSET CLOCK DATE KEYBOARD<br /><br />&nbsp; &nbsp;ACTIVATE WINDOW oWnd CENTER<br /><br />RETURN NIL<br /><br />//----------------------------------------------------------------//<br /><br />FUNCTION Copiar( cOrigen, cDestino )<br /><br />&nbsp; &nbsp;LOCAL oFs<br /><br />&nbsp; &nbsp;If .not. Lisdir( cDestino )<br />&nbsp; &nbsp; &nbsp; LMkdir( cDestino )<br />&nbsp; &nbsp;Endif<br /><br />&nbsp; &nbsp;CURSORWAIT()<br /><br />&nbsp; &nbsp;oFs &nbsp; := CreateObject( "</span>Scripting.FileSystemObject<span style="color: #ff0000;">" )<br /><br />&nbsp; &nbsp;// oFs:CopyFile( "</span>z:\systems\xml\*.xml<span style="color: #ff0000;">" , "</span>r:\backups\systems\xml\<span style="color: #ff0000;">", .t. ) // .t. for overwrite<br /><br />&nbsp; &nbsp;oFs:CopyFile( cOrigen, cDestino, .T. ) // .t. for overwrite<br /><br />&nbsp; &nbsp;CURSORARROW()<br /><br />&nbsp; &nbsp;? "</span>Pronto...<span style="color: #ff0000;">"<br /><br />RETURN NIL<br /></span></div>[/code:5hwpmf2i] Regards, saludos.
copiar muchisimos archivos de texto
Otra posibilidad utilizando herramientas del sistema <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=17&t=34492#p204832">viewtopic.php?f=17&t=34492#p204832</a><!-- l -->
copiar muchisimos archivos de texto
[code=fw:218172wo]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// Otro ejemplo:</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br />MEMVAR cOrigen<br />MEMVAR cDestino<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;cOrigen &nbsp;:= Curdrive<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">":<span style="color: #000000;">\f</span>wh1701<span style="color: #000000;">\s</span>amples<span style="color: #000000;">\*</span>.dbf"</span><br />&nbsp; &nbsp;cDestino := Curdrive<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">":<span style="color: #000000;">\b</span>ackup<span style="color: #000000;">\"</span><br /><br />&nbsp; &nbsp;MsgRun( "</span>Copia archivos en <span style="color: #000000;">5</span> segundos<span style="color: #ff0000;">",;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"</span>Copia archivos ahora<span style="color: #ff0000;">",;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { | oDlg | CopiaArch( oDlg ) } )<br /><br />return nil<br /><br />//----------------------------------------------------------------------------//<br /><br />function CopiaArch( oDlg )<br /><br />&nbsp; &nbsp;local &nbsp;oFs<br />&nbsp; &nbsp;local nFor, nStart<br /><br />&nbsp; &nbsp;If .not. Lisdir( cDestino )<br />&nbsp; &nbsp; &nbsp; LMkdir( cDestino )<br />&nbsp; &nbsp;Endif<br /><br />&nbsp; &nbsp;for nFor := 4 to 0 step -1<br /><br />&nbsp; &nbsp; &nbsp; nStart = GetTickCount()<br /><br />&nbsp; &nbsp; &nbsp; while ( GetTickCount() - nStart ) < 1000<br />&nbsp; &nbsp; &nbsp; end<br /><br />&nbsp; &nbsp; &nbsp; oDlg:cMsg := "</span>Copia archivos en <span style="color: #ff0000;">"+;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LTrim( Str( nFor ) ) + "</span> segundos<span style="color: #ff0000;">" + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; If( nFor > 1, "</span>s<span style="color: #ff0000;">", "</span><span style="color: #ff0000;">" )<br /><br />&nbsp; &nbsp; &nbsp; oDlg:Refresh()<br /><br />&nbsp; &nbsp; &nbsp; SysRefresh()<br /><br />&nbsp; &nbsp;next<br /><br />&nbsp; &nbsp;oFs &nbsp; := CreateObject( "</span>Scripting.FileSystemObject<span style="color: #ff0000;">" )<br /><br />&nbsp; &nbsp;// oFs:CopyFile( "</span>z:\systems\xml\*.xml<span style="color: #ff0000;">" , "</span>r:\backups\systems\xml\<span style="color: #ff0000;">", .t. ) // .t. for overwrite<br /><br />&nbsp; &nbsp;oFs:CopyFile( cOrigen, cDestino, .T. ) // .t. for overwrite<br /><br />&nbsp; &nbsp;nMsgBox( "</span>Copia <span style="color: #0000ff;">Normal</span><span style="color: #ff0000;">", "</span>Ok, Bye, Bye!<span style="color: #ff0000;">" )<br /><br />return nil<br /></span></div>[/code:218172wo]
copiar muchisimos archivos de texto
Joao, muy bien, muchas gracias
copiar muchisimos archivos de texto
Muchisimas gracias a todos los que me han ayudado al momento voy a comparar tiempos y ver con cual solucion me quedo, les mantendre informados de nuevo muchisimas gracias saludos Wilson
copiar muchisimos archivos de texto
Is this command fast too? Is it slower or is it the same thing? [code=fw:12jv8g4h]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />DLL32 <span style="color: #00C800;">FUNCTION</span> COPYFILE<span style="color: #000000;">&#40;</span> cExistingFileName AS LPSTR, cNewFileName AS LPSTR, lFailIfExists AS LONG <span style="color: #000000;">&#41;</span> AS BOOL;<br />    PASCAL <span style="color: #0000ff;">FROM</span> <span style="color: #ff0000;">"CopyFileA"</span> LIB <span style="color: #ff0000;">"kernel32.dll"</span><br /><br /> </div>[/code:12jv8g4h]
copiar muchisimos archivos de texto
[quote="tiaofw":1omvtvt4]Is this command fast too? Is it slower or is it the same thing? [code=fw:1omvtvt4]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />DLL32 <span style="color: #00C800;">FUNCTION</span> COPYFILE<span style="color: #000000;">&#40;</span> cExistingFileName AS LPSTR, cNewFileName AS LPSTR, lFailIfExists AS LONG <span style="color: #000000;">&#41;</span> AS BOOL;<br />    PASCAL <span style="color: #0000ff;">FROM</span> <span style="color: #ff0000;">"CopyFileA"</span> LIB <span style="color: #ff0000;">"kernel32.dll"</span><br /><br /> </div>[/code:1omvtvt4][/quote:1omvtvt4] This copies a single file only.
copiar muchisimos archivos de texto
Hola Wilson, permíteme una sugerencia que seguramente va a afectar el funcionamiento de la copia y de la aplicación que use la carpeta con 500K de archivos. El tener 500k de entradas en una única carpeta va a hacer TODAS las operaciones lentas, y la vuelve muchísimo más suceptible a fallos del filesystem. Incluso cuando añades un xml nuevo a la carpeta seguramente le tomará bastante más tiempo crear un nuevo archivo porque tiene que buscar en todo el directorio si existe. Ese problema lo tienen muchas aplicaciones, por ejemplo los cachés tipo Squid, o los servidores de correos, y programas así que tienen muchos archivos pequeños. Lo que hacen para evitar tener tantas entradas en un mismo directorio es separarlas por algún criterio, por ejemplo Squid guarda los archivos cacheados con nombres que son 16 dígitos hezadecimales, entonces crea 256 carpetas 00, 01, 02..... FE,FF y reparte los archivos, entonces, por ejemplo, tendrías 256 carperas con 2000 archivos c/u, lo cual seguramente funcione más rápido. Obviamente requiere un poco más de gestión, no conozco el detalle de tu aplicación y el origen de los xml, pero seguramente encontrarás algún criterio que te ayude a separarlos. Otra alternativa es hacer como hace Outlook con los correos: poner todos los ficherosjuntos y armar un índice de donde están dentro del texto, pero eso ya es mucho más elaborado. Una entrada de stackOverflow al respecto: <!-- m --><a class="postlink" href="https://stackoverflow.com/questions/2994544/how-many-files-in-a-directory-is-too-many-on-windows-and-linux">https://stackoverflow.com/questions/299 ... -and-linux</a><!-- m --> Un saludo
copiar muchisimos archivos de texto
Carlos buenas tardes muchas gracias por tus palabras eso estoy pensando realizar el origen es una carpeta generada por un aplicativo de facturación electrónica, la idea es respaldar e ir administrando tanto la carpeta origen es decir respaldar e ir borrando luego del respaldo y solo dejar por ejemplo el ultimo mes , etc y gestionar los respaldos, generar carpetas por mes y año, etc hasta ahora todos los intentos de sacar respaldos han fracasado con las opciones que me dieron aca he fracasado es muy lento y de repente deja de funcionar, voy a probar con robocopy pero desde linea de comandos porque con programa se detuvo ire informando mis avances gracias Wilson
copiar muchisimos archivos de texto
buenas tardes con el comando robocopy igual se hace demasiado lento el sacar respaldos manualmente al inicio Mi idea es sacar los respaldos y organizar luego los mismos en el NAS veo que la lentitud es con cualquier metodo que se use imagino es por la cantidad de ficheros pero cuando ya tenga todo respaldado empezare a borrar en el origen para que se vaya racionalizando el tema gracias por toda la ayuda recibida saludos Wilsonm
copiar muchisimos archivos de texto
Tal y como te dice Carlos, vas a tener problemas uses lo que uses, hasta puedes llegar a tener verdaderos problemas hasta con el sistema de archivos del SO. Una solución, es crear carpeta por año, mes, día, y ahí puedes colocar los ficheros del día que has generado, c:\xml\2018\01\01, estarán solo los XML de ese dia... pero.. mi consejo es que pienses algún sistema de comprimir los ficheros , y copiar ese zip, de lo contrario, tarde o temprano más a tener problemas. Una solución más elegante es usar una tabla SQL , DBF, lo que sea, y guardar ahí el XML, eso si eres tu que genera el XML, es lo más óptimo y seguro, nosotros terminamos al final usando esta solución , por lo descrito más arriba, y mano de santo <!-- s;-) --><img src="{SMILIES_PATH}/icon_wink.gif" alt=";-)" title="Wink" /><!-- s;-) -->
copiar un archivo txt a dbf
En su momento hice consultas sobre este tópico y no pude resolverlo para poder ser utilizado ya que los archivos txt alrededor de 80 megas que corresponden a Impuestos Nacionales y Provinciales. Demoraban una enormidad de tiempo en leerlo y pasarlo a una dbf. Me lo resolvió desde Nicaragua [color=#4000FF:3td7qyz0]Carlos Vargas[/color:3td7qyz0] y desde hace años lo utilizo. El proceso es rapidísimo tarda a los sumo 10 segundos en pasar el txt a dbf, utilizando visual fox pro, luego como tenía visual fox pro 9, modifique el programa que generosamente me envió (me lo envió con fuentes y dlls), sin tener mucha idea pero logre hacerlo funcionar, para rentas provincia y capital. Estoy tratando de poder hacerlo solamente con harbour El archivo sus primeros renglones son [quote:3td7qyz0]21122012;01012013;31032013;20000009637;C;S;N;6,00;4,50;00;00;AZUACA GUILLERMO 21122012;01012013;31032013;20000241254;D;S;N;6,00;4,50;00;00;RAMOS SANTIAGO JUAN 21122012;01012013;31032013;20000439771;D;S;N;6,00;4,50;00;00;MENDIZABAL,LUIS MARIA 21122012;01012013;31032013;20000561860;D;S;N;6,00;4,50;00;00;CROLERO MANLIO JUAN[/quote:3td7qyz0] Para que tengan una idea son 436536 líneas. (Y este es el mas pequeño de todos 35 megas) Lo hice con la clase txt oTxtfil := TTxtFile():New( MfILE ) lo hacía pero demoraba como 15 a 20 minutos, por eso lo deseche, hice otros intento pero con los mismos resultados Ahora estoy probando con append from lo intente pero me da error [quote:3td7qyz0]Error description: Error DBCMD/1005 Error de argumento: __DBAPP Stack Calls =========== Called from: => __DBAPP( 0 ) Called from: ../../../dbdelim.prg => __DBDELIM( 0 ) Called from: origen.prg => LEO( 717 )[/quote:3td7qyz0] El programa es así [code=fw:3td7qyz0]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #00C800;">function</span> leo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /> <br />      <span style="color: #00C800;">LOCAL</span> aStru := <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"field1"</span>     , <span style="color: #ff0000;">"C"</span>,  <span style="color: #000000;">8</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>, ; <br />                       <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"field2"</span>     , <span style="color: #ff0000;">"C"</span>,  <span style="color: #000000;">8</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>, ; <br />                       <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"field3"</span>     , <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">8</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>, ; <br />                       <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"field4"</span>     , <span style="color: #ff0000;">"C"</span>,  <span style="color: #000000;">11</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>, ;<br />                       <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"field5"</span>     , <span style="color: #ff0000;">"C"</span>,  <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>, ;<br />                       <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"field6"</span>     , <span style="color: #ff0000;">"C"</span>,  <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>, ;<br />                       <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"field7"</span>     , <span style="color: #ff0000;">"C"</span>,  <span style="color: #000000;">1</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>, ;<br />                       <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"field8"</span>     , <span style="color: #ff0000;">"C"</span>,  <span style="color: #000000;">5</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>, ;<br />                       <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"field9"</span>     , <span style="color: #ff0000;">"C"</span>,  <span style="color: #000000;">5</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>, ;<br />                       <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"field10"</span>     , <span style="color: #ff0000;">"C"</span>,  <span style="color: #000000;">2</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>, ;<br />                       <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"field11"</span>     , <span style="color: #ff0000;">"C"</span>,  <span style="color: #000000;">2</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>, ;<br />                       <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"field12"</span>, <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">35</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <br />    <br />    <br />     <span style="color: #00C800;">LOCAL</span> cFileTXT := <span style="color: #ff0000;">"padron.txt"</span> <br />     <span style="color: #00C800;">LOCAL</span> cFileDBF := <span style="color: #ff0000;">"AgenRet.dbf"</span><br /><br />      dbCreate<span style="color: #000000;">&#40;</span> cFileDBF, aStru <span style="color: #000000;">&#41;</span> <br />     USE <span style="color: #000000;">&#40;</span> cFileDBF <span style="color: #000000;">&#41;</span><br /> <br /> <br />cDefEol := SET<span style="color: #000000;">&#40;</span> _SET_EOL, chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">13</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <br />APPEND <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">&#40;</span> cFileTXT <span style="color: #000000;">&#41;</span> DELIMITED WITH <span style="color: #ff0000;">";"</span> <br />APPEND <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">&#40;</span> cFileTXT <span style="color: #000000;">&#41;</span> DELIMITED WITH <span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">","</span>,<span style="color: #ff0000;">";"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <br />SET<span style="color: #000000;">&#40;</span> _SET_EOL, cDefEol <span style="color: #000000;">&#41;</span> <br /><br />        <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:3td7qyz0] Buscando por internet encontre la última parte de código pero me da el error descripto. Gracias por su atención
copiar un archivo txt a dbf
[code=fw:1cou4z5q]<div class="fw" id="{CB}" style="font-family: monospace;"> APPEND <span style="color: #0000ff;">FROM</span> cFileCSV DELIMITED WITH <span style="color: #000000;">&#40;</span>,<span style="color: #000000;">&#41;</span></div>[/code:1cou4z5q] Regards, George
copy & paste con Xbrowse (Solucionado)
Hola amigos del foro, tengo este problema: en un recurso tengo definido un xbrowse, el cual selecciono registros, todo va bien hasta que le coloco un CRTL-C (copy) o boton derecho al mouse para que muestre el menu y el sistema me arroja un lindo GPF... que me faltará para solucionar esto??? este es el código [code=fw:20eslvqp]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />            <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">ID</span> <span style="color: #000000;">101</span> <span style="color: #0000ff;">OF</span> oFld:<span style="color: #000000;">aDialogs</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> COLUMNS <span style="color: #ff0000;">"CODE"</span>,<span style="color: #ff0000;">"SIGL"</span>,<span style="color: #ff0000;">"USER"</span>,<span style="color: #ff0000;">"NOMB"</span>,<span style="color: #ff0000;">"CONE"</span> ;<br />                         <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"PA01"</span> AUTOSORT FOOTERS BACKGROUND aColor <span style="color: #0000ff;">HORIZONTAL</span><br /><br />                     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;">cHeader</span>     := <span style="color: #ff0000;">'Centro'</span><br />                     oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cHeader</span>     := <span style="color: #ff0000;">'Sigla'</span><br />                     oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cHeader</span>     := <span style="color: #ff0000;">'Usuario'</span><br />                     oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cFooter</span>     := <span style="color: #ff0000;">'Total : '</span>+TRANSFORM<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">nLen</span>,<span style="color: #ff0000;">"@E 9,999"</span> <span style="color: #000000;">&#41;</span><br />                     oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cHeader</span>     := <span style="color: #ff0000;">'Nombre completo'</span><br />                     oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nWidth</span>      := <span style="color: #000000;">340</span><br />                     oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cHeader</span>     := <span style="color: #ff0000;">'Conect'</span><br />                     oBrw:<span style="color: #000000;">bRClicked</span>        := <span style="color: #000000;">&#123;</span> | nRow, nCol | ShowPopup<span style="color: #000000;">&#40;</span> nRow, nCol, oBrw <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />                     oBrw:<span style="color: #000000;">nMarqueeStyle</span>    := <span style="color: #000000;">6</span><br />                     oBrw:<span style="color: #000000;">nHeaderLines</span>     := <span style="color: #000000;">2</span><br />                     oBrw:<span style="color: #000000;">nFooterLines</span>     := <span style="color: #000000;">2</span><br />                     oBrw:<span style="color: #000000;">nDataLines</span>       := <span style="color: #000000;">1</span><br />                     oBrw:<span style="color: #000000;">lVScroll</span>         := .T.<br />                     oBrw:<span style="color: #000000;">Conect</span>:<span style="color: #000000;">SetCheck</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />                     oBrw:<span style="color: #000000;">l2007</span>    := .T.<br /><br /><span style="color: #B900B9;">//-------------------------------------------------------------------------</span><br /><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> ShowPopup<span style="color: #000000;">&#40;</span> nRow, nCol, oBrw <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">LOCAL</span> oPopup<br /><br />   <span style="color: #0000ff;">MENU</span> oPopup <span style="color: #0000ff;">POPUP</span> <span style="color: #000000;">2007</span><br />      <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Copiar..."</span> <span style="color: #0000ff;">ACTION</span> oBrw:<span style="color: #000000;">Copy</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>        <== aqui se me produce el GPF<br />   <span style="color: #0000ff;">ENDMENU</span><br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">POPUP</span> oPopup <span style="color: #0000ff;">OF</span> oBrw <span style="color: #00C800;">AT</span> nRow, nCol<br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">Nil</span><br /><br /><span style="color: #B900B9;">//-------------------------------------------------------------------------</span><br /><br /> </div>[/code:20eslvqp] saludos
copy & paste con Xbrowse (Solucionado)
Saludos Por favor puedes colocar un ejemplo que podamos construir para reproducir el error.... Gracias
copy & paste con Xbrowse (Solucionado)
bueno: era solo enlazar las lib correctas al contruir el ejecutable. me faltaba xharbour/lib/vm.lib, lang.lib, pp.lib y colocar un parametro /v en el ilink32.exe del bcc ahora funciona perfecto saludos
copy a portion of picture
I f i have a picture on a window or dialog How I can take with the mouse a box ( dotted) and zoom it and print only that portion of that image ?
copy a portion of picture
Hello Silvio, I think, a solution could be, to use sliders around the dialog with the image. with that, You could define the Top-, Left-, Bottom-, Right-Position of the Imagepart. The Slider-position will define the borders of the Image-area, You want to save. In one of my new tools, I use this solution, to create Gradient-Images. I can resize and save the new Image. For this function, I only have to define Bottom- and Right-Position. [img:24x2eidn]http&#58;//www&#46;pflegeplus&#46;com/pictures/resize7&#46;jpg[/img:24x2eidn] Regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
copy a portion of picture
Uwe, from Otto google sample : [code=fw:2jbke15o]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">Function</span> Mappa_google<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, oActiveX<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cStreet := PadR<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"SAN MARINO"</span>, <span style="color: #000000;">80</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cCity := PadR<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"TERAMO"</span>, <span style="color: #000000;">80</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cCountry := PadR<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ITALY"</span>, <span style="color: #000000;">80</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"MAPPA"</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> ACTIVEX oActiveX <span style="color: #0000ff;">ID</span> <span style="color: #000000;">100</span> <span style="color: #0000ff;">OF</span> oDlg PROGID <span style="color: #ff0000;">"Shell.Explorer"</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> cStreet <span style="color: #0000ff;">ID</span> <span style="color: #000000;">200</span> <span style="color: #0000ff;">OF</span> oDlg<br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> cCity <span style="color: #0000ff;">ID</span> <span style="color: #000000;">300</span> <span style="color: #0000ff;">OF</span> oDlg<br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> cCountry <span style="color: #0000ff;">ID</span> <span style="color: #000000;">400</span> <span style="color: #0000ff;">OF</span> oDlg<br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">1</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> Show<span style="color: #000000;">&#40;</span> cStreet, cCity, cCountry, oActiveX <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> Show<span style="color: #000000;">&#40;</span> cStreet, cCity, cCountry, oActiveX <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> Show<span style="color: #000000;">&#40;</span> cStreet, cCity, cCountry, oActiveX <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cHtml := MemoRead<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">".<span style="color: #000000;">\M</span>APPE<span style="color: #000000;">\g</span>map.html"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;cHtml = StrTran<span style="color: #000000;">&#40;</span> cHtml, <span style="color: #ff0000;">"<<STREET>>"</span>, AllTrim<span style="color: #000000;">&#40;</span> cStreet <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;cHtml = StrTran<span style="color: #000000;">&#40;</span> cHtml, <span style="color: #ff0000;">"<<CITY>>"</span>, AllTrim<span style="color: #000000;">&#40;</span> cCity <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;cHtml = StrTran<span style="color: #000000;">&#40;</span> cHtml, <span style="color: #ff0000;">"<<COUNTRY>>"</span>, AllTrim<span style="color: #000000;">&#40;</span> cCountry <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;MemoWrit<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"temp.html"</span>, cHtml <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oActiveX&#<span style="color: #000000;">058</span>;Do<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Navigate2"</span>, CurDrive<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">":<span style="color: #000000;">\"</span> + CurDir() + "</span>\temp.html<span style="color: #ff0000;">" )<br />return nil</span></div>[/code:2jbke15o] I wanted save with the mouse a box of this image to print it it is possible ?
copy a record to another xbrowse
I have a xbrowse with :SetMultiSelectCol() the xbrowse is made with and array adata of 31 fields I want to copy a record by clicking on the :SetMultiSelectCol() checkbox and copy it to another xbrowse having the same configuration how can i proceed
copy a row of xbrowse
can I copy a row on a xbrowse and paste su another with same structure ?
copy a row of xbrowse
For this, define your browse and [code=fw:3v26xzfl]<div class="fw" id="{CB}" style="font-family: monospace;">oBrw:<span style="color: #000000;">nEditTypes</span> := EDIT_GET<br />oBrw:<span style="color: #000000;">lCanPaste</span> := .t.<br />oBrw:<span style="color: #000000;">nMarqStyle</span> := MARQSTYLE_HIGHLROWRC <span style="color: #B900B9;">// or higher</span></div>[/code:3v26xzfl] Then go to the row you want to copy Press ^C Go to the row you want to paste Go to the first column of the row // this is important and then Press ^V Done.
copy a row of xbrowse
Can i make It with a menu popup into xbrowse? Wich are the commands
copy a row of xbrowse
METHOD-3: USING DRAG AND DROP Sample: [code=fw:h753rxs3]<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> oDlg, oBar, oBrw, oFont, oCur<br /><br />&nbsp; &nbsp;USE CUSTOMER SHARED VIA <span style="color: #ff0000;">"DBFCDX"</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">CURSOR</span> oCur DRAG<br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">600</span>,<span style="color: #000000;">400</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL <span style="color: #0000ff;">FONT</span> oFont RESIZABLE<br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">50</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-20</span>,<span style="color: #000000;">-20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; DATASOURCE <span style="color: #ff0000;">"CUSTOMER"</span> <span style="color: #0000ff;">AUTOCOLS</span> CELL LINES NOBORDER<br /><br />&nbsp; &nbsp;WITH OBJECT oBrw<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nEditTypes</span> &nbsp; &nbsp;:= EDIT_GET<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">oDragCursor</span> &nbsp; := oCur<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bDragBegin</span> &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> |r,c,f| SetDropInfo<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">Values</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bDropOver</span> &nbsp; &nbsp; := < |u,r,c,f|<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">SetPos</span><span style="color: #000000;">&#40;</span> r, c, .t. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">Lock</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">Values</span> := u<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">Unlock</span><span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">RefreshCurrent</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;END<br /><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:h753rxs3]
copy a row of xbrowse
METHOD-1: Using ClipBoard -------------------------------- To copy the current row to ClipBoard [code=fw:2lsidh3v]<div class="fw" id="{CB}" style="font-family: monospace;">oBrw:<span style="color: #000000;">Copy</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></div>[/code:2lsidh3v] To Paste full row from ClipBoard [code=fw:2lsidh3v]<div class="fw" id="{CB}" style="font-family: monospace;">oBrw:<span style="color: #000000;">GoLeftMost</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />oBrw:<span style="color: #000000;">Paste</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></div>[/code:2lsidh3v] METHOD-2: Without using ClipBoard: ----------------------------------------- To copy the current row to to memory [code=fw:2lsidh3v]<div class="fw" id="{CB}" style="font-family: monospace;">aCopy := oBrw:<span style="color: #000000;">Values</span></div>[/code:2lsidh3v] To Paste full row from memory [code=fw:2lsidh3v]<div class="fw" id="{CB}" style="font-family: monospace;">oBrw:<span style="color: #000000;">Lock</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />oBrw:<span style="color: #000000;">Values</span> := aCopy<br />oBrw:<span style="color: #000000;">Unlock</span><span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span></div>[/code:2lsidh3v]
copy a row of xbrowse
METHOD-1 Sample [code=fw:3qxelkze]<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> oDlg, oBar, oBrw, oFont, nCol<br /><br />&nbsp; &nbsp;USE CUSTOMER SHARED<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">600</span>,<span style="color: #000000;">400</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL <span style="color: #0000ff;">FONT</span> oFont<br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTONBAR</span> oBar <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>,<span style="color: #000000;">32</span> <span style="color: #000000;">2010</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">50</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-20</span>,<span style="color: #000000;">-20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; DATASOURCE <span style="color: #ff0000;">"CUSTOMER"</span> <span style="color: #0000ff;">AUTOCOLS</span> LINES NOBORDER<br /><br />&nbsp; &nbsp;WITH OBJECT oBrw<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nEditTypes</span> &nbsp; &nbsp;:= EDIT_GET<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">lCanPaste</span> &nbsp; &nbsp; := .t.<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLROW<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bClrRowFocus</span> &nbsp;:= <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">230</span>,<span style="color: #000000;">230</span>,<span style="color: #000000;">230</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bClrSelFocus</span> &nbsp;:= <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_WHITE, CLR_BLUE <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">AddVar</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"LCOPIED"</span>, .f. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bPopUp</span> &nbsp; &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> |oCol| PopMenu<span style="color: #000000;">&#40;</span> oCol <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;END<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Copy"</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> ;<br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">Copy</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">lCopied</span> := .t., oBar:<span style="color: #000000;">AEvalWhen</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">SetFocus</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;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Paste"</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> ;<br />&nbsp; &nbsp; &nbsp; nCol := oBrw:<span style="color: #000000;">nColSel</span>, ;<br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">GoLeftMost</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">Paste</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">lCopied</span> := .f., ;<br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">nColSel</span> := nCol, ;<br />&nbsp; &nbsp; &nbsp; oBar:<span style="color: #000000;">AEvalWhen</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">WHEN</span> oBrw:<span style="color: #000000;">lCopied</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> PopMenu<span style="color: #000000;">&#40;</span> oCol <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oBrw &nbsp;:= oCol:<span style="color: #000000;">oBrw</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nCol<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oPop<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">MENU</span> oPop <span style="color: #0000ff;">POPUP</span> <span style="color: #000000;">2010</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Copy"</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">Copy</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">lCopied</span> := .t., ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBrw:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oBar</span>:<span style="color: #000000;">AEvalWhen</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Paste"</span> <span style="color: #0000ff;">WHEN</span> oBrw:<span style="color: #000000;">lCopied</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nCol := oBrw:<span style="color: #000000;">nColSel</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBrw:<span style="color: #000000;">GoLeftMost</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">Paste</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">nColSel</span> := nCol, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBrw:<span style="color: #000000;">lCopied</span> := .f., ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oBrw:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oBar</span>:<span style="color: #000000;">AEvalWhen</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">SetFocus</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;">ENDMENU</span><br /><br /><span style="color: #00C800;">return</span> oPop<br />&nbsp;</div>[/code:3qxelkze]
copy a row of xbrowse
METHOD-2 Sample: [code=fw:it5dpmi3]<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> oDlg, oBar, oBrw, oFont, nCol<br /><br />&nbsp; &nbsp;USE CUSTOMER SHARED VIA <span style="color: #ff0000;">"DBFCDX"</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">600</span>,<span style="color: #000000;">400</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL <span style="color: #0000ff;">FONT</span> oFont<br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTONBAR</span> oBar <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>,<span style="color: #000000;">32</span> <span style="color: #000000;">2010</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">50</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-20</span>,<span style="color: #000000;">-20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; DATASOURCE <span style="color: #ff0000;">"CUSTOMER"</span> <span style="color: #0000ff;">AUTOCOLS</span> LINES NOBORDER<br /><br />&nbsp; &nbsp;WITH OBJECT oBrw<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nEditTypes</span> &nbsp; &nbsp;:= EDIT_GET<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">lCanPaste</span> &nbsp; &nbsp; := .t.<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLROW<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bClrRowFocus</span> &nbsp;:= <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">230</span>,<span style="color: #000000;">230</span>,<span style="color: #000000;">230</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bClrSelFocus</span> &nbsp;:= <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_WHITE, CLR_BLUE <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">AddVar</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ACOPY"</span>, <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bPopUp</span> &nbsp; &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> |oCol| PopMenu<span style="color: #000000;">&#40;</span> oCol <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;END<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Copy"</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> ;<br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">aCopy</span> := oBrw:<span style="color: #000000;">Values</span>, oBar:<span style="color: #000000;">AEvalWhen</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">SetFocus</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;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Paste"</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> ;<br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">Lock</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">Values</span> := oBrw:<span style="color: #000000;">aCopy</span>, oBrw:<span style="color: #000000;">Unlock</span><span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">aCopy</span> := <span style="color: #00C800;">nil</span>, ;<br />&nbsp; &nbsp; &nbsp; oBar:<span style="color: #000000;">AEvalWhen</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">RefreshCurrent</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">WHEN</span> !Empty<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aCopy</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> PopMenu<span style="color: #000000;">&#40;</span> oCol <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oBrw &nbsp;:= oCol:<span style="color: #000000;">oBrw</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nCol<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oPop<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">MENU</span> oPop <span style="color: #0000ff;">POPUP</span> <span style="color: #000000;">2010</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Copy"</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> ;<br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">aCopy</span> := oBrw:<span style="color: #000000;">Values</span>, oBrw:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oBar</span>:<span style="color: #000000;">AEvalWhen</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Paste"</span> <span style="color: #0000ff;">WHEN</span> !Empty<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aCopy</span> <span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> ;<br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">Lock</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">Values</span> := oBrw:<span style="color: #000000;">aCopy</span>, oBrw:<span style="color: #000000;">Unlock</span><span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">aCopy</span> := <span style="color: #00C800;">nil</span>, ;<br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">oBar</span>:<span style="color: #000000;">AEvalWhen</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">RefreshCurrent</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ENDMENU</span><br /><br /><span style="color: #00C800;">return</span> oPop<br />&nbsp;</div>[/code:it5dpmi3]
copy a row of xbrowse
[quote="nageswaragunupudi":33okjla6]METHOD-3: USING DRAG AND DROP Sample: [code=fw:33okjla6]<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 />   <span style="color: #00C800;">local</span> oDlg, oBar, oBrw, oFont, oCur<br /><br />   USE CUSTOMER SHARED VIA <span style="color: #ff0000;">"DBFCDX"</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">CURSOR</span> oCur DRAG<br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">600</span>,<span style="color: #000000;">400</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL <span style="color: #0000ff;">FONT</span> oFont RESIZABLE<br /><br />   @ <span style="color: #000000;">50</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-20</span>,<span style="color: #000000;">-20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />      DATASOURCE <span style="color: #ff0000;">"CUSTOMER"</span> <span style="color: #0000ff;">AUTOCOLS</span> CELL LINES NOBORDER<br /><br />   WITH OBJECT oBrw<br />      :<span style="color: #000000;">nEditTypes</span>    := EDIT_GET<br />      :<span style="color: #000000;">oDragCursor</span>   := oCur<br />      :<span style="color: #000000;">bDragBegin</span>    := <span style="color: #000000;">&#123;</span> |r,c,f| SetDropInfo<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">Values</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />      :<span style="color: #000000;">bDropOver</span>     := < |u,r,c,f|<br />                          oBrw:<span style="color: #000000;">SetPos</span><span style="color: #000000;">&#40;</span> r, c, .t. <span style="color: #000000;">&#41;</span><br />                          oBrw:<span style="color: #000000;">Lock</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />                          oBrw:<span style="color: #000000;">Values</span> := u<br />                          oBrw:<span style="color: #000000;">Unlock</span><span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span><br />                          oBrw:<span style="color: #000000;">RefreshCurrent</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />                          <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />                          ><br />      <span style="color: #B900B9;">//</span><br />      :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   END<br /><br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br />   <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:33okjla6][/quote:33okjla6] Thanks Rao but on my proocedure I have an array with multiselect I have an array that has a "CodCep" field that is not displayed in xbrowse [img:33okjla6]https&#58;//i&#46;postimg&#46;cc/nL5KYG7k/uu&#46;png[/img:33okjla6] [code=fw:33okjla6]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><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;Test<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"00001"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;Test<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"00002"</span><span style="color: #000000;">&#41;</span><br />&nbsp;retur <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> Test<span style="color: #000000;">&#40;</span>codcep<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, oBar, oBrw, oFont<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aData:= <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">//adata demo</span><br />&nbsp; &nbsp; &nbsp; aAdd<span style="color: #000000;">&#40;</span> aData, <span style="color: #000000;">&#123;</span>codcep, <span style="color: #000000;">1.5</span>,<span style="color: #000000;">11</span>,<span style="color: #000000;">9</span>,<span style="color: #000000;">2</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; aAdd<span style="color: #000000;">&#40;</span> aData, <span style="color: #000000;">&#123;</span>codcep, <span style="color: #000000;">5.5</span>,<span style="color: #000000;">5</span>,<span style="color: #000000;">5</span>,<span style="color: #000000;">2.5</span>,<span style="color: #000000;">0.8</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; aAdd<span style="color: #000000;">&#40;</span> aData, <span style="color: #000000;">&#123;</span>codcep, <span style="color: #000000;">6.3</span>,<span style="color: #000000;">8</span>,<span style="color: #000000;">5</span>,<span style="color: #000000;">0.8</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">600</span>,<span style="color: #000000;">400</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL <span style="color: #0000ff;">FONT</span> oFont RESIZABLE<br /><br />&nbsp; &nbsp;@<span style="color: #000000;">10</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">say</span> <span style="color: #ff0000;">"Computo:"</span> +CodCep &nbsp;<span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">120</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; @ <span style="color: #000000;">50</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; COLUMNS &nbsp;<span style="color: #000000;">2</span>,<span style="color: #000000;">3</span>,<span style="color: #000000;">4</span>,<span style="color: #000000;">5</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HEADERS <span style="color: #ff0000;">"Riga"</span>,<span style="color: #ff0000;">"Colonna"</span>,<span style="color: #ff0000;">"Larghezza"</span>,<span style="color: #ff0000;">"Altezza"</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; COLSIZES <span style="color: #000000;">60</span>,<span style="color: #000000;">60</span>,<span style="color: #000000;">60</span>,<span style="color: #000000;">60</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ARRAY aData &nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-20</span>,<span style="color: #000000;">-20</span> <span style="color: #0000ff;">PIXEL</span> &nbsp; <span style="color: #0000ff;">STYLE</span> FLAT NOBORDER<br /><br /><br /><br />&nbsp; &nbsp;WITH OBJECT oBrw<br />&nbsp; &nbsp; &nbsp; &nbsp;:<span style="color: #000000;">SetMultiSelectCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:<span style="color: #000000;">lRecordSelector</span> &nbsp; &nbsp; := .t.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:<span style="color: #000000;">bRecSelHeader</span> &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> || <span style="color: #ff0000;">" Num. "</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:<span style="color: #000000;">bRecSelData</span> &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> |o| Int<span style="color: #000000;">&#40;</span> o:<span style="color: #000000;">BookMark</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:<span style="color: #000000;">nRecSelWidth</span> &nbsp; &nbsp; := <span style="color: #ff0000;">"999"</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nEditTypes</span> &nbsp; &nbsp;:= EDIT_GET<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">lCanPaste</span> &nbsp; &nbsp; := .t.<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLROW<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bClrRowFocus</span> &nbsp;:= <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">230</span>,<span style="color: #000000;">230</span>,<span style="color: #000000;">230</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bClrSelFocus</span> &nbsp;:= <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_WHITE, CLR_BLUE <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">AddVar</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ACOPY"</span>, <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bPopUp</span> &nbsp; &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> |oCol| PopMenu<span style="color: #000000;">&#40;</span> oCol <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;END<br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><span style="color: #00C800;">function</span> PopMenu<span style="color: #000000;">&#40;</span> oCol <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oBrw &nbsp;:= oCol:<span style="color: #000000;">oBrw</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nCol<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oPop<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">MENU</span> oPop <span style="color: #0000ff;">POPUP</span> <span style="color: #000000;">2010</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Copy"</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> ;<br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">aCopy</span> := oBrw:<span style="color: #000000;">Values</span>, ;<br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Paste"</span> <span style="color: #0000ff;">WHEN</span> !Empty<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aCopy</span> <span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> ;<br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">Lock</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">Values</span> := oBrw:<span style="color: #000000;">aCopy</span>, oBrw:<span style="color: #000000;">Unlock</span><span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">aCopy</span> := <span style="color: #00C800;">nil</span>, ;<br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">RefreshCurrent</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">SetFocus</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;">ENDMENU</span><br /><br /><span style="color: #00C800;">return</span> oPop<br /><br />&nbsp;</div>[/code:33okjla6] the user open a dialog sample Test("00001") when the user click on Multiselect one record or more records the procedure must show the menu (copy/paste) then the use close the dialog and open another with another codcep Test("00002") and can paste the record or the records copied ( "00001") and create new record or new records but it must change the field codcep into new codcep ( "00002") how I can make ?
copy a row of xbrowse
Silvio, Interesting, I just worked on the same problem in mod harbour. Actually, the solution is exactly the same as with Fivewin. You copy the row as an array (object) and insert it in the 2nd browser. Although it is not welcome here, I post. I think we all have to prepare for the future, and the future is on the web. Unless we only have 6 months left until retirement. But you should not be selfish either. Many of us want to stay in the market for longer. Best regards, Otto BTW, do you know the FIVEWIN functions for mod harbour? For example: MH_ArrayToHTML() , H_ValToHTML( ) from Mr. RAo? Similar to xbrowser. [img:iyzhne90]https&#58;//mybergland&#46;com/fwforum/dragkopy2&#46;gif[/img:iyzhne90]
copy a row of xbrowse
[quote="Otto":1e7safkd]Silvio, Interesting, I just worked on the same problem in mod harbour. Actually, the solution is exactly the same as with Fivewin. You copy the row as an array (object) and insert it in the 2nd browser. Although it is not welcome here, I post. I think we all have to prepare for the future, and the future is on the web. Unless we only have 6 months left until retirement. But you should not be selfish either. Many of us want to stay in the market for longer. Best regards, Otto BTW, do you know the FIVEWIN functions for mod harbour? For example: MH_ArrayToHTML() , H_ValToHTML( ) from Mr. RAo? Similar to xbrowser. [img:1e7safkd]https&#58;//mybergland&#46;com/fwforum/dragkopy&#46;gif[/img:1e7safkd][/quote:1e7safkd] Not web!!! I ask a questioni ti nages please
copy a row of xbrowse
do not use oBrw:aCopy Keep a variable aCopy For copying [code=fw:3u11fth7]<div class="fw" id="{CB}" style="font-family: monospace;">aCopy := oBrw:<span style="color: #000000;">aRow</span></div>[/code:3u11fth7] For pasting [code=fw:3u11fth7]<div class="fw" id="{CB}" style="font-family: monospace;">aCopy<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> := codsep<br />oBrw:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">&#91;</span> oBrw:<span style="color: #000000;">nArrayAt</span> <span style="color: #000000;">&#93;</span> := aCopy</div>[/code:3u11fth7]
copy a row of xbrowse
[quote="nageswaragunupudi":1mtxs8x9]do not use oBrw:aCopy Keep a variable aCopy For copying [code=fw:1mtxs8x9]<div class="fw" id="{CB}" style="font-family: monospace;">aCopy := oBrw:<span style="color: #000000;">aRow</span></div>[/code:1mtxs8x9] For pasting [code=fw:1mtxs8x9]<div class="fw" id="{CB}" style="font-family: monospace;">aCopy<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> := codsep<br />oBrw:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">&#91;</span> oBrw:<span style="color: #000000;">nArrayAt</span> <span style="color: #000000;">&#93;</span> := aCopy</div>[/code:1mtxs8x9][/quote:1mtxs8x9] Sorry, I'am not understading where i must inserti these Lines on my test (up) Thanks
copy a row of xbrowse
Nages I go to the first xbrowse I show the popup menu there are two options "Copy" and "Paste" but the second option should not be displayed because the record has not yet been saved in the acopy variable I copy a record from the first xbrowse with the "copy" option I go to the second xbrowse I paste when I view the popup menu the "copy" option is always disabled while it should be re-enabled after copying [code=fw:33j6iic7]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /> <span style="color: #00C800;">static</span> aCopy<br /><br /><span style="color: #00C800;">Function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   Test<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"00001"</span><span style="color: #000000;">&#41;</span><br />   Test<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"00002"</span><span style="color: #000000;">&#41;</span><br /> retur <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> Test<span style="color: #000000;">&#40;</span>codcep<span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> oDlg, oBar, oBrw, oFont<br />   <span style="color: #00C800;">local</span> aData:= <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><br />   <span style="color: #B900B9;">//adata demo</span><br />      aAdd<span style="color: #000000;">&#40;</span> aData, <span style="color: #000000;">&#123;</span>codcep, <span style="color: #000000;">1.5</span>,<span style="color: #000000;">11</span>,<span style="color: #000000;">9</span>,<span style="color: #000000;">2</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />      aAdd<span style="color: #000000;">&#40;</span> aData, <span style="color: #000000;">&#123;</span>codcep, <span style="color: #000000;">5.5</span>,<span style="color: #000000;">5</span>,<span style="color: #000000;">5</span>,<span style="color: #000000;">2.5</span>,<span style="color: #000000;">0.8</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />      aAdd<span style="color: #000000;">&#40;</span> aData, <span style="color: #000000;">&#123;</span>codcep, <span style="color: #000000;">6.3</span>,<span style="color: #000000;">8</span>,<span style="color: #000000;">5</span>,<span style="color: #000000;">0.8</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">600</span>,<span style="color: #000000;">400</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL <span style="color: #0000ff;">FONT</span> oFont RESIZABLE<br /><br />   @<span style="color: #000000;">10</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">say</span> <span style="color: #ff0000;">"Computo:"</span> +CodCep  <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">120</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br />        @ <span style="color: #000000;">50</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oDlg ;<br />              COLUMNS  <span style="color: #000000;">2</span>,<span style="color: #000000;">3</span>,<span style="color: #000000;">4</span>,<span style="color: #000000;">5</span>;<br />              HEADERS <span style="color: #ff0000;">"Riga"</span>,<span style="color: #ff0000;">"Colonna"</span>,<span style="color: #ff0000;">"Larghezza"</span>,<span style="color: #ff0000;">"Altezza"</span> ;<br />              COLSIZES <span style="color: #000000;">60</span>,<span style="color: #000000;">60</span>,<span style="color: #000000;">60</span>,<span style="color: #000000;">60</span> ;<br />              ARRAY aData     ;<br />              <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-20</span>,<span style="color: #000000;">-20</span> <span style="color: #0000ff;">PIXEL</span>   <span style="color: #0000ff;">STYLE</span> FLAT NOBORDER<br /><br /><br /><br />   WITH OBJECT oBrw<br />      :<span style="color: #000000;">SetMultiSelectCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />               :<span style="color: #000000;">lRecordSelector</span>     := .t.<br />               :<span style="color: #000000;">bRecSelHeader</span>    := <span style="color: #000000;">&#123;</span> || <span style="color: #ff0000;">" Num. "</span> <span style="color: #000000;">&#125;</span><br />               :<span style="color: #000000;">bRecSelData</span>      := <span style="color: #000000;">&#123;</span> |o| Int<span style="color: #000000;">&#40;</span> o:<span style="color: #000000;">BookMark</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />               :<span style="color: #000000;">nRecSelWidth</span>     := <span style="color: #ff0000;">"999"</span><br /><br />      :<span style="color: #000000;">nEditTypes</span>    := EDIT_GET<br />      :<span style="color: #000000;">lCanPaste</span>     := .t.<br />      :<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLROW<br />      :<span style="color: #000000;">bClrRowFocus</span>  := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">230</span>,<span style="color: #000000;">230</span>,<span style="color: #000000;">230</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</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_WHITE, CLR_BLUE <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br /><br />      :<span style="color: #000000;">bPopUp</span>        := <span style="color: #000000;">&#123;</span> |oCol| PopMenu<span style="color: #000000;">&#40;</span> oCol, oBrw:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">&#91;</span> oBrw:<span style="color: #000000;">nArrayAt</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;">&#125;</span><br />      <span style="color: #B900B9;">//</span><br />      :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   END<br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br />   <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br />   <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><span style="color: #00C800;">function</span> PopMenu<span style="color: #000000;">&#40;</span> oCol, codsep <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oBrw  := oCol:<span style="color: #000000;">oBrw</span><br />   <span style="color: #00C800;">local</span> nCol<br />   <span style="color: #00C800;">local</span> oPop<br /><br /><span style="color: #0000ff;">MENU</span> oPop <span style="color: #0000ff;">POPUP</span> <span style="color: #000000;">2010</span><br />      <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Copy"</span> <span style="color: #0000ff;">WHEN</span> acopy=<span style="color: #00C800;">NIL</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> aCopy := oBrw:<span style="color: #000000;">aRow</span>,;<br />      oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Paste"</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> ;<br />      oBrw:<span style="color: #000000;">Lock</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, ;<br />      aCopy<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> := codsep ,;<br />      aadd<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aArrayData</span>,aCopy <span style="color: #000000;">&#41;</span>,; <span style="color: #B900B9;">// oBrw:aArrayData[ oBrw:nArrayAt ] := aCopy ,;</span><br />      oBrw:<span style="color: #000000;">Unlock</span><span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span>, ;<br />      oBrw:<span style="color: #000000;">RefreshCurrent</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,aCopy:= <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span>, oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">ENDMENU</span><br /><br />   <span style="color: #00C800;">return</span> oPop<br /><br /><br /> </div>[/code:33j6iic7] [img:33j6iic7]https&#58;//i&#46;postimg&#46;cc/R0YV9Xff/fff&#46;gif[/img:33j6iic7]
copy a row of xbrowse
[img:2j3xx4zo]https&#58;//i&#46;postimg&#46;cc/R0YV9Xff/fff&#46;gif[/img:2j3xx4zo] when I copied to the second xbrowse it should enable the "copy" menuitem and disable the "paste" menuitem and give the possibility to copy another line and repeat the operations instead the copy command is disabled and "paste" is always active
copy a row of xbrowse
Silvio, try this: [code=fw:3bgak0je]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Paste"</span> <span style="color: #0000ff;">WHEN</span> acopy!=<span style="color: #00C800;">NIL</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">Lock</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aCopy<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> := codsep ,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aadd<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aArrayData</span>,aCopy <span style="color: #000000;">&#41;</span>,; <span style="color: #B900B9;">// oBrw:aArrayData[ oBrw:nArrayAt ] := aCopy ,;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">Unlock</span><span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">RefreshCurrent</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, acopy:=<span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>[/code:3bgak0je]
copy a row of xbrowse
[quote="Otto":1jvwuxqp]Silvio, try this: [code=fw:1jvwuxqp]<div class="fw" id="{CB}" style="font-family: monospace;">  <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Paste"</span> <span style="color: #0000ff;">WHEN</span> acopy!=<span style="color: #00C800;">NIL</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> ;<br />          oBrw:<span style="color: #000000;">Lock</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, ;<br />          aCopy<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> := codsep ,;<br />          aadd<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aArrayData</span>,aCopy <span style="color: #000000;">&#41;</span>,; <span style="color: #B900B9;">// oBrw:aArrayData[ oBrw:nArrayAt ] := aCopy ,;</span><br />          oBrw:<span style="color: #000000;">Unlock</span><span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span>, ;<br />          oBrw:<span style="color: #000000;">RefreshCurrent</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, acopy:=<span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span><br />         </div>[/code:1jvwuxqp][/quote:1jvwuxqp] it is the same please see the video
copy a row of xbrowse
Silvio, which video?
copy a row of xbrowse
perhaps I found the error [code=fw:2wbk94l6]<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;">static</span> aCopy<br /><br /><span style="color: #00C800;">Function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   Test<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"00001"</span><span style="color: #000000;">&#41;</span><br />   Test<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"00002"</span><span style="color: #000000;">&#41;</span><br /> retur <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> Test<span style="color: #000000;">&#40;</span>codcep<span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> oDlg, oBar, oBrw, oFont<br />   <span style="color: #00C800;">local</span> aData:= <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><br />   <span style="color: #B900B9;">//adata demo</span><br />      aAdd<span style="color: #000000;">&#40;</span> aData, <span style="color: #000000;">&#123;</span>codcep, <span style="color: #000000;">1.5</span>,<span style="color: #000000;">11</span>,<span style="color: #000000;">9</span>,<span style="color: #000000;">2</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />      aAdd<span style="color: #000000;">&#40;</span> aData, <span style="color: #000000;">&#123;</span>codcep, <span style="color: #000000;">5.5</span>,<span style="color: #000000;">5.5</span>,<span style="color: #000000;">2.5</span>,<span style="color: #000000;">0.8</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />      aAdd<span style="color: #000000;">&#40;</span> aData, <span style="color: #000000;">&#123;</span>codcep, <span style="color: #000000;">6.3</span>,<span style="color: #000000;">8</span>,<span style="color: #000000;">5</span>,<span style="color: #000000;">0.8</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">600</span>,<span style="color: #000000;">400</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL <span style="color: #0000ff;">FONT</span> oFont RESIZABLE<br /><br />   @<span style="color: #000000;">10</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">say</span> <span style="color: #ff0000;">"Computo:"</span> +CodCep  <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">120</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br />        @ <span style="color: #000000;">50</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oDlg ;<br />              COLUMNS  <span style="color: #000000;">2</span>,<span style="color: #000000;">3</span>,<span style="color: #000000;">4</span>,<span style="color: #000000;">5</span>;<br />              HEADERS <span style="color: #ff0000;">"Riga"</span>,<span style="color: #ff0000;">"Colonna"</span>,<span style="color: #ff0000;">"Larghezza"</span>,<span style="color: #ff0000;">"Altezza"</span> ;<br />              COLSIZES <span style="color: #000000;">60</span>,<span style="color: #000000;">60</span>,<span style="color: #000000;">60</span>,<span style="color: #000000;">60</span> ;<br />              ARRAY aData     ;<br />              <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-20</span>,<span style="color: #000000;">-20</span> <span style="color: #0000ff;">PIXEL</span>   <span style="color: #0000ff;">STYLE</span> FLAT NOBORDER<br /><br /><br /><br />   WITH OBJECT oBrw<br />      :<span style="color: #000000;">SetMultiSelectCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />               :<span style="color: #000000;">lRecordSelector</span>     := .t.<br />               :<span style="color: #000000;">bRecSelHeader</span>    := <span style="color: #000000;">&#123;</span> || <span style="color: #ff0000;">" Num. "</span> <span style="color: #000000;">&#125;</span><br />               :<span style="color: #000000;">bRecSelData</span>      := <span style="color: #000000;">&#123;</span> |o| Int<span style="color: #000000;">&#40;</span> o:<span style="color: #000000;">BookMark</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />               :<span style="color: #000000;">nRecSelWidth</span>     := <span style="color: #ff0000;">"999"</span><br /><br />      :<span style="color: #000000;">nEditTypes</span>    := EDIT_GET<br />      :<span style="color: #000000;">lCanPaste</span>     := .t.<br />      :<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLROW<br />      :<span style="color: #000000;">bClrRowFocus</span>  := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">230</span>,<span style="color: #000000;">230</span>,<span style="color: #000000;">230</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</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_WHITE, CLR_BLUE <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br /><br />      :<span style="color: #000000;">bPopUp</span>        := <span style="color: #000000;">&#123;</span> |oCol| PopMenu<span style="color: #000000;">&#40;</span> oCol, oBrw:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">&#91;</span> oBrw:<span style="color: #000000;">nArrayAt</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;">&#125;</span><br />      <span style="color: #B900B9;">//</span><br />      :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   END<br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /><br />xbrowser aData  <span style="color: #0000ff;">TITLE</span>  <span style="color: #ff0000;">"NEW DATA"</span><br /><br />xbrowser acopy  <span style="color: #0000ff;">TITLE</span>  <span style="color: #ff0000;">"ACOPY ARRAY"</span><br /><br />   <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><span style="color: #00C800;">function</span> PopMenu<span style="color: #000000;">&#40;</span> oCol, codsep <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oBrw  := oCol:<span style="color: #000000;">oBrw</span><br />   <span style="color: #00C800;">local</span> nCol<br />   <span style="color: #00C800;">local</span> oPop<br /><br />   <span style="color: #0000ff;">MENU</span> oPop <span style="color: #0000ff;">POPUP</span> <span style="color: #000000;">2010</span><br />   <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Codsep:"</span>+codsep<br />   <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Copy"</span> <span style="color: #0000ff;">WHEN</span> acopy=<span style="color: #00C800;">NIL</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> aCopy := oBrw:<span style="color: #000000;">aRow</span>,;<br />      oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />  <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Paste"</span> <span style="color: #0000ff;">WHEN</span> acopy!=<span style="color: #00C800;">NIL</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> ;<br />      oBrw:<span style="color: #000000;">Lock</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, ;<br />      aCopy<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> := codsep ,;<br />      aadd<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aArrayData</span>, aCopy <span style="color: #000000;">&#41;</span>,;<br />      oBrw:<span style="color: #000000;">Unlock</span><span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span>, ;<br />      acopy:=<span style="color: #00C800;">NIL</span> ,;<br />      oBrw:<span style="color: #000000;">RefreshCurrent</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">ENDMENU</span><br /><br />   <span style="color: #00C800;">return</span> oPop<br /><br /><br /> </div>[/code:2wbk94l6] Now seem run ok, but only one row and if I wish copy more rows ? I tried to change aCopy := oBrw:aRow With aCopy := oBrw:aSelected but not run
copy a row of xbrowse
Silvio, try with the code I posted. Otto
copy a row of xbrowse
[quote="Otto":1uuaamof]Silvio, try with the code I posted. Otto[/quote:1uuaamof] Otto , Now run ok but copy and paste only one row I wish copy and paste more rows only oBrw:aselected [b:1uuaamof]new test[/b:1uuaamof] [code=fw:1uuaamof]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br />&nbsp;<span style="color: #00C800;">static</span> aCopy<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;Test<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"00001"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;Test<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"00002"</span><span style="color: #000000;">&#41;</span><br />&nbsp;retur <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> Test<span style="color: #000000;">&#40;</span>codcep<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, oBar, oBrw, oFont<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aData:= <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">//adata demo</span><br />&nbsp; &nbsp; &nbsp; aAdd<span style="color: #000000;">&#40;</span> aData, <span style="color: #000000;">&#123;</span>codcep, <span style="color: #000000;">1.5</span>,<span style="color: #000000;">11</span>,<span style="color: #000000;">9</span>,<span style="color: #000000;">2</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; aAdd<span style="color: #000000;">&#40;</span> aData, <span style="color: #000000;">&#123;</span>codcep, <span style="color: #000000;">5.5</span>,<span style="color: #000000;">5.5</span>,<span style="color: #000000;">2.5</span>,<span style="color: #000000;">0.8</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; aAdd<span style="color: #000000;">&#40;</span> aData, <span style="color: #000000;">&#123;</span>codcep, <span style="color: #000000;">6.3</span>,<span style="color: #000000;">8</span>,<span style="color: #000000;">5</span>,<span style="color: #000000;">0.8</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">600</span>,<span style="color: #000000;">400</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL <span style="color: #0000ff;">FONT</span> oFont RESIZABLE<br /><br />&nbsp; &nbsp;@<span style="color: #000000;">10</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">say</span> <span style="color: #ff0000;">"Computo:"</span> +CodCep &nbsp;<span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">120</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; @ <span style="color: #000000;">50</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; COLUMNS &nbsp;<span style="color: #000000;">2</span>,<span style="color: #000000;">3</span>,<span style="color: #000000;">4</span>,<span style="color: #000000;">5</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HEADERS <span style="color: #ff0000;">"Riga"</span>,<span style="color: #ff0000;">"Colonna"</span>,<span style="color: #ff0000;">"Larghezza"</span>,<span style="color: #ff0000;">"Altezza"</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; COLSIZES <span style="color: #000000;">60</span>,<span style="color: #000000;">60</span>,<span style="color: #000000;">60</span>,<span style="color: #000000;">60</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ARRAY aData &nbsp; &nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-20</span>,<span style="color: #000000;">-20</span> <span style="color: #0000ff;">PIXEL</span> &nbsp; <span style="color: #0000ff;">STYLE</span> FLAT NOBORDER<br /><br /><br /><br />&nbsp; &nbsp;WITH OBJECT oBrw<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">SetMultiSelectCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:<span style="color: #000000;">lRecordSelector</span> &nbsp; &nbsp; := .t.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:<span style="color: #000000;">bRecSelHeader</span> &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> || <span style="color: #ff0000;">" Num. "</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:<span style="color: #000000;">bRecSelData</span> &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> |o| Int<span style="color: #000000;">&#40;</span> o:<span style="color: #000000;">BookMark</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:<span style="color: #000000;">nRecSelWidth</span> &nbsp; &nbsp; := <span style="color: #ff0000;">"999"</span><br /><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nEditTypes</span> &nbsp; &nbsp;:= EDIT_GET<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">lCanPaste</span> &nbsp; &nbsp; := .t.<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLROW<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bClrRowFocus</span> &nbsp;:= <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">230</span>,<span style="color: #000000;">230</span>,<span style="color: #000000;">230</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bClrSelFocus</span> &nbsp;:= <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_WHITE, CLR_BLUE <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br /><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bPopUp</span> &nbsp; &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> |oCol| PopMenu<span style="color: #000000;">&#40;</span> oCol, oBrw:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">&#91;</span> oBrw:<span style="color: #000000;">nArrayAt</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;">&#125;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;END<br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /><br />xbrowser aData &nbsp;<span style="color: #0000ff;">TITLE</span> &nbsp;<span style="color: #ff0000;">"NEW DATA"</span><br /><br />xbrowser acopy &nbsp;<span style="color: #0000ff;">TITLE</span> &nbsp;<span style="color: #ff0000;">"ACOPY ARRAY"</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><span style="color: #00C800;">function</span> PopMenu<span style="color: #000000;">&#40;</span> oCol, codsep <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oBrw &nbsp;:= oCol:<span style="color: #000000;">oBrw</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nCol<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oPop<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">MENU</span> oPop <span style="color: #0000ff;">POPUP</span> <span style="color: #000000;">2010</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Codsep:"</span>+codsep<br />&nbsp; &nbsp; <span style="color: #0000ff;">SEPARATOR</span><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> oBrw:<span style="color: #000000;">IsSelectedRow</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Deselect the current row"</span> <span style="color: #0000ff;">action</span> <span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">SelectRow</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Deselect all"</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">action</span> <span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">SelectRow</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Select the current row"</span> &nbsp; <span style="color: #0000ff;">action</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">SelectRow</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Select All"</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">action</span> <span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">SelectRow</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">4</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 /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">SEPARATOR</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Copy"</span> <span style="color: #0000ff;">WHEN</span> acopy=<span style="color: #00C800;">NIL</span> .and. oBrw:<span style="color: #000000;">IsSelectedRow</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aCopy := oBrw:<span style="color: #000000;">aRow</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Paste"</span> <span style="color: #0000ff;">WHEN</span> acopy!=<span style="color: #00C800;">NIL</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> ;<br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">Lock</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; aCopy<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> := codsep ,;<br />&nbsp; &nbsp; &nbsp; aadd<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aArrayData</span>, aCopy <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">Unlock</span><span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; acopy:=<span style="color: #00C800;">NIL</span> ,;<br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">RefreshCurrent</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">SetFocus</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;">ENDMENU</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">return</span> oPop<br /><br /><br />&nbsp;</div>[/code:1uuaamof]
copy a row of xbrowse
You have to extend here: MENUITEM "Copy" WHEN acopy=NIL ACTION ( aCopy := oBrw:aRow,; oBrw:SetFocus() ) and here: aadd( oBrw:aArrayData,aCopy ),; // oBrw:aArrayData[ oBrw:nArrayAt ] := aCopy ,;
copy a row of xbrowse
[quote="Otto":1ir2l11v]You have to extend here: MENUITEM "Copy" WHEN acopy=NIL ACTION ( aCopy := oBrw:aRow,; oBrw:SetFocus() ) and here: aadd( oBrw:aArrayData,aCopy ),; // oBrw:aArrayData[ oBrw:nArrayAt ] := aCopy ,;[/quote:1ir2l11v] >MENUITEM "Copy" WHEN acopy=NIL ACTION ( aCopy := oBrw:aRow,; >oBrw:SetFocus() ) must be seletected to copy I wish copy the 1 and 3 row into xbrowse 2 aadd( oBrw:aArrayData,aCopy ) copy one row [b:1ir2l11v]you have also the oldest test [/b:1ir2l11v] [b:1ir2l11v]Pls this is the last[/b:1ir2l11v] [code=fw:1ir2l11v]<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;">static</span> aCopy<br /><br /><span style="color: #00C800;">Function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   Test<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"00001"</span><span style="color: #000000;">&#41;</span><br />   Test<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"00002"</span><span style="color: #000000;">&#41;</span><br /> retur <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> Test<span style="color: #000000;">&#40;</span>codcep<span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> oDlg, oBar, oBrw, oFont<br />   <span style="color: #00C800;">local</span> aData:= <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><br />   <span style="color: #B900B9;">//adata demo</span><br />      aAdd<span style="color: #000000;">&#40;</span> aData, <span style="color: #000000;">&#123;</span>codcep, <span style="color: #000000;">1.5</span>,<span style="color: #000000;">11</span>,<span style="color: #000000;">9</span>,<span style="color: #000000;">2</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />      aAdd<span style="color: #000000;">&#40;</span> aData, <span style="color: #000000;">&#123;</span>codcep, <span style="color: #000000;">5.5</span>,<span style="color: #000000;">5.5</span>,<span style="color: #000000;">2.5</span>,<span style="color: #000000;">0.8</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />      aAdd<span style="color: #000000;">&#40;</span> aData, <span style="color: #000000;">&#123;</span>codcep, <span style="color: #000000;">6.3</span>,<span style="color: #000000;">8</span>,<span style="color: #000000;">5</span>,<span style="color: #000000;">0.8</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">600</span>,<span style="color: #000000;">400</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL <span style="color: #0000ff;">FONT</span> oFont RESIZABLE<br /><br />   @<span style="color: #000000;">10</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">say</span> <span style="color: #ff0000;">"Computo:"</span> +CodCep  <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">120</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br />        @ <span style="color: #000000;">50</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oDlg ;<br />              COLUMNS  <span style="color: #000000;">2</span>,<span style="color: #000000;">3</span>,<span style="color: #000000;">4</span>,<span style="color: #000000;">5</span>;<br />              HEADERS <span style="color: #ff0000;">"Riga"</span>,<span style="color: #ff0000;">"Colonna"</span>,<span style="color: #ff0000;">"Larghezza"</span>,<span style="color: #ff0000;">"Altezza"</span> ;<br />              COLSIZES <span style="color: #000000;">60</span>,<span style="color: #000000;">60</span>,<span style="color: #000000;">60</span>,<span style="color: #000000;">60</span> ;<br />              ARRAY aData     ;<br />              <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-20</span>,<span style="color: #000000;">-20</span> <span style="color: #0000ff;">PIXEL</span>   <span style="color: #0000ff;">STYLE</span> FLAT NOBORDER<br /><br /><br /><br />   WITH OBJECT oBrw<br />      :<span style="color: #000000;">SetMultiSelectCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />               :<span style="color: #000000;">lRecordSelector</span>     := .t.<br />               :<span style="color: #000000;">bRecSelHeader</span>    := <span style="color: #000000;">&#123;</span> || <span style="color: #ff0000;">" Num. "</span> <span style="color: #000000;">&#125;</span><br />               :<span style="color: #000000;">bRecSelData</span>      := <span style="color: #000000;">&#123;</span> |o| Int<span style="color: #000000;">&#40;</span> o:<span style="color: #000000;">BookMark</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br />               :<span style="color: #000000;">nRecSelWidth</span>     := <span style="color: #ff0000;">"999"</span><br />               :<span style="color: #000000;">nRecSelColor</span>     :=   nRgb<span style="color: #000000;">&#40;</span> <span style="color: #000000;">245</span>,<span style="color: #000000;">244</span>,<span style="color: #000000;">234</span><span style="color: #000000;">&#41;</span><br /><br />             :<span style="color: #000000;">bClrStd</span>          := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">SelectRow</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, 0x88EDFB, CLR_WHITE <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />       <br />      :<span style="color: #000000;">nEditTypes</span>    := EDIT_GET<br />      :<span style="color: #000000;">lCanPaste</span>     := .t.<br />      :<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLROW<br />      :<span style="color: #000000;">bClrRowFocus</span>  := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">230</span>,<span style="color: #000000;">230</span>,<span style="color: #000000;">230</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</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_WHITE, CLR_BLUE <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br /><br />      :<span style="color: #000000;">bPopUp</span>        := <span style="color: #000000;">&#123;</span> |oCol| PopMenu<span style="color: #000000;">&#40;</span> oCol, oBrw:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">&#91;</span> oBrw:<span style="color: #000000;">nArrayAt</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;">&#125;</span><br />      <span style="color: #B900B9;">//</span><br />      :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   END<br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /><br />xbrowser aData  <span style="color: #0000ff;">TITLE</span>  <span style="color: #ff0000;">"NEW DATA"</span><br /><br />xbrowser acopy  <span style="color: #0000ff;">TITLE</span>  <span style="color: #ff0000;">"ACOPY ARRAY"</span><br /><br />   <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><span style="color: #00C800;">function</span> PopMenu<span style="color: #000000;">&#40;</span> oCol, codsep <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oBrw  := oCol:<span style="color: #000000;">oBrw</span><br />   <span style="color: #00C800;">local</span> nCol<br />   <span style="color: #00C800;">local</span> oPop<br /><br />   <span style="color: #0000ff;">MENU</span> oPop <span style="color: #0000ff;">POPUP</span> <span style="color: #000000;">2010</span><br />   <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Codsep:"</span>+codsep<br />    <span style="color: #0000ff;">SEPARATOR</span><br />        <span style="color: #00C800;">if</span> oBrw:<span style="color: #000000;">IsSelectedRow</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />              <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Deselect the current row"</span> <span style="color: #0000ff;">action</span> <span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">SelectRow</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />              <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Deselect all"</span>             <span style="color: #0000ff;">action</span> <span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">SelectRow</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />              <span style="color: #00C800;">else</span><br />              <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Select the current row"</span>   <span style="color: #0000ff;">action</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">SelectRow</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />              <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Select All"</span>               <span style="color: #0000ff;">action</span> <span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">SelectRow</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />           <span style="color: #00C800;">endif</span><br /><br />           <span style="color: #0000ff;">SEPARATOR</span><br /><br />   <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Copy"</span> <span style="color: #0000ff;">WHEN</span> acopy=<span style="color: #00C800;">NIL</span> .and. oBrw:<span style="color: #000000;">IsSelectedRow</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;  <span style="color: #B900B9;">// only when is seletected</span><br />                <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> aCopy := oBrw:<span style="color: #000000;">aRow</span>,;<br />                oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />  <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Paste"</span> <span style="color: #0000ff;">WHEN</span> acopy!=<span style="color: #00C800;">NIL</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> ;<br />      oBrw:<span style="color: #000000;">Lock</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, ;<br />      aCopy<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> := codsep ,;<br />      aadd<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aArrayData</span>, aCopy <span style="color: #000000;">&#41;</span>,;<br />      oBrw:<span style="color: #000000;">Unlock</span><span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span>, ;<br />      acopy:=<span style="color: #00C800;">NIL</span> ,;<br />      oBrw:<span style="color: #000000;">RefreshCurrent</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">ENDMENU</span><br /><br />   <span style="color: #00C800;">return</span> oPop<br /><br /><br /> </div>[/code:1ir2l11v] this run only for ONE ROW I wish copy more rows only that selected
copy a row of xbrowse
I inserted the popup in the procedure I'm doing: it doesn't work, that is: I state I load the array from a dbf I manage the array and then save it in the dbf if I copy and paste a line even in the same xbrowse then I go to modify the copied line it also modifies the selected line while it shouldn't do so and then when I go to save it in the dbf it doesn't save the copied line and the selected one but only one (one of the two) this is because the record number is the same if I change it I change both when I go to save the array in the archive the procedure finds two records with the same record number and saves only one
copy a row of xbrowse
Silvio, You must search the selected and aadd( oBrw:aArrayData,aCopy ) each selected row. Then inserting: FOR I:= 1 to len(aCopy ) Regards, Otto
copy a row of xbrowse
[quote="Otto":3dboqngd]Silvio, You must search the selected and aadd( oBrw:aArrayData,aCopy ) each selected row. Then inserting: FOR I:= 1 to len(aCopy ) Regards, Otto[/quote:3dboqngd] Please try this test [code=fw:3dboqngd]<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;">static</span> aCopy<br /><span style="color: #00C800;">static</span> cItemFlds :=<span style="color: #ff0000;">"CodSep,Top,Left,Width,Height,desc,row,recno()"</span><br /><br /><br /> REQUEST DBFCDX<br /><br /><br /><span style="color: #00C800;">Function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />    RddSetDefault<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #000000;">&#41;</span><br /><br />       SetHandleCount<span style="color: #000000;">&#40;</span> <span style="color: #000000;">100</span> <span style="color: #000000;">&#41;</span><br />       FWNumFormat<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"E"</span>, .t. <span style="color: #000000;">&#41;</span><br /><br />       SET DATE FORMAT <span style="color: #ff0000;">"dd-mm-yyyy"</span><br />       SET DELETED     <span style="color: #0000ff;">ON</span><br />       SET CENTURY     <span style="color: #0000ff;">ON</span><br />       SET EPOCH <span style="color: #0000ff;">TO</span>    <span style="color: #0000ff;">year</span><span style="color: #000000;">&#40;</span> date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> - <span style="color: #000000;">20</span><br />       SET MULTIPLE    OFF<br /><br /><br /><br />   Build_Demo_dbf<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   Test<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"00001"</span><span style="color: #000000;">&#41;</span><br /><br />   Test<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"00002"</span><span style="color: #000000;">&#41;</span><br /><br /> retur <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">function</span> Test<span style="color: #000000;">&#40;</span>codcep<span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> oDlg, oBar, oBrw, oFont,obtn1,obtn2,obtn3,obtn4<br />   <span style="color: #00C800;">local</span> aData:= <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br />   <span style="color: #00C800;">local</span> oDbf<br /><br />     oDbf:=TDemo<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: #000000;">&#41;</span><br />     oDbf:<span style="color: #000000;">setorder</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><br />     oDbf:<span style="color: #000000;">Gotop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><br /><br />   <span style="color: #B900B9;">//adata demo</span><br /><br />       aData := oDbf:<span style="color: #000000;">DbfToArray</span><span style="color: #000000;">&#40;</span> cItemFlds, <span style="color: #000000;">&#123;</span> ||FIELD->codSep == codcep  <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">600</span>,<span style="color: #000000;">400</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL <span style="color: #0000ff;">FONT</span> oFont RESIZABLE<br /><br />     <span style="color: #B900B9;">//-----------------------------------------------------------------//</span><br />    <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTONBAR</span> oBar <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>, <span style="color: #000000;">60</span>  <span style="color: #000000;">2015</span>   BOTTOM NOBORDER<br />      <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> oBtn1 <span style="color: #0000ff;">OF</span> oBar  ;<br />      FILENAME <span style="color: #ff0000;">"DLG_NO"</span>;<br />      <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"EXIT"</span>  ;<br />      <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> IDCANCEL <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />       <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> oBtn2 <span style="color: #0000ff;">OF</span> oBar  BTNRIGHT  ;<br />      FILENAME <span style="color: #ff0000;">"DLG_OK"</span>;<br />      <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"MODIFY"</span> ;<br />      <span style="color: #0000ff;">ACTION</span>  Modify_record<span style="color: #000000;">&#40;</span>oBrw<span style="color: #000000;">&#41;</span><br /><br />       <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> oBtn3 <span style="color: #0000ff;">OF</span> oBar  BTNRIGHT  ;<br />      FILENAME <span style="color: #ff0000;">"DLG_OK"</span>;<br />      <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"DELETE"</span> ;<br />      <span style="color: #0000ff;">ACTION</span>   oBrw:<span style="color: #000000;">delete</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><br />      <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> oBtn4 <span style="color: #0000ff;">OF</span> oBar  BTNRIGHT  ;<br />      FILENAME <span style="color: #ff0000;">"DLG_OK"</span>;<br />      <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"OK"</span> ;<br />      <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> IDOK <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />     <span style="color: #B900B9;">//-----------------------------------------------------------------//</span><br /><br /><br /><br /><br />   @<span style="color: #000000;">10</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">say</span> <span style="color: #ff0000;">"Computo:"</span> +CodCep  <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">120</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">pixel</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br />        @ <span style="color: #000000;">50</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oDlg ;<br />              COLUMNS  <span style="color: #000000;">2</span>,<span style="color: #000000;">3</span>,<span style="color: #000000;">4</span>,<span style="color: #000000;">5</span>,<span style="color: #000000;">6</span>;<br />              HEADERS <span style="color: #ff0000;">"Riga"</span>,<span style="color: #ff0000;">"Colonna"</span>,<span style="color: #ff0000;">"Larghezza"</span>,<span style="color: #ff0000;">"Altezza"</span>,<span style="color: #ff0000;">"Desc"</span> ;<br />              COLSIZES <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;">200</span> ;<br />              ARRAY aData     ;<br />              <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-20</span>,<span style="color: #000000;">-80</span> <span style="color: #0000ff;">PIXEL</span>   <span style="color: #0000ff;">STYLE</span> FLAT NOBORDER<br /><br /><br /><br />   WITH OBJECT oBrw<br />      :<span style="color: #000000;">SetMultiSelectCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />               :<span style="color: #000000;">lRecordSelector</span>     := .t.<br />               :<span style="color: #000000;">bRecSelHeader</span>    := <span style="color: #000000;">&#123;</span> || <span style="color: #ff0000;">" Num. "</span> <span style="color: #000000;">&#125;</span><br />               :<span style="color: #000000;">bRecSelData</span>      := <span style="color: #000000;">&#123;</span> |o| Int<span style="color: #000000;">&#40;</span> o:<span style="color: #000000;">BookMark</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br />               :<span style="color: #000000;">nRecSelWidth</span>     := <span style="color: #ff0000;">"999"</span><br />               :<span style="color: #000000;">nRecSelColor</span>     :=   nRgb<span style="color: #000000;">&#40;</span> <span style="color: #000000;">245</span>,<span style="color: #000000;">244</span>,<span style="color: #000000;">234</span><span style="color: #000000;">&#41;</span><br /><br />             :<span style="color: #000000;">bClrStd</span>          := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">SelectRow</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, 0x88EDFB, CLR_WHITE <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br />      :<span style="color: #000000;">nEditTypes</span>    := EDIT_GET<br />      :<span style="color: #000000;">lCanPaste</span>     := .t.<br />      :<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLROW<br />      :<span style="color: #000000;">bClrRowFocus</span>  := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">230</span>,<span style="color: #000000;">230</span>,<span style="color: #000000;">230</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</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_WHITE, CLR_BLUE <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br /><br />      :<span style="color: #000000;">bPopUp</span>        := <span style="color: #000000;">&#123;</span> |oCol| PopMenu<span style="color: #000000;">&#40;</span> oCol, oBrw:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">&#91;</span> oBrw:<span style="color: #000000;">nArrayAt</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;">&#125;</span><br />      <span style="color: #B900B9;">//</span><br />      :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   END<br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> ;<br />   <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span>   oDlg:<span style="color: #000000;">resize</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br />    <span style="color: #00C800;">if</span> oDlg:<span style="color: #000000;">nresult</span> == IDOK<br />        <span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aDeleted</span> <span style="color: #000000;">&#41;</span><br />              AEval<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aDeleted</span>, <span style="color: #000000;">&#123;</span> |a| <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span>a<span style="color: #000000;">&#91;</span> <span style="color: #000000;">8</span> <span style="color: #000000;">&#93;</span> ==<span style="color: #000000;">0</span>, a<span style="color: #000000;">&#91;</span><span style="color: #000000;">8</span><span style="color: #000000;">&#93;</span> := len<span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">aDeleted</span><span style="color: #000000;">&#41;</span>,<span style="color: #00C800;">nil</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />              <span style="color: #B900B9;">//--</span><br />              AEval<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aDeleted</span>, <span style="color: #000000;">&#123;</span> |a| a<span style="color: #000000;">&#91;</span> <span style="color: #000000;">8</span> <span style="color: #000000;">&#93;</span> := -a<span style="color: #000000;">&#91;</span> <span style="color: #000000;">8</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />              oDbf:<span style="color: #000000;">SaveArrayToDBF</span><span style="color: #000000;">&#40;</span> cItemFlds, oBrw:<span style="color: #000000;">aDeleted</span> <span style="color: #000000;">&#41;</span><br />           <span style="color: #00C800;">endif</span><br />         <span style="color: #B900B9;">//save</span><br />         AEval<span style="color: #000000;">&#40;</span> aData, <span style="color: #000000;">&#123;</span> |a| a<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> := codCep <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />         AEval<span style="color: #000000;">&#40;</span> aData, <span style="color: #000000;">&#123;</span> |a,i| a<span style="color: #000000;">&#91;</span> <span style="color: #000000;">7</span> <span style="color: #000000;">&#93;</span> := strzero<span style="color: #000000;">&#40;</span>i,<span style="color: #000000;">5</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />         oDbf:<span style="color: #000000;">ArrayToDBF</span><span style="color: #000000;">&#40;</span> aData ,  cItemFlds,, .t., .t. <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">EndIF</span><br />   <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><span style="color: #00C800;">function</span> PopMenu<span style="color: #000000;">&#40;</span> oCol, codsep <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oBrw  := oCol:<span style="color: #000000;">oBrw</span><br />   <span style="color: #00C800;">local</span> nCol<br />   <span style="color: #00C800;">local</span> oPop<br /><br />   <span style="color: #0000ff;">MENU</span> oPop <span style="color: #0000ff;">POPUP</span> <span style="color: #000000;">2010</span><br />   <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Codsep:"</span>+codsep<br />    <span style="color: #0000ff;">SEPARATOR</span><br />        <span style="color: #00C800;">if</span> oBrw:<span style="color: #000000;">IsSelectedRow</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />              <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Deselect the current row"</span> <span style="color: #0000ff;">action</span> <span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">SelectRow</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />              <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Deselect all"</span>             <span style="color: #0000ff;">action</span> <span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">SelectRow</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />              <span style="color: #00C800;">else</span><br />              <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Select the current row"</span>   <span style="color: #0000ff;">action</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">SelectRow</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />              <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Select All"</span>               <span style="color: #0000ff;">action</span> <span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">SelectRow</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />           <span style="color: #00C800;">endif</span><br /><br />           <span style="color: #0000ff;">SEPARATOR</span><br /><br />   <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Copy"</span> <span style="color: #0000ff;">WHEN</span> acopy=<span style="color: #00C800;">NIL</span> .and. oBrw:<span style="color: #000000;">IsSelectedRow</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;  <span style="color: #B900B9;">// only when is seletected</span><br />                <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> aCopy := oBrw:<span style="color: #000000;">aRow</span>,;<br />                oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />  <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Paste"</span> <span style="color: #0000ff;">WHEN</span> acopy!=<span style="color: #00C800;">NIL</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> ;<br />      oBrw:<span style="color: #000000;">Lock</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, ;<br />      aCopy<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> := codsep ,;<br />      aadd<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aArrayData</span>, aCopy <span style="color: #000000;">&#41;</span>,;<br />      oBrw:<span style="color: #000000;">Unlock</span><span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span>, ;<br />      acopy:=<span style="color: #00C800;">NIL</span> ,;<br />      oBrw:<span style="color: #000000;">RefreshCurrent</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">ENDMENU</span><br /><br />   <span style="color: #00C800;">return</span> oPop<br /><br />  <span style="color: #B900B9;">//--------------------------------------------------//</span><br /><span style="color: #00C800;">Function</span> Build_Demo_dbf<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   FIELD CODSEP<br /><br /><br />      <span style="color: #00C800;">local</span> aFields  :=     <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span>  <span style="color: #ff0000;">"CodSep"</span>,    <span style="color: #ff0000;">"C"</span>,   <span style="color: #000000;">5</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />                               <span style="color: #000000;">&#123;</span>  <span style="color: #ff0000;">"Top"</span>,       <span style="color: #ff0000;">"N"</span>,   <span style="color: #000000;">6</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#125;</span>,;<br />                               <span style="color: #000000;">&#123;</span>  <span style="color: #ff0000;">"Left"</span>,      <span style="color: #ff0000;">"N"</span>,   <span style="color: #000000;">6</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#125;</span>,;<br />                               <span style="color: #000000;">&#123;</span>  <span style="color: #ff0000;">"Width"</span>,     <span style="color: #ff0000;">"N"</span>,   <span style="color: #000000;">6</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#125;</span>,;<br />                               <span style="color: #000000;">&#123;</span>  <span style="color: #ff0000;">"Height"</span>,    <span style="color: #ff0000;">"N"</span>,   <span style="color: #000000;">6</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#125;</span>,;<br />                               <span style="color: #000000;">&#123;</span>  <span style="color: #ff0000;">"Desc"</span>,      <span style="color: #ff0000;">"C"</span>,   <span style="color: #000000;">30</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span>,;<br />                               <span style="color: #000000;">&#123;</span>  <span style="color: #ff0000;">"Row"</span>,       <span style="color: #ff0000;">"C"</span>,   <span style="color: #000000;">5</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><br /><br />    <span style="color: #00C800;">if</span> File<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Demo.dbf"</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">if</span> !File<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"demo.cdx"</span> <span style="color: #000000;">&#41;</span><br />         USE  &<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"demo"</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">NEW</span> EXCLUSIVE <span style="color: #0000ff;">ALIAS</span> DB<br />         <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> CODSEP+ROW          TAG CODSEP  <span style="color: #00C800;">FOR</span> !Deleted<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />         CLOSE DB<br />      <span style="color: #00C800;">endif</span><br />   <span style="color: #00C800;">else</span><br />      DbCreate<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Demo.dbf"</span>, aFields, <span style="color: #ff0000;">"DBFCDX"</span>, .T., <span style="color: #ff0000;">"DB"</span> <span style="color: #000000;">&#41;</span><br />         <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> CODSEP+ROW        TAG CODSEP  <span style="color: #00C800;">FOR</span> !Deleted<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />         CLOSE DB<br /><br /><br />      USE  &<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"demo"</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">NEW</span> EXCLUSIVE <span style="color: #0000ff;">ALIAS</span> DB<br />      <span style="color: #B900B9;">//00001</span><br />      DB-><span style="color: #000000;">&#40;</span> DbAppend<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />       REPLACE DB->codsep      WITH <span style="color: #ff0000;">"00001"</span><br />       REPLACE DB->Top         WITH <span style="color: #000000;">1.5</span><br />       REPLACE DB->left        WITH <span style="color: #000000;">11</span><br />       REPLACE DB->Width       WITH <span style="color: #000000;">9</span><br />       REPLACE DB->Height      WITH <span style="color: #000000;">2</span><br />       REPLACE DB->Desc       WITH <span style="color: #ff0000;">"Demo 1 row1"</span><br />       REPLACE DB->ROW         WITH <span style="color: #ff0000;">"00001"</span><br />       DB-><span style="color: #000000;">&#40;</span> Dbcommit<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />       DB-><span style="color: #000000;">&#40;</span> DbAppend<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />       REPLACE DB->codsep      WITH <span style="color: #ff0000;">"00001"</span><br />       REPLACE DB->Top         WITH <span style="color: #000000;">5.5</span><br />       REPLACE DB->left        WITH  <span style="color: #000000;">5.5</span><br />       REPLACE DB->Width       WITH  <span style="color: #000000;">2.5</span><br />       REPLACE DB->Height      WITH  <span style="color: #000000;">0.8</span><br />       REPLACE DB->Desc       WITH <span style="color: #ff0000;">"Demo 1 row2"</span><br />       REPLACE DB->ROW         WITH <span style="color: #ff0000;">"00002"</span><br />       DB-><span style="color: #000000;">&#40;</span> Dbcommit<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />      DB-><span style="color: #000000;">&#40;</span> DbAppend<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />       REPLACE DB->codsep      WITH <span style="color: #ff0000;">"00002"</span><br />       REPLACE DB->Top         WITH <span style="color: #000000;">6.3</span><br />       REPLACE DB->left        WITH <span style="color: #000000;">8</span><br />       REPLACE DB->Width       WITH <span style="color: #000000;">5</span><br />       REPLACE DB->Height      WITH <span style="color: #000000;">0.8</span><br />       REPLACE DB->Desc        WITH <span style="color: #ff0000;">"Demo 2 row1"</span><br />       REPLACE DB->ROW         WITH <span style="color: #ff0000;">"00001"</span><br />       DB-><span style="color: #000000;">&#40;</span> Dbcommit<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />        <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> CODSEP+ROW        TAG CODSEP  <span style="color: #00C800;">FOR</span> !Deleted<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />        CLOSE DB<br />     <span style="color: #00C800;">endif</span><br />    <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><br /><span style="color: #00C800;">Function</span> Modify_record<span style="color: #000000;">&#40;</span>oBrowse<span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span>  nTop           ,;<br />          nLeft          ,;<br />          nWidth         ,;<br />          nHeight        ,;<br />          cDesc<br />    <span style="color: #00C800;">local</span> oMod<br />    <span style="color: #00C800;">local</span> nWd  := GetSysMetrics<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span> * .<span style="color: #000000;">58</span><br />    <span style="color: #00C800;">local</span> nHt  := <span style="color: #000000;">&#40;</span>GetSysMetrics<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span> / <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span><br />    <span style="color: #00C800;">local</span> oSay:= array<span style="color: #000000;">&#40;</span><span style="color: #000000;">10</span><span style="color: #000000;">&#41;</span><br />    <span style="color: #00C800;">local</span> aGet:= array<span style="color: #000000;">&#40;</span><span style="color: #000000;">10</span><span style="color: #000000;">&#41;</span><br />    <span style="color: #00C800;">local</span> nRow:= <span style="color: #000000;">0</span>,nCol:= <span style="color: #000000;">10</span><br />    <span style="color: #00C800;">local</span> nInterlinea := <span style="color: #000000;">30</span><br />    <span style="color: #00C800;">local</span> nRecord:= oBrowse:<span style="color: #000000;">nArrayAt</span><br />    <span style="color: #00C800;">local</span> oBar,oBtn1,oBtn2<br /><br />     nTop        := oBrowse:<span style="color: #000000;">aArraydata</span><span style="color: #000000;">&#91;</span>nRecord<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span><br />     nLeft       := oBrowse:<span style="color: #000000;">aArraydata</span><span style="color: #000000;">&#91;</span>nRecord<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span><br />     nWidth      := oBrowse:<span style="color: #000000;">aArraydata</span><span style="color: #000000;">&#91;</span>nRecord<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span><br />     nHeight     := oBrowse:<span style="color: #000000;">aArraydata</span><span style="color: #000000;">&#91;</span>nRecord<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span><br />     cDesc       := oBrowse:<span style="color: #000000;">aArraydata</span><span style="color: #000000;">&#91;</span>nRecord<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">6</span><span style="color: #000000;">&#93;</span><br /><br />      <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oMod <span style="color: #0000ff;">SIZE</span> nWd, nHt <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL;<br />      <span style="color: #0000ff;">TiTLE</span> <span style="color: #ff0000;">"modify"</span><br /><br />      <span style="color: #B900B9;">//-----------------------------------------------------------------//</span><br />    <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTONBAR</span> oBar <span style="color: #0000ff;">OF</span> oMod <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>, <span style="color: #000000;">60</span>  <span style="color: #000000;">2015</span>   BOTTOM NOBORDER<br />      <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> oBtn1 <span style="color: #0000ff;">OF</span> oBar  ;<br />      FILENAME <span style="color: #ff0000;">"DLG_NO"</span>;<br />      <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"EXIT"</span>  ;<br />      <span style="color: #0000ff;">ACTION</span>   <span style="color: #000000;">&#40;</span>  oMod:<span style="color: #000000;">end</span><span style="color: #000000;">&#40;</span> IDCANCEL <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br /><br />      <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> oBtn3 <span style="color: #0000ff;">OF</span> oBar  BTNRIGHT  ;<br />      FILENAME <span style="color: #ff0000;">"DLG_OK"</span>;<br />      <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"OK"</span> ;<br />      <span style="color: #0000ff;">ACTION</span>   <span style="color: #000000;">&#40;</span>  oMod:<span style="color: #000000;">end</span><span style="color: #000000;">&#40;</span> IDOK <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />     <span style="color: #B900B9;">//-----------------------------------------------------------------//</span><br /><br /><br />      @ nRow, <span style="color: #000000;">5</span>   <span style="color: #0000ff;">Say</span> oSay<span style="color: #000000;">&#91;</span><span style="color: #000000;">6</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">Prompt</span> <span style="color: #ff0000;">"Row "</span>      <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>,<span style="color: #000000;">14</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oMod  TRANSPARENT<br />      @ nRow, <span style="color: #000000;">295</span> <span style="color: #0000ff;">Say</span> oSay<span style="color: #000000;">&#91;</span><span style="color: #000000;">8</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">Prompt</span> <span style="color: #ff0000;">"Width"</span>  <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>,<span style="color: #000000;">14</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oMod  TRANSPARENT<br />      nRow-=<span style="color: #000000;">2</span><br />      @ nRow, <span style="color: #000000;">120</span> <span style="color: #0000ff;">GET</span> aGet<span style="color: #000000;">&#91;</span><span style="color: #000000;">6</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">VAR</span> nTop     <span style="color: #0000ff;">OF</span> oMod <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">50</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">PIXEL</span>    <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@Z 999.99"</span>  <span style="color: #0000ff;">UPDATE</span><br />      @ nRow, <span style="color: #000000;">420</span> <span style="color: #0000ff;">GET</span> aGet<span style="color: #000000;">&#91;</span><span style="color: #000000;">8</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">VAR</span> nWidth  <span style="color: #0000ff;">OF</span> oMod <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">50</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">PIXEL</span>  <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@Z 999.99"</span>  <span style="color: #0000ff;">UPDATE</span><br />      nRow+=nInterlinea<br />      @ nRow, <span style="color: #000000;">5</span>  <span style="color: #0000ff;">Say</span> oSay<span style="color: #000000;">&#91;</span><span style="color: #000000;">7</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">Prompt</span> <span style="color: #ff0000;">"Col"</span>    <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>,<span style="color: #000000;">14</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oMod  TRANSPARENT<br />      @ nRow, <span style="color: #000000;">295</span> <span style="color: #0000ff;">Say</span> oSay<span style="color: #000000;">&#91;</span><span style="color: #000000;">9</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">Prompt</span> <span style="color: #ff0000;">"Height "</span>   <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>,<span style="color: #000000;">14</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oMod  TRANSPARENT<br />      nRow-=<span style="color: #000000;">2</span><br />      @ nRow, <span style="color: #000000;">120</span> <span style="color: #0000ff;">GET</span> aGet<span style="color: #000000;">&#91;</span><span style="color: #000000;">7</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">VAR</span> nLeft    <span style="color: #0000ff;">OF</span> oMod <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">50</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">PIXEL</span>   <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@Z 999.99"</span>  <span style="color: #0000ff;">UPDATE</span><br />      @ nRow, <span style="color: #000000;">420</span> <span style="color: #0000ff;">GET</span> aGet<span style="color: #000000;">&#91;</span><span style="color: #000000;">9</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">VAR</span> nHeight <span style="color: #0000ff;">OF</span> oMod <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">50</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">PIXEL</span>   <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@Z 999.99"</span>  <span style="color: #0000ff;">UPDATE</span><br />      nRow+=nInterlinea<br />      @ nRow, <span style="color: #000000;">5</span>   <span style="color: #0000ff;">Say</span> oSay<span style="color: #000000;">&#91;</span><span style="color: #000000;">6</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">Prompt</span> <span style="color: #ff0000;">"Desc "</span>      <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>,<span style="color: #000000;">14</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oMod  TRANSPARENT<br />      nRow-=<span style="color: #000000;">2</span><br />      @ nRow, <span style="color: #000000;">120</span> <span style="color: #0000ff;">GET</span> aGet<span style="color: #000000;">&#91;</span><span style="color: #000000;">7</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">VAR</span> cDesc     <span style="color: #0000ff;">OF</span> oMod <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>, <span style="color: #000000;">20</span> <span style="color: #0000ff;">PIXEL</span>    <span style="color: #0000ff;">UPDATE</span><br /><br /><br /><br />      <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oMod <span style="color: #0000ff;">CENTERED</span> ;<br />               <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span>   oMod:<span style="color: #000000;">resize</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />      <span style="color: #00C800;">IF</span>  oMod:<span style="color: #000000;">nresult</span> == IDOK<br />              oBrowse:<span style="color: #000000;">aArraydata</span><span style="color: #000000;">&#91;</span>nRecord<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>:= nTop<br />              oBrowse:<span style="color: #000000;">aArraydata</span><span style="color: #000000;">&#91;</span>nRecord<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span>:= nLeft<br />              oBrowse:<span style="color: #000000;">aArraydata</span><span style="color: #000000;">&#91;</span>nRecord<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span>:= nWidth<br />              oBrowse:<span style="color: #000000;">aArraydata</span><span style="color: #000000;">&#91;</span>nRecord<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span>:= nHeight<br />              oBrowse:<span style="color: #000000;">aArraydata</span><span style="color: #000000;">&#91;</span>nRecord<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">6</span><span style="color: #000000;">&#93;</span>:= cDesc<br />              oBrowse:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />    <span style="color: #00C800;">ENDIF</span><br />    <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />    <span style="color: #B900B9;">//--------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">CLASS</span> TXData <span style="color: #0000ff;">from</span> TDatabase<br />   <span style="color: #B900B9;">//  DATA cDbfPath init cFilePath(GetModuleFileName( GetInstance() ))  + "Data\"</span><br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><br /> <span style="color: #00C800;">CLASS</span> TDemo <span style="color: #0000ff;">from</span> TXData<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><br />   <span style="color: #00C800;">ENDCLASS</span><br /><br /><span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> lShared <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TDemo<br />   <span style="color: #00C800;">Default</span> lShared := .t.<br />   ::<span style="color: #00C800;">super</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span>,<span style="color: #ff0000;">"DEMO"</span> ,<span style="color: #ff0000;">"DBFCDX"</span>, lShared<span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">if</span> ::<span style="color: #000000;">use</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      ::<span style="color: #000000;">setOrder</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><br />      ::<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 />   <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">Self</span><br /><br /><br /> </div>[/code:3dboqngd] Now the test use a dbf ( demo) and take the aData from dbf when the dialog is close it save on dbf [img:3dboqngd]https&#58;//i&#46;postimg&#46;cc/RZMp8ZJJ/uuuuu&#46;gif[/img:3dboqngd] [b:3dboqngd]Operation to do [/b:3dboqngd] 1. copy a record 2 paste the record 3 modify a record sample change the desc and press ok 4. you 'll see it changed two record ( the copied and the selected) it is wrong !!!! this happen because the number of record is the same
copy a row of xbrowse
Silvio, insert xBrowse(aCopy) in your functions to see what you copy and msgInfo's. Best regards, Otto
copy a row of xbrowse
[quote="Otto":28kbq02b]Silvio, insert xBrowse(aCopy) in your functions to see what you copy and msgInfo's. Best regards, Otto[/quote:28kbq02b] I not understood when I copy insert on acopy the row I selected ( all field) change acopy[1] with new codsep MENUITEM "Paste" WHEN acopy!=NIL ACTION ( ; oBrw:Lock(), ; [b:28kbq02b]aCopy[ 1 ] := codsep ,; aCopy[ 8 ] := 0 ,; //recno[/b:28kbq02b] aadd( oBrw:aArrayData, aCopy ),; oBrw:Unlock( .t. ), ; acopy:=NIL ,; oBrw:RefreshCurrent(), oBrw:SetFocus() ) ENDMENU but when I modify it the nRecord:= oBrowse:nArrayAt is the same
copy a row of xbrowse
Silvio, ask ChatGPT: To address the issue of copying multiple rows and pasting them into your xBrowse control in Harbour with FiveWin, you need to modify your `Copy` and `Paste` functionalities to handle multiple rows. Here is an approach to achieve this: 1. **Modify Copy Functionality**: Instead of copying a single row to `aCopy`, copy all selected rows. You can use a loop to go through the selected rows and add them to `aCopy`. 2. **Modify Paste Functionality**: When pasting, iterate over `aCopy` and add each row to `oBrw:aArrayData`. Make sure to reset `aCopy` after pasting. 3. **Handle Unique Identifiers**: To avoid issues with modifying copied rows, ensure each row has a unique identifier (like a record number). You might need to generate new unique IDs for the pasted rows. Here's an example of how you could modify your code: ### Modified Copy Functionality ```harbour // Inside PopMenu Function - Modify the "Copy" Menu Item MENUITEM "Copy" WHEN acopy==NIL .and. oBrw:IsSelectedRow(); ACTION ( aCopy := {}, // Initialize aCopy as an empty array FOR EACH nRow IN oBrw:aSelectedRows // Iterate over selected rows AAdd( aCopy, oBrw:aArrayData[nRow] ) // Add each selected row to aCopy NEXT, oBrw:SetFocus() ) ``` ### Modified Paste Functionality ```harbour // Inside PopMenu Function - Modify the "Paste" Menu Item MENUITEM "Paste" WHEN !Empty( aCopy ) ACTION ( oBrw:Lock(), FOR EACH aRow IN aCopy aRow[1] := codsep, // Set new codsep aRow[8] := 0, // Reset record number or assign a new unique ID aAdd( oBrw:aArrayData, aRow ) // Add to the xBrowse array NEXT, oBrw:Unlock( .t. ), aCopy := NIL, // Reset aCopy oBrw:RefreshCurrent(), oBrw:SetFocus() ) ``` ### Generate Unique Identifiers For generating new unique IDs for the pasted rows, you could use a function that generates an ID not currently used in `oBrw:aArrayData`. ### Notes - Ensure that `oBrw:aSelectedRows` contains the indexes of selected rows in `oBrw:aArrayData`. This might require additional implementation based on how row selection is handled in your application. - When generating new unique IDs for pasted rows, make sure they do not conflict with existing ones. These modifications should enable copying and pasting multiple selected rows in your xBrowse control, with each row being treated independently after being pasted.
copy a row of xbrowse
I Wish Know what Say Nageswarao
copy a row of xbrowse
try using aclone, aCopy := aclone( oBrw:aRow )
copy a row of xbrowse
[quote="Marcelo Via Giglio":1opds3xb]try using aclone, aCopy := aclone( oBrw:aRow )[/quote:1opds3xb] Marcelo, No es el problema de copiar una fila, esto lo hace, el problema es que quiero copiar varias filas al mismo tiempo y si modifico una fila y guardo, las demás también modifican, es como si las filas copiadas tuvieran lo mismo. número de registros en la matriz intenta compilar la última prueba, copia una línea y luego ve a editar la línea y verás qué sucede
copy a row of xbrowse
As suggestion by Marcelo [code=fw:wd1wqytj]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Copy"</span> <span style="color: #0000ff;">WHEN</span> acopy=<span style="color: #00C800;">NIL</span> .and. oBrw:<span style="color: #000000;">IsSelectedRow</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;  <span style="color: #B900B9;">// only when is seletected</span><br />   <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> aCopy := aclone<span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">aRow</span><span style="color: #000000;">&#41;</span>,;<br />   oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span></div>[/code:wd1wqytj] Seem run ok also if I modify the row But copy one row
copy a row of xbrowse
Perhaps... MENUITEM "Copy" WHEN acopy=NIL .and. oBrw:IsSelectedRow(); // only when is seletected ACTION IIF(Len(oBrw:aseleted) >1,Aclone:=[b:35rsg6lo]Giverows[/b:35rsg6lo](oBrw),aCopy := aclone(oBrw:aRow)),; oBrw:SetFocus() ) Function [b:35rsg6lo]Giverows[/b:35rsg6lo](oBrw) local n,uBook,nAt local aTmp:= {} For n = 1 to len(oBrw:aselected) uBook := Eval( oBrw:bBookMark ) nAt := Ascan( oBrw:aSelected, uBook ) aCopy:= aclone(oBrw:aArrayData[ nAt ]) Next return acopy
copy a row of xbrowse
> FOR EACH nRow IN oBrw:aSelectedRows > NOT EXIST IN XBROWSE !!!!!! > wich xbrowse you have ? I have the last release of fwh Silvio, Here you have the solution. But, look also into xbrowse.prg in C:\FWH\Source\Classes\xbrowse.prg. MENUITEM "Copy" WHEN acopy=NIL ACTION ( aCopy := oBrw:aRow,; oBrw:SetFocus(), xbrowse(oBrw:aSelected) ) All you need is there. This is the biggest benefit of FiveWin that you have source code of the classes. And xbrowse() is so great for debugging. Best regards, Otto
copy a row of xbrowse
[quote="Otto":35sqs7hx]> FOR EACH nRow IN oBrw:aSelectedRows > NOT EXIST IN XBROWSE !!!!!! > wich xbrowse you have ? I have the last release of fwh Silvio, Here you have the solution. But, look also into xbrowse.prg in C:\FWH\Source\Classes\xbrowse.prg. MENUITEM "Copy" WHEN acopy=NIL ACTION ( aCopy := oBrw:aRow,; oBrw:SetFocus(), xbrowse(oBrw:aSelected) ) All you need is there. This is the biggest benefit of FiveWin that you have source code of the classes. And xbrowse() is so great for debugging. Best regards, Otto[/quote:35sqs7hx] Otto, [b:35sqs7hx]For Only one Row [/b:35sqs7hx] this run ok (also on modify) [code=fw:35sqs7hx]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Copy"</span> <span style="color: #0000ff;">WHEN</span> acopy=<span style="color: #00C800;">NIL</span> .and. oBrw:<span style="color: #000000;">IsSelectedRow</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;  <span style="color: #B900B9;">// only when is seletected</span><br />              <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> aCopy := aclone<span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">aRow</span><span style="color: #000000;">&#41;</span>,;<br />              oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>   <span style="color: #000000;">&#41;</span></div>[/code:35sqs7hx] [b:35sqs7hx]For many rows selected Not run ok [/b:35sqs7hx] [b:35sqs7hx]oBrw:aSelected [/b:35sqs7hx] give number or numbers not the row oBrw:aRow is as ::aArrayData[ ::nArrayAt ] you can make For n= 1 to Len( oBrw:aselected) nAt := oBrw:aArrayData[ oBrw:aselected[n] ] aadd( acopy, aclone(nat)) next just an idea
copy a row of xbrowse
MENUITEM "Copy" WHEN acopy=NIL .and. oBrw:IsSelectedRow(); // only when is seletected ACTION ( IIF(Len(oBrw:aselected) >1,aClone:=Giverows(oBrw),; aCopy := aclone(oBrw:aRow)),; oBrw:SetFocus() ) Function Giverows(oBrw) local n,atmp:={},nAt For n= 1 to Len( oBrw:aselected) nAt := oBrw:aArrayData[ oBrw:aselected[n] ] aadd( aTmp, aclone(nat)) next return aTmp But then the paste is wrong
copy a row of xbrowse
try can run ok now [code=fw:33knxzha]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> PopMenu<span style="color: #000000;">&#40;</span> oCol, codsep <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oBrw  := oCol:<span style="color: #000000;">oBrw</span><br />   <span style="color: #00C800;">local</span> nCol<br />   <span style="color: #00C800;">local</span> oPop<br /><br />   <span style="color: #0000ff;">MENU</span> oPop <span style="color: #0000ff;">POPUP</span> <span style="color: #000000;">2010</span><br />   <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Codsep:"</span>+codsep<br />    <span style="color: #0000ff;">SEPARATOR</span><br />        <span style="color: #00C800;">if</span> oBrw:<span style="color: #000000;">IsSelectedRow</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />              <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Deselect the current row"</span> <span style="color: #0000ff;">action</span> <span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">SelectRow</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />              <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Deselect all"</span>             <span style="color: #0000ff;">action</span> <span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">SelectRow</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />              <span style="color: #00C800;">else</span><br />              <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Select the current row"</span>   <span style="color: #0000ff;">action</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">SelectRow</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />              <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Select All"</span>               <span style="color: #0000ff;">action</span> <span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">SelectRow</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />           <span style="color: #00C800;">endif</span><br />    <span style="color: #0000ff;">SEPARATOR</span><br /><br />   <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Copy"</span> <span style="color: #0000ff;">WHEN</span> acopy=<span style="color: #00C800;">NIL</span> .and. oBrw:<span style="color: #000000;">IsSelectedRow</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;  <span style="color: #B900B9;">// only when is seletected</span><br />   <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> aCopy:=Giverows<span style="color: #000000;">&#40;</span>oBrw<span style="color: #000000;">&#41;</span>,;<br />           oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>   <span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Paste"</span> <span style="color: #0000ff;">WHEN</span> acopy!=<span style="color: #00C800;">NIL</span> <span style="color: #0000ff;">ACTION</span> Paste<span style="color: #000000;">&#40;</span>oBrw,codsep<span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">ENDMENU</span><br /><br />   <span style="color: #00C800;">return</span> oPop<br /><span style="color: #B900B9;">//------------------------------------------------------//</span><br /><span style="color: #00C800;">Function</span> Paste<span style="color: #000000;">&#40;</span>oBrw,codsep<span style="color: #000000;">&#41;</span><br />     oBrw:<span style="color: #000000;">Lock</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />              <span style="color: #00C800;">For</span> n=<span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span>acopy<span style="color: #000000;">&#41;</span><br />                aCopy<span style="color: #000000;">&#91;</span>n<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> := codsep<br />                aCopy<span style="color: #000000;">&#91;</span>n<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">8</span><span style="color: #000000;">&#93;</span> := <span style="color: #000000;">0</span><br />                aadd<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aArrayData</span>, aCopy<span style="color: #000000;">&#91;</span>n<span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />              <span style="color: #00C800;">Next</span><br />      oBrw:<span style="color: #000000;">Unlock</span><span style="color: #000000;">&#40;</span> .t. <span style="color: #000000;">&#41;</span><br />      acopy:=<span style="color: #00C800;">NIL</span><br />      oBrw:<span style="color: #000000;">RefreshCurrent</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />     <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><span style="color: #B900B9;">//------------------------------------------------------//</span><br /><span style="color: #00C800;">Function</span> Giverows<span style="color: #000000;">&#40;</span>oBrw<span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">local</span> n,atmp:=<span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span>,nAt<br />        <span style="color: #00C800;">For</span> n= <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aselected</span><span style="color: #000000;">&#41;</span><br />           nAt := oBrw:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">&#91;</span> oBrw:<span style="color: #000000;">aselected</span><span style="color: #000000;">&#91;</span>n<span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#93;</span><br />           aadd<span style="color: #000000;">&#40;</span> aTmp, aclone<span style="color: #000000;">&#40;</span>nat<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />        <span style="color: #00C800;">next</span><br />    <span style="color: #00C800;">return</span> aTmp<br /><br /> </div>[/code:33knxzha] Now run ok with one row and more rows But if Nages found a good solution is wellcome
copy and paste a control
can I copy and paste a control, and How ? I saw there is on Windows class Paste() and Copy() methods but I not Lnow How use them One sample please thanks @ 10,10 button obtn of oDlg obtn:bRClicked:= {|| MenuButton(nRow,nCol,oGrp,obtn) } ) ... Function MenuButton(nRow,nCol,oGrp,obtn) local oMenu MENU oMenu POPUP 2007 MENUITEM "Copy" MENUITEM "Paste" ENDMENU ACTIVATE MENU oMenu AT nRow, nCol OF obtn RETURN NIL
copy and paste a control
Maybe you need this: [code=fw:1lajmiwr]<div class="fw" id="{CB}" style="font-family: monospace;"><br />   oClip := TClipBoard<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: #000000;">&#41;</span><br />   oClip:<span style="color: #000000;">SetText</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"It will be paste when you use CTRL+V"</span><span style="color: #000000;">&#41;</span><br /> </div>[/code:1lajmiwr]
copy and paste a control
NO I not want copy a text but a control ( button , say, object ...)
copy and paste misleading
I noticed that copy from field and paste into msgget function does not lead to the supposed results . According to variable entered in the msgget function ,the browse should lead to certain results which I do not get it by copy/paste I should type with my keyboard the variable in msgget . What should be added to my code to have valid copy/paste. [code:8cgttwvy] if MsgGet&#40; "Serial Machine", "Enter Serial Machine", @V_me_mc_serl,; "&#46;&#46;\lupa&#46;bmp" &#41; select 3 use mach set index to mach5 if ! DbSeek&#40; &#40;V_me_mc_serl &#41;&#41; MsgAlert&#40; "I don't find that serial" &#41; endif endif [/code:8cgttwvy]
copy and paste misleading
Ehab, Remember you have to pad the var to the same length as the field. James
copy and paste misleading
You also have to check for a possible uppercase issue.
copy files preserving date time stamps
We are trying to save files preserving the date and time stamps for archive purposes. Based on our experience the date/time is modified to reflect the date/time of the "copy file" command. Is there an easy way to copy files preserving the original date and time stamps?
copy files preserving date time stamps
CopyFile() preserves date and time stamps: [code=fw:3mhvevk4]<div class="fw" id="{CB}" style="font-family: monospace;">DLL <span style="color: #00C800;">FUNCTION</span> COPYFILE<span style="color: #000000;">&#40;</span> cExistingFileName AS LPSTR, cNewFileName AS LPSTR, lFailIfExists AS LONG <span style="color: #000000;">&#41;</span> AS BOOL;<br />&nbsp; &nbsp; PASCAL <span style="color: #0000ff;">FROM</span> <span style="color: #ff0000;">"CopyFileA"</span> LIB <span style="color: #ff0000;">"kernel32.dll"</span></div>[/code:3mhvevk4] EMG
copy files preserving date time stamps
see also: --------------- SetFDaTi() - Sets the last change date and time of a file. Syntax SetFDaTi( <cFileName> , ; [<dFileDate>], ; [<cFileTime>] ) --> lSuccess Arguments <cFileName> This is a character string holding the name of the file to set date and time for. It must include path and file extension. If the path is omitted from <cFileName>, the file is searched in the current directory only. <dFileDate> This is the date value to be set. It defaults to the return value of Date(). <cFileTime> This is a time formatted string that defines the new file time. It defaults to Time(). Return The function returns .T. (true) if the file date and time is set, otherwise .F. (false) is returned. ------------------- In my copy-function I'm using 'SetFDaTi( cTargetFile, FileDate( cSourceFile ), FileTime( cSourceFile ) )' HTH
copy files preserving date time stamps
Thank you Enrico - That works great
copy protection
How protect an application for NOt copy ? user code + harddisk number ? have you an sample function ?
copy protection
Hello Silvio, I just tested a Application, that burns a serial to the EXE-file. It works, but the problem : I don't want to edit every time the password, to start the application. I will look for something, stores the password encrypted to disk, after it is accepted. Maybe the sample-files in FWH can help You : in folder samples : PROTECT.prg and TESTHARD.prg PROTECT.prg works with USB. If I have the time tomorrow and You can still wait, I will try, to find a solution just with passwords. Using harddisk-informations, I think it is not a good idea, You will have support-problems. Maybe Winguard can do also something, You still need : It's FREE, no adverts, nag screens or spyware Lock Programs, Applications, EXE Files with a Password Encrypt Files, Folders and Entire Drives with Strong 128 bit AES Disable users changing the Desktop Wallpaper Disable Windows at Boot and the Boot Keys (F8) * Disable Software Installation * Password Protect Windows Explorer Password Protect your Web Browser, inc. Internet Explorer, FireFox, Opera and Downloads Lock Zip and Self Extracting files, Desktop, Task Keys and setup multiple users Works alongside your firewall and anti-virus program <!-- m --><a class="postlink" href="http://www.winguardpro.com/">http://www.winguardpro.com/</a><!-- m --> Regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
copy protection
Uwe, the problem is simply We are on te beach on the beach there are many chalets but only one purchase my application one chalet have my program : installed it on his hard disk then take his hard disk and give it to another chalet the first chalet re installed my software and then there are many chalet but one license How I can make ?
copy protection
Hello Silvio, that is exactly the protection-system, the producer of my RESOURCE-Builder uses. 1. I have a tríal-version. 2. I have to send them my Harddisk-No. 3. I get a coded number from the harddisk-no. in return. 4. I add the return-number at Prog-start and the application is connected to the harddisk. It is not user-friendly, because You cannot move the software to another computer. But that is exactly what You want. It seems, that is the only solution, to solve Your problem. What to do : 1. Write a little exe-file to detect the Harddisk-no. 2. Send the file to the customer. 3. He starts the appl. and gets the harddisc-no of his computer. 4. He will E-mail the number to You. 5. Include the Harddisk-no.-check in Your application. Regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
copy protection
have you an sample ?
copy protection
Silvio, Besides the harddisk serial number, you can also use the netcard ID, which it is a unique ID for each network card: MsgInfo( GetNetCardID() )
copy protection
Hi Silvio, How about use USB Keypro hardware key? Very easy use and control. Regards, Richard
copy protection
Silvio, keep in mind that GetNetCardID() could be an array, too. Best regards, Otto
copy protection
Hi, I use HASP dongle with Protection Plus (from softwarekey.com) licence file. I kept HASP ids and customers information in licence file. When my application starts, it reads the licence file. it find out the hasp ids. and check the hasp dongle is connected and it is really this id. I have no problem with it. I gave the hasp dongle with licence file to every customer. The Protection plus can also be used alone without hasp key. Regards,
copy protection
Silvio Has you tried: [url:1x6faoyv]http&#58;//www&#46;softwarekey&#46;com/swk_products/plus[/url:1x6faoyv] I think PPP, the LIB that come from Clipper days, is the best software protection that we can have. Do a "PPP" search in this forum for more information. Regards, George
copy protection
My budget is poor... I wish something simply create in fwh any sample ?
copy protection
Hello Silvio, I use this code. ABC 99, etc I insert for fake. Regards, Otto Here I test if a valid license exists: [code=fw:3dvop7cf]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">IF</span> lizenz<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> = .F.<br />   <span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"no lizenz"</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">ENDIF</span></div>[/code:3dvop7cf] [code=fw:3dvop7cf]<div class="fw" id="{CB}" style="font-family: monospace;"><br />func Lizenz<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">LOCAL</span> cLizenzNetz  := GetPvProfString<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"LIZENZ"</span>,<span style="color: #ff0000;">"Lizenz"</span>, <span style="color: #ff0000;">"9999"</span>, <span style="color: #ff0000;">".<span style="color: #000000;">\I</span>NI<span style="color: #000000;">\L</span>IZENZ.INI"</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">LOCAL</span> sninfo          := ALLTRIM<span style="color: #000000;">&#40;</span>nSerialHD<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">LOCAL</span> cBiosDate    := fBios<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">IF</span>  ALLTRIM<span style="color: #000000;">&#40;</span>cLizenzNetz<span style="color: #000000;">&#41;</span> = <span style="color: #ff0000;">"ABC"</span> + ALLTRIM<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span>snInfo,<span style="color: #000000;">3</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"-"</span> + <span style="color: #ff0000;">"99"</span> + <span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span>cBiosDate,<span style="color: #000000;">7</span>,<span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span> + <span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span>snInfo,<span style="color: #000000;">2</span>,<span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span> + <span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span>cBiosDate,<span style="color: #000000;">8</span>,<span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">return</span><span style="color: #000000;">&#40;</span>.t.<span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #000000;">&#40;</span>.f.<span style="color: #000000;">&#41;</span><br /><br /><br /><br /><span style="color: #00C800;">function</span> fBios<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> oReg <br />   <span style="color: #00C800;">local</span> uVar<br /><br />  <br /><span style="color: #00C800;">If</span> Empty<span style="color: #000000;">&#40;</span> uVar <span style="color: #000000;">&#41;</span><br />   oReg := TReg32<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> HKEY_local_MACHINE, <span style="color: #ff0000;">"Enum<span style="color: #000000;">\R</span>oot<span style="color: #000000;">\*</span>PNP0C01<span style="color: #000000;">\0</span>000"</span>, .f. <span style="color: #000000;">&#41;</span><br />   uVar := oReg:<span style="color: #0000ff;">Get</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"BIOSDate"</span>, <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span><br />   oReg:<span style="color: #000000;">Close</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: #000000;">&#40;</span>uVar<span style="color: #000000;">&#41;</span><br /><br /><br /><br /> </div>[/code:3dvop7cf]
copy protection
where is the data of HKEY_local_MACHINE
copy protection
[code=fw:338pfcyp]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#define</span> &nbsp;HKEY_LOCAL_MACHINE &nbsp; &nbsp; &nbsp;<span style="color: #000000;">2147483650</span></div>[/code:338pfcyp] Regards, Marc
copy protection
ok but I not Understand How it protec from copy a exe
copy protection
Silvio, it protects from running not from copying. I someone runs the program he needs the license code. [code=fw:376acs8s]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">Function</span> main<br /><br /><span style="color: #00C800;">IF</span> lizenz<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> = .T.<br /><br />Here is your code<br /><span style="color: #00C800;">else</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"no lizenz"</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">nil</span></div>[/code:376acs8s] Best regards, Otto
copy protection
But I have another problem I not want it be copied from anyone
copy protection
Hello Silvio, I am not sure what you understand by “copy”. If you understand that someone copies your exe installs it on another system and runs the program than the function I posted is a good protection. You use the bios date, the disk number and if you want the mac address, too. These are “unique” numbers. Yes I know you can change the bios, clone the disk number emulate a mac address. But I think in most cases a user does not know about that. Regards, Otto
copy protection
Hello Silvio, it is nearly impossible, to save a application from making a copy. Many applications are on the market, You can copy everything ( mostly as a image ). < CLONECD >, < ALCOHOL > and many more. Even to add bad section-parts to a CD / DVD doesn't help ( it is used on Movie-DVD's ). Like Otto told You, it is the only way, to connect Your application to any hardware-informations. Regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->