topic
stringlengths
1
63
text
stringlengths
1
577k
xbrowse y tmysql
yo tarde una semana en agarrarle el modo a tmysql, pero tambien hay que resaltar la ayuda que me brindo el amigo willy. fue muy facil el saldo de dbf a sql. saludos willy.
xbrowse y totales
Hola a todos, Como hace rato no pregunto nada... pos aca la segunda inquietud, tengo un xbrowse y una columna calculada, pues cuando calculo esa columna NO refresca el footer que totaliza esa columna aqui el code : [code=fw:h9qin3te]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.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> aData := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg, oBrw, oBar<br /><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;">540</span>,<span style="color: #000000;">360</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">'Test'</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">10</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">xbrowse</span> oBrw <span style="color: #0000ff;">of</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">250</span>, <span style="color: #000000;">150</span> <span style="color: #0000ff;">PIXEL</span> ;<br />&nbsp; &nbsp; &nbsp; header <span style="color: #ff0000;">'one'</span>,<span style="color: #ff0000;">'two'</span>,<span style="color: #ff0000;">'tipo'</span>, <span style="color: #ff0000;">"cuatro"</span> ;<br />&nbsp; &nbsp; &nbsp; columns <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span>, <span style="color: #000000;">3</span>, <span style="color: #000000;">4</span> ;<br />&nbsp; &nbsp; &nbsp; colsizes <span style="color: #000000;">50</span>,<span style="color: #000000;">70</span>,<span style="color: #000000;">50</span>,<span style="color: #000000;">70</span> ;<br />&nbsp; &nbsp; &nbsp; pictures <span style="color: #ff0000;">'999'</span>,<span style="color: #ff0000;">'mmm dd, yyyy'</span>, <span style="color: #ff0000;">"9999.99"</span> ;<br />&nbsp; &nbsp; &nbsp; array aData lines cell fastedit footers<br /><br />&nbsp; &nbsp;AEval<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aCols</span>, <span style="color: #000000;">&#123;</span> |o| o:<span style="color: #000000;">nEditType</span> := EDIT_GET <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;WITH OBJECT oBrw:<span style="color: #000000;">tipo</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nEditType</span> &nbsp; &nbsp; &nbsp; &nbsp;:= EDIT_LISTBOX<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">aEditListBound</span> &nbsp; := ;<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">aEditListTxt</span> &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"NOV"</span>, <span style="color: #ff0000;">"NTO"</span>, <span style="color: #ff0000;">"TOR"</span>, <span style="color: #ff0000;">"VAC"</span>, <span style="color: #ff0000;">"VAQ"</span>, <span style="color: #ff0000;">"TM "</span>, <span style="color: #ff0000;">"TH "</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;END<br />&nbsp; &nbsp;WITH OBJECT oBrw:<span style="color: #000000;">cuatro</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nFooterType</span> &nbsp; &nbsp; &nbsp;:= AGGR_TOTAL<br />&nbsp; &nbsp;END<br /><br />&nbsp; &nbsp;WITH OBJECT oBrw<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bClrStd</span> &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">KeyNo</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> % <span style="color: #000000;">2</span> == <span style="color: #000000;">0</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> CLR_BLACK, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">224</span>, <span style="color: #000000;">236</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> CLR_BLACK, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">189</span>, <span style="color: #000000;">211</span>, <span style="color: #000000;">253</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bPastEof</span> &nbsp;:= <span style="color: #000000;">&#123;</span> || AddRow<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bKeyDown</span> := <span style="color: #000000;">&#123;</span>| nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_DELETE, DelRow<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;END<br /><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">165</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">' + '</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>,<span style="color: #000000;">12</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> AddRow<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">165</span>, <span style="color: #000000;">60</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">' - '</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>,<span style="color: #000000;">12</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">action</span> DelRow<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">165</span>,<span style="color: #000000;">220</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">'Close'</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>,<span style="color: #000000;">12</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> AddRow<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">static</span> n := <span style="color: #000000;">0</span><br /><br />&nbsp; &nbsp;AAdd<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aArrayData</span>, <span style="color: #000000;">&#123;</span> n, date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>+n, <span style="color: #ff0000;">"NOV"</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;n++<br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">GoBottom</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> DelRow<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> oBrw:<span style="color: #000000;">nLen</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; ADel<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aArrayData</span>, oBrw:<span style="color: #000000;">nArrayAt</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; ASize<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aArrayData</span>, oBrw:<span style="color: #000000;">nLen</span> - <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:h9qin3te] Gracias, Salu2, Ariel.
xbrowse y totales
Ariel... [code=fw:11sqh1wi]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> DelRow<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> oBrw:<span style="color: #000000;">nLen</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; ADel<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aArrayData</span>, oBrw:<span style="color: #000000;">nArrayAt</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; ASize<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aArrayData</span>, oBrw:<span style="color: #000000;">nLen</span> - <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:11sqh1wi]
xbrowse y totales
Como puedo obtener las sumas, datos o valores de los footers del xbrowse,
xbrowse+ADO NO REFRESCA EL BROWSE
Hola Amigos Tengo lo siguiente en un xbrowse con recordset de detalle si ya tiene registros y le agrego mas, lo muestra sin problema... peroooooo mi problema es al ingresar un maestro(cabecera) nuevo obviamente muestra el browse vacío y al irle agregando nuevos en el detalle no los muestra no refresca, mas si los graba Ya intente de todo hasta asignarle otro recordset y nada. [code=fw:1ra190q0]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> GrabaDatos<span style="color: #000000;">&#40;</span>cAccion<span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CapturaDet<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"A"</span>,cClave,oDlg,@oGet<span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oRsDetOrdSrv:<span style="color: #000000;">close</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; scopeorden<span style="color: #000000;">&#40;</span>cClave<span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oBrwDet:<span style="color: #0000ff;">ReFresh</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; oDlg:<span style="color: #0000ff;">update</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; oSay<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,;<br />&nbsp;</div>[/code:1ra190q0] [code=fw:1ra190q0]<div class="fw" id="{CB}" style="font-family: monospace;"><br />STAT FUNC scopeOrden<span style="color: #000000;">&#40;</span>cClave2<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cSQL := <span style="color: #ff0000;">"SELECT * FROM &nbsp;detordsrv &nbsp;WHERE &nbsp;ORDENSRV = '"</span> + cClave2 +<span style="color: #ff0000;">"'"</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oRsDetOrdSrv := TOleAuto<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ADODB.Recordset"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oRsDetOrdSrv:<span style="color: #000000;">CursorType</span> := <span style="color: #000000;">1</span> <span style="color: #B900B9;">// opendkeyset</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oRsDetOrdSrv:<span style="color: #000000;">CursorLocation</span> := <span style="color: #000000;">3</span> <span style="color: #B900B9;">// local cache</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oRsDetOrdSrv:<span style="color: #000000;">LockType</span> := <span style="color: #000000;">3</span> <span style="color: #B900B9;">// lockoportunistic</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">TRY</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oRsDetOrdSrv:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span>cSQL,oApp:<span style="color: #000000;">oCon</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CATCH oErr<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Error al abrir la detOrdSrv "</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ShowError<span style="color: #000000;">&#40;</span>oErr<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span>.F.<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; END <span style="color: #00C800;">TRY</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">/* &nbsp; do while !oRsDetOrdSrv:eof()<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;? oRsDetOrdSrv:fields("CONTENEDOR"):value<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oRsDetOrdSrv:movenext()<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; enddo<br />*/</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// &nbsp; &nbsp; oRsDetOrdSrv:moveFIRST()</span><br /><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br />&nbsp;</div>[/code:1ra190q0]
xbrowse+ADO NO REFRESCA EL BROWSE
Hola Miguel Discúlpame si no lo entiendo, ya que no lo veo, añades registros ¿dónde? ¿en el Xbrowse, o en un diálogo y luego quieres ver el registro en el Xbrowse? Si lo añades en el Xbrowse, deberías de poner como lo haces, para que veamos, si podemos, por qué no se muestra. Y si lo haces en un diálogo lo más lógico es que refresques el xBrowse. Tampoco nos dices si las columnas del xbrowse es el recordset o un array. En fin, danos algo más de información.
xbrowse+ADO NO REFRESCA EL BROWSE
Gracias por tu interés Pedro y tienes razon debì ilustrarlos con mas codigo lo que se me vino a la mente es el que como funciona cuando ya existen registros del detalle solo les puse lo que hago cuando añado un maestro (cabecera) nuevo. [code=fw:14qua91m]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />oBrwDet := TxBrowse<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> oDlg <span style="color: #000000;">&#41;</span><br />oBrwDet:<span style="color: #000000;">nHeaderLines</span> := <span style="color: #000000;">1</span><br />oBrwDet:<span style="color: #000000;">lAllowColSwapping</span> :=.F.<br />oBrwDet:<span style="color: #000000;">nColSel</span> := <span style="color: #000000;">1</span><br />oBrwDet:<span style="color: #000000;">nRowHeight</span> := <span style="color: #000000;">18</span><br />oBrwDet:<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLROW<br /><span style="color: #B900B9;">//oBrwDet:nMarqueeStyle &nbsp; &nbsp;:= MARQSTYLE_HIGHLCELL</span><br />oBrwDet:<span style="color: #000000;">nColDividerStyle</span> := LINESTYLE_BLACK<br />oBrwDet:<span style="color: #000000;">lColDividerComplete</span> := .t.<br />oBrwDet:<span style="color: #000000;">lHScroll</span> := .f.<br />oBrwDet:<span style="color: #000000;">lFooter</span> := .t.<br /><br /><br />oCol := oBrwDet:<span style="color: #000000;">AddCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />oCol:<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"CONTENEDOR"</span><br />oCol:<span style="color: #000000;">bStrData</span> := <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oBrwDet:<span style="color: #000000;">oRs</span>:<span style="color: #000000;">Eof</span>, Space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">10</span> <span style="color: #000000;">&#41;</span>,oBrwDet:<span style="color: #000000;">oRs</span>:<span style="color: #000000;">fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"CONTENEDOR"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">value</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br />oCol:<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">150</span><br />oCol:<span style="color: #000000;">nDataStrAlign</span>:= AL_LEFT<br />oCol:<span style="color: #000000;">nHeadStrAlign</span>:= AL_LEFT<br />oCol:<span style="color: #000000;">lAllowSizing</span> :=.F.<br /><br /><br />oCol := oBrwDet:<span style="color: #000000;">AddCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />oCol:<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"TIPO"</span><br />oCol:<span style="color: #000000;">bStrData</span> := <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oBrwDet:<span style="color: #000000;">oRs</span>:<span style="color: #000000;">Eof</span>, Space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">10</span> <span style="color: #000000;">&#41;</span>,oBrwDet:<span style="color: #000000;">oRs</span>:<span style="color: #000000;">fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"TIPO"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">value</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br />oCol:<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">50</span><br />oCol:<span style="color: #000000;">nDataStrAlign</span>:= AL_RIGHT<br />oCol:<span style="color: #000000;">nHeadStrAlign</span>:= AL_RIGHT<br />oCol:<span style="color: #000000;">lAllowSizing</span> :=.F.<br /><br /><br />oCol := oBrwDet:<span style="color: #000000;">AddCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />oCol:<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"CONCEPTO"</span><br />oCol:<span style="color: #000000;">bStrData</span> := <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oBrwDet:<span style="color: #000000;">oRs</span>:<span style="color: #000000;">Eof</span>, Space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">10</span> <span style="color: #000000;">&#41;</span>,oBrwDet:<span style="color: #000000;">oRs</span>:<span style="color: #000000;">fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"CONCEPTO"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">value</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />oCol:<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">200</span><br />oCol:<span style="color: #000000;">nDataStrAlign</span>:= AL_LEFT<br />oCol:<span style="color: #000000;">nHeadStrAlign</span>:= AL_LEFT<br />oCol:<span style="color: #000000;">lAllowSizing</span> :=.F.<br /><br />oCol := oBrwDet:<span style="color: #000000;">AddCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />oCol:<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"IMPORTE"</span><br />oCol:<span style="color: #000000;">bStrData</span> := <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oBrwDet:<span style="color: #000000;">oRs</span>:<span style="color: #000000;">Eof</span>, Space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">10</span> <span style="color: #000000;">&#41;</span>,TRANS<span style="color: #000000;">&#40;</span>oBrwDet:<span style="color: #000000;">oRs</span>:<span style="color: #000000;">fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"PRECIOUNI"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">value</span> ,<span style="color: #ff0000;">"@ 999,999,999.99"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />oCol:<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">120</span><br />oCol:<span style="color: #000000;">nDataStrAlign</span>:= AL_LEFT<br />oCol:<span style="color: #000000;">nHeadStrAlign</span>:= AL_LEFT<br />oCol:<span style="color: #000000;">lAllowSizing</span> :=.F.<br /><br />oCol := oBrwDet:<span style="color: #000000;">AddCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />oCol:<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"FOLIO FACTURA"</span><br />oCol:<span style="color: #000000;">bStrData</span> := <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oBrwDet:<span style="color: #000000;">oRs</span>:<span style="color: #000000;">Eof</span>, Space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">10</span> <span style="color: #000000;">&#41;</span>,oBrwDet:<span style="color: #000000;">oRs</span>:<span style="color: #000000;">fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"FACTURA"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">value</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />oCol:<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">120</span><br />oCol:<span style="color: #000000;">nDataStrAlign</span>:= AL_LEFT<br />oCol:<span style="color: #000000;">nHeadStrAlign</span>:= AL_LEFT<br />oCol:<span style="color: #000000;">lAllowSizing</span> :=.F.<br /><br />&nbsp; &nbsp;oBrwDet:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">01</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">AddResource</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'UNCHECK'</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrwDet:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">01</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">AddResource</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'CHECK'</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrwDet:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">01</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bBmpData</span>:=<span style="color: #000000;">&#123;</span> || iif<span style="color: #000000;">&#40;</span> oBrwDet:<span style="color: #000000;">oRs</span>:<span style="color: #000000;">fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"marcar"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">value</span> = <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;oBrwDet:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">01</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cHeader</span> &nbsp; &nbsp; &nbsp; := <span style="color: #ff0000;">'Facturar'</span><br />&nbsp; &nbsp;oBrwDet:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">01</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nHeadBmpAlign</span> := AL_CENTER<br />&nbsp; &nbsp;oBrwDet:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">01</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bLDClickData</span>:=<span style="color: #000000;">&#123;</span> ||<span style="color: #000000;">&#40;</span>IIF<span style="color: #000000;">&#40;</span> empty<span style="color: #000000;">&#40;</span>oBrwDet:<span style="color: #000000;">oRs</span>:<span style="color: #000000;">fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"factura"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">value</span><span style="color: #000000;">&#41;</span>,CambiaStatusDetOrd<span style="color: #000000;">&#40;</span>@nSuma<span style="color: #000000;">&#41;</span>,.t.<span style="color: #000000;">&#41;</span>,oBrwDet:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br /><br />oBrwDet:<span style="color: #000000;">SetADO</span><span style="color: #000000;">&#40;</span>oRsDetOrdSrv<span style="color: #000000;">&#41;</span><br /><br />oBrwDet:<span style="color: #000000;">CreateFromResource</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">117</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp;</div>[/code:14qua91m] te comento que inserto directamente en la tabla , sin problemas, el detalle esta en el pintado del xbrowse. en otras palabras cuando es un nuevo maestro lo muestra vacío, le añado registros y lo sigue mostrando vacío así le añada 3,4,5 , si me salgo al dialogo maestro y regreso al detalle ya me aparecen todos los que agregué y si agrego otro lo muestra sin problema [code=fw:14qua91m]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp; &nbsp;cCmdSql := armaCadenaInsert<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"DetOrdSrv"</span>,aCampos,aValores<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">TRY</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oApp:<span style="color: #000000;">oCon</span>:<span style="color: #000000;">Execute</span><span style="color: #000000;">&#40;</span>cCmdSql<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CATCH oError<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"No se pudo INSERTAR la tabla DetordSrv "</span>,oApp:<span style="color: #000000;">cAplicacion</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ShowError<span style="color: #000000;">&#40;</span>oError<span style="color: #000000;">&#41;</span><br />&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;END<br />&nbsp;</div>[/code:14qua91m]
xbrowse+ADO NO REFRESCA EL BROWSE
Hola Miguel No veo por ningún lado el fastedit ni el bpasteof(), tampoco en las columnas el bOnpostEdit. La verdad es que nunca he intentado grabar directamente sobre la tabla, ya que soy muy mal pensado y creo que el usuario es tan ¿==(=)/(%%$% que cuando está terminando el albarán o la factura, va y dice que quiere cancelar lo que ha hecho, de esa manera tengo que borrar los registros y empaquetar la tabla, un fastidio cuando estas en ambiente multiusuario, así que prefiero hacerlo en un array o en una tabla temporal. Como es lógico tanto el array como la tabla temporal están vacíos cuando es una nueva factura o albarán. Aqui te pongo como lo hago yo y no tengo ningún problema. Para una tabla temporal. [code=fw:sd2nh9ku]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; oBrw = TXBrowse<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> oDlgAlb <span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">nColDividerStyle</span> &nbsp; &nbsp;:= LINESTYLE_BLACK<br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">nRowDividerStyle</span> &nbsp; &nbsp;:= LINESTYLE_BLACK<br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">lRecordSelector</span> &nbsp; &nbsp; := .t.<br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">nHeaderLines</span> &nbsp; &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">1</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">nDataLines</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp;oBrw:<span style="color: #000000;">nRowSel</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp;oBrw:<span style="color: #000000;">nMarqueeStyle</span> &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">3</span> <span style="color: #B900B9;">//Highlight row //MARQSTYLE_HIGHLCELL</span><br />&nbsp; &nbsp; &nbsp;oBrw:<span style="color: #000000;">bClrSelFocus</span> &nbsp; &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span>||<span style="color: #000000;">&#123;</span>CLR_WHITE,RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">176</span>,<span style="color: #000000;">196</span>,<span style="color: #000000;">222</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">cAlias</span> := cAlias1<br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">bClrStd</span> := <span style="color: #000000;">&#123;</span>|| <span style="color: #000000;">&#123;</span> nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">255</span>,<span style="color: #000000;">248</span>,<span style="color: #000000;">220</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #B900B9;">// colores para lineas normales </span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">bClrSel</span> := <span style="color: #000000;">&#123;</span>|| <span style="color: #000000;">&#123;</span> nRGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">241</span>,<span style="color: #000000;">222</span>,<span style="color: #000000;">088</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #B900B9;">// para barra de linea selecc cuando el control no tiene el foco </span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">bClrSelFocus</span> := <span style="color: #000000;">&#123;</span>|| <span style="color: #000000;">&#123;</span> nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">248</span>,<span style="color: #000000;">195</span>, <span style="color: #000000;">34</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #B900B9;">// para barra de linea selecc cuando el control tiene el foco </span><br /><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">lFastEdit</span> &nbsp;:= .T.<br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">bPastEof</span> = <span style="color: #000000;">&#123;</span>|| <span style="color: #000000;">&#40;</span>cAlias1<span style="color: #000000;">&#41;</span>-><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>, oBrw:<span style="color: #000000;">GoLeftMost</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,oBrw:<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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 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: #00C800;">Edit</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">//agrega registro y "oprime" enter</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp;oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oCol:<span style="color: #000000;">bStrData</span> &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> ||<span style="color: #000000;">&#40;</span>cAlias1<span style="color: #000000;">&#41;</span>->codigo <span style="color: #000000;">&#125;</span> <br />&nbsp; &nbsp;oCol:<span style="color: #000000;">nEditType</span> &nbsp; &nbsp; := EDIT_GET<br />&nbsp; &nbsp;oCol:<span style="color: #000000;">cHEADER</span> &nbsp; &nbsp; &nbsp; := <span style="color: #ff0000;">"CODIGO"</span> <br />&nbsp; &nbsp;oCol:<span style="color: #000000;">bOnPostEdit</span> &nbsp; := <span style="color: #000000;">&#123;</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> RecCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span>,<span style="color: #000000;">&#40;</span> DbAppend<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span> ,; <br />&nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_RETURN, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span>BArticulo<span style="color: #000000;">&#40;</span>oBrw,xVal,<span style="color: #ff0000;">"CODIGO"</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>cAlias1<span style="color: #000000;">&#41;</span>->importe := Importe<span style="color: #000000;">&#40;</span>oBrw,<span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#40;</span>cAlias1<span style="color: #000000;">&#41;</span>-><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>,oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,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: #00C800;">Edit</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_ESCAPE .and. Empty<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>cAlias1<span style="color: #000000;">&#41;</span>->codigo<span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span>cAlias1<span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>dbDelete<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#40;</span>cAlias1<span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>__dbPack<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#40;</span>cAlias1<span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>dbGoBottom<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp;oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oCol:<span style="color: #000000;">bStrData</span> &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> ||<span style="color: #000000;">&#40;</span>cAlias1<span style="color: #000000;">&#41;</span>->CONCEPTO<span style="color: #000000;">&#125;</span>&nbsp; &nbsp; <br />&nbsp; &nbsp;oCol:<span style="color: #000000;">nEditType</span> &nbsp; &nbsp; := EDIT_GET<br />&nbsp; &nbsp;oCol:<span style="color: #000000;">cHEADER</span> &nbsp; &nbsp; &nbsp; := <span style="color: #ff0000;">"CONCEPTO"</span> <br />&nbsp; &nbsp;oCol:<span style="color: #000000;">bOnPostEdit</span> = <span style="color: #000000;">&#123;</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> RecCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span>, DbAppend<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: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_RETURN, <span style="color: #000000;">&#40;</span>cAlias1<span style="color: #000000;">&#41;</span>->CONCEPTO := xVal ,<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span> <br />&nbsp; &nbsp; <br />&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp;oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oCol:<span style="color: #000000;">bStrData</span> &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> ||Transform<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span>cAlias1<span style="color: #000000;">&#41;</span>->CANTIDAD,<span style="color: #ff0000;">"999,999.99"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>&nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp;oCol:<span style="color: #000000;">nDataStrAlign</span> := <span style="color: #000000;">1</span> <span style="color: #B900B9;">//alineado a la derecha </span><br />&nbsp; &nbsp;oCol:<span style="color: #000000;">nEditType</span> &nbsp; &nbsp; := EDIT_GET<br />&nbsp; &nbsp;oCol:<span style="color: #000000;">cHEADER</span> &nbsp; &nbsp; &nbsp; := <span style="color: #ff0000;">"CANTIDAD"</span> <br />&nbsp; &nbsp;oCol:<span style="color: #000000;">bOnPostEdit</span> = <span style="color: #000000;">&#123;</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> RecCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span>, DbAppend<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: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_RETURN, <span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span>cAlias1<span style="color: #000000;">&#41;</span>->CANTIDAD := Val<span style="color: #000000;">&#40;</span>xVal<span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp;<span style="color: #00C800;">If</span> <span style="color: #000000;">&#40;</span> Val<span style="color: #000000;">&#40;</span>xVal<span style="color: #000000;">&#41;</span> <> <span style="color: #000000;">0</span>, <span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>cAlias1<span style="color: #000000;">&#41;</span>->importe := Importe<span style="color: #000000;">&#40;</span>oBrw,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> ,<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />................................etc &nbsp; &nbsp; &nbsp; <br />&nbsp;</div>[/code:sd2nh9ku] Para un Array. ( En realidad es el mismo programa la única diferencia es que el código de más arriba es para dbfs y el de abajo es con ado y acces) [code=fw:sd2nh9ku]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; oBrw = TXBrowse<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> oDlgAlb <span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">SetArray</span><span style="color: #000000;">&#40;</span>aLinVentas,.T.,<span style="color: #000000;">0</span>,.F.<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">nColDividerStyle</span> &nbsp; &nbsp;:= LINESTYLE_BLACK<br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">nRowDividerStyle</span> &nbsp; &nbsp;:= LINESTYLE_BLACK<br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">lRecordSelector</span> &nbsp; &nbsp; := .t.<br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">nHeaderLines</span> &nbsp; &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">1</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">nDataLines</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp;oBrw:<span style="color: #000000;">nRowSel</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp;oBrw:<span style="color: #000000;">nMarqueeStyle</span> &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">3</span> <span style="color: #B900B9;">//Highlight row //MARQSTYLE_HIGHLCELL</span><br />&nbsp; &nbsp; &nbsp;oBrw:<span style="color: #000000;">bClrSelFocus</span> &nbsp; &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span>||<span style="color: #000000;">&#123;</span>CLR_WHITE,RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">176</span>,<span style="color: #000000;">196</span>,<span style="color: #000000;">222</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">bClrStd</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span>|| <span style="color: #000000;">&#123;</span> nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">255</span>,<span style="color: #000000;">248</span>,<span style="color: #000000;">220</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #B900B9;">// colores para lineas normales </span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">bClrSel</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span>|| <span style="color: #000000;">&#123;</span> nRGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span>,<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">241</span>,<span style="color: #000000;">222</span>,<span style="color: #000000;">088</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #B900B9;">// para barra de linea selecc cuando el control no tiene el foco </span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">bClrSelFocus</span> &nbsp; &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span>|| <span style="color: #000000;">&#123;</span> nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">248</span>,<span style="color: #000000;">195</span>, <span style="color: #000000;">34</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #B900B9;">// para barra de linea selecc cuando el control tiene el foco </span><br /><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">lFastEdit</span> &nbsp;:= .T.<br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">bPastEof</span> = <span style="color: #000000;">&#123;</span>|| &nbsp;InsertRow<span style="color: #000000;">&#40;</span>oBrw<span style="color: #000000;">&#41;</span> ,oBrw:<span style="color: #000000;">GoLeftMost</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,oBrw:<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; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 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: #00C800;">Edit</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">//agrega registro y "oprime" enter</span><br /><br />&nbsp; &nbsp;oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oCol:<span style="color: #000000;">bStrData</span> &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> || aLinVentas<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nArrayAt</span>,<span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#125;</span> &nbsp; <br />&nbsp; &nbsp;oCol:<span style="color: #000000;">nEditType</span> &nbsp; &nbsp; := EDIT_GET<br />&nbsp; &nbsp;oCol:<span style="color: #000000;">cHEADER</span> &nbsp; &nbsp; &nbsp; := <span style="color: #ff0000;">"ARTICULO"</span> <br />&nbsp; &nbsp;oCol:<span style="color: #000000;">bOnPostEdit</span> &nbsp; := <span style="color: #000000;">&#123;</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> Empty<span style="color: #000000;">&#40;</span>aLinVentas<span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#40;</span> InsertRow<span style="color: #000000;">&#40;</span>oBrw<span style="color: #000000;">&#41;</span>, oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span> ,; <br />&nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_RETURN, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span>BArticulo<span style="color: #000000;">&#40;</span>oBrw,xVal,<span style="color: #ff0000;">"CODIGO"</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#40;</span>aLinVentas<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nArrayAt</span>,<span style="color: #000000;">9</span><span style="color: #000000;">&#93;</span> := Importe<span style="color: #000000;">&#40;</span>oBrw,<span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;InsertRow<span style="color: #000000;">&#40;</span>oBrw<span style="color: #000000;">&#41;</span>,oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_ESCAPE .and. Empty<span style="color: #000000;">&#40;</span>aLinVentas<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nArrayAt</span>,<span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span>DeleteRow<span style="color: #000000;">&#40;</span>oBrw<span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp;oCol:<span style="color: #000000;">nArrayCol</span> := <span style="color: #000000;">1</span><br />*------------------------------------------------------------------------------- &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp;oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oCol:<span style="color: #000000;">bStrData</span> &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> || aLinVentas<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nArrayAt</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;oCol:<span style="color: #000000;">nEditType</span> &nbsp; &nbsp; := EDIT_GET<br />&nbsp; &nbsp;oCol:<span style="color: #000000;">cHEADER</span> &nbsp; &nbsp; &nbsp; := <span style="color: #ff0000;">"DESCRIPCIÓN"</span> <br />&nbsp; &nbsp;oCol:<span style="color: #000000;">bOnPostEdit</span> = <span style="color: #000000;">&#123;</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> Empty<span style="color: #000000;">&#40;</span>aLinVentas<span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span>InsertRow<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_RETURN, aLinVentas<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nArrayAt</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> := xVal ,<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <br />&nbsp; &nbsp;oCol:<span style="color: #000000;">nArrayCol</span> := <span style="color: #000000;">2</span> &nbsp; &nbsp; <br />*------------------------------------------------------------------------------- &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp;oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oCol:<span style="color: #000000;">bStrData</span> &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> ||Transform<span style="color: #000000;">&#40;</span> aLinVentas<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nArrayAt</span>,<span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span>,<span style="color: #ff0000;">"999,999.99"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>&nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp;oCol:<span style="color: #000000;">nDataStrAlign</span> := <span style="color: #000000;">1</span> <span style="color: #B900B9;">//alineado a la derecha </span><br />&nbsp; &nbsp;oCol:<span style="color: #000000;">nEditType</span> &nbsp; &nbsp; := EDIT_GET<br />&nbsp; &nbsp;oCol:<span style="color: #000000;">cHEADER</span> &nbsp; &nbsp; &nbsp; := <span style="color: #ff0000;">"CANTIDAD"</span> <br />&nbsp; &nbsp;oCol:<span style="color: #000000;">bOnPostEdit</span> = <span style="color: #000000;">&#123;</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> Empty<span style="color: #000000;">&#40;</span>aLinVentas<span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span>InsertRow<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey == VK_RETURN, <span style="color: #000000;">&#40;</span> aLinVentas<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nArrayAt</span>,<span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span> := xVal,;<br />&nbsp; &nbsp;<span style="color: #00C800;">If</span> <span style="color: #000000;">&#40;</span> xVal <> <span style="color: #000000;">0</span>, <span style="color: #000000;">&#40;</span>aLinVentas<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nArrayAt</span>,<span style="color: #000000;">9</span><span style="color: #000000;">&#93;</span> := Importe<span style="color: #000000;">&#40;</span>oBrw,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> ,<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;oCol:<span style="color: #000000;">nArrayCol</span> := <span style="color: #000000;">3</span><br />..............................etc<br />&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;</div>[/code:sd2nh9ku] A ver si te sirve de algo
xbrowse+ADO NO REFRESCA EL BROWSE
Mr Miguel Salas After opening new recordset, you should assign it to oBrwDet:oRs := <newrecordset> and then call oBrwDet:Refresh()
xbrowse+ADO NO REFRESCA EL BROWSE
Hints for browsing Parent and Child tables with XBrowse using ADO. It is not necessary to close and reopen record set every time the row in parent table changes. It is easier to open full child table and keep changing oRsChild:Filter. Instead of using SQL INSERT statements, it is better to use RecordSet's AddNew() method. AddNew() method automatically updates the recordset. If we use SQL INSERT statement, we need to use ReQuery() method to read the data again into the record set. Here I give a very simple self contained example of Parent Child browse using ADO recordsets. Important part of the sample is the oBrwParent:bChange codeblock [code=fw:3np2ajvu]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; &nbsp; &nbsp;:<span style="color: #000000;">bChange</span> &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> || oRsChild:<span style="color: #000000;">Filter</span> := <span style="color: #ff0000;">"PARID="</span> + LTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> oRsParent:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ID"</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oBrwChild:<span style="color: #000000;">GoTop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrwChild:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp;</div>[/code:3np2ajvu] This sample program is fully self contained and you can just compile and run. The program creates a sample MDB ( MsAccess database ), creates parent and child tables and shows the browse. You can add parents and childs and see how it works. [code=fw:3np2ajvu]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.ch"</span><br /><br /><span style="color: #00C800;">static</span> cMdb := <span style="color: #ff0000;">"parchild.mdb"</span><br /><span style="color: #00C800;">static</span> oCn<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">if</span> ! CreateMDB<span style="color: #000000;">&#40;</span> cMdb <span style="color: #000000;">&#41;</span><br />      MsgStop<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Can not create MDB database"</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />   <span style="color: #00C800;">endif</span><br />   oCn      := FW_OpenAdoConnection<span style="color: #000000;">&#40;</span> ;<br />               <span style="color: #ff0000;">"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="</span> + ;<br />               cFilePath<span style="color: #000000;">&#40;</span> ExeName<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + cMdb + <span style="color: #ff0000;">";User ID=Admin;Password=;"</span> <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">if</span> oCn != <span style="color: #00C800;">nil</span><br />      CreateTables<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      BrowseTables<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      oCn:<span style="color: #000000;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">else</span><br />      MsgAlert<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Can not open MDB"</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> BrowseTables<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oRsParent, oRsChild<br />   <span style="color: #00C800;">local</span> oBrwParent, oBrwChild<br />   <span style="color: #00C800;">local</span> oDlg, oFont<br /><br />   oRsParent   := FW_OpenRecordSet<span style="color: #000000;">&#40;</span> oCn, <span style="color: #ff0000;">"PARENT"</span> <span style="color: #000000;">&#41;</span><br />   oRsChild    := FW_OpenRecordSet<span style="color: #000000;">&#40;</span> oCn, <span style="color: #ff0000;">"CHILD"</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;">300</span> <span style="color: #0000ff;">PIXEL</span> ;<br />      <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"ADO: PARENT CHILD BROWSE"</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br />   @ <span style="color: #000000;">30</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">XBROWSE</span> oBrwParent <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">135</span>,<span style="color: #000000;">-10</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />      DATASOURCE oRsParent <span style="color: #0000ff;">AUTOCOLS</span> HEADERS <span style="color: #ff0000;">"ID"</span>, <span style="color: #ff0000;">"Parent"</span> ;<br />      COLSIZES <span style="color: #000000;">40</span> CELL LINES NOBORDER FASTEDIT<br /><br />   WITH OBJECT oBrwParent<br />      :<span style="color: #000000;">lHScroll</span>                  := .f.<br />      :<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;">nEditType</span>      := EDIT_GET<br />      :<span style="color: #000000;">nStretchCol</span>               := <span style="color: #000000;">2</span><br />      :<span style="color: #000000;">bChange</span>    := <span style="color: #000000;">&#123;</span> || oRsChild:<span style="color: #000000;">Filter</span> := <span style="color: #ff0000;">"PARID="</span> + LTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> oRsParent:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ID"</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, ;<br />                          oBrwChild:<span style="color: #000000;">GoTop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrwChild:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />      :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   END<br /><br />   @ <span style="color: #000000;">30</span>,<span style="color: #000000;">146</span> <span style="color: #0000ff;">XBROWSE</span> oBrwChild <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-10</span>,<span style="color: #000000;">-10</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />      DATASOURCE oRsChild <span style="color: #0000ff;">AUTOCOLS</span> HEADERS <span style="color: #ff0000;">"ID"</span>, <span style="color: #ff0000;">"ParID"</span>, <span style="color: #ff0000;">"Child"</span> ;<br />      COLSIZES <span style="color: #000000;">40</span>, <span style="color: #000000;">40</span> CELL LINES NOBORDER FASTEDIT<br /><br />   WITH OBJECT oBrwChild<br />      :<span style="color: #000000;">lHScroll</span>                  := .f.<br />      :<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;">nEditType</span>      := EDIT_GET<br />      :<span style="color: #000000;">nStretchCol</span>               := <span style="color: #000000;">3</span><br />      :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   END<br /><br />   @ <span style="color: #000000;">10</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"AddParent"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">60</span>,<span style="color: #000000;">12</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> AddParent<span style="color: #000000;">&#40;</span> oBrwParent <span style="color: #000000;">&#41;</span><br />   @ <span style="color: #000000;">10</span>,oBrwChild:<span style="color: #000000;">nLeft</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"AddChild"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">60</span>,<span style="color: #000000;">12</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />      <span style="color: #0000ff;">ACTION</span> AddChild<span style="color: #000000;">&#40;</span> oBrwChild, oBrwParent <span style="color: #000000;">&#41;</span><br /><br />   Eval<span style="color: #000000;">&#40;</span> oBrwParent:<span style="color: #000000;">bChange</span> <span style="color: #000000;">&#41;</span><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 />   oRsParent:<span style="color: #000000;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   oRsChild:<span style="color: #000000;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> AddParent<span style="color: #000000;">&#40;</span> oBrwParent <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> cName := Space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">20</span> <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">if</span> MsgGet<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Enter Parent Name"</span>, <span style="color: #ff0000;">"ADD PARENT"</span>, @cName <span style="color: #000000;">&#41;</span> .and. ;<br />      ! Empty<span style="color: #000000;">&#40;</span> cName <span style="color: #000000;">&#41;</span><br /><br />      WITH OBJECT oBrwParent:<span style="color: #000000;">oRs</span><br />         :<span style="color: #000000;">AddNew</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />         :<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"NAME"</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>   := AllTrim<span style="color: #000000;">&#40;</span> cName <span style="color: #000000;">&#41;</span><br />         :<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      END<br />      oBrwParent:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      Eval<span style="color: #000000;">&#40;</span> oBrwParent:<span style="color: #000000;">bChange</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endif</span><br />   oBrwParent:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> AddChild<span style="color: #000000;">&#40;</span> oBrwChild, oBrwParent <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> cName := Space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">20</span> <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">if</span> MsgGet<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Enter Chld Name"</span>, <span style="color: #ff0000;">"ADD CHILD"</span>, @cName <span style="color: #000000;">&#41;</span> .and. ;<br />      ! Empty<span style="color: #000000;">&#40;</span> cName <span style="color: #000000;">&#41;</span><br /><br />      WITH OBJECT oBrwChild:<span style="color: #000000;">oRs</span><br />         :<span style="color: #000000;">AddNew</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />         :<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"NAME"</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>    := AllTrim<span style="color: #000000;">&#40;</span> cName <span style="color: #000000;">&#41;</span><br />         :<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"PARID"</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>   := oBrwParent:<span style="color: #000000;">oRs</span>:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ID"</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span><br />         :<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      END<br />      oBrwChild:<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 />   oBrwParent:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #B900B9;">// INITIAL CREATION OF TABLES</span><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> CreateMDB<span style="color: #000000;">&#40;</span> cMdbName <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> cFile := cFilePath<span style="color: #000000;">&#40;</span> ExeName<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + cMdbName<br />   <span style="color: #00C800;">local</span> cStr  := <span style="color: #ff0000;">"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="</span> + cFile<br />   <span style="color: #00C800;">local</span> lCreated := .f.<br />   <span style="color: #00C800;">local</span> oCat<br /><br />   FErase<span style="color: #000000;">&#40;</span> cFile <span style="color: #000000;">&#41;</span><br />   oCat  := TOleAuto<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ADOX.Catalog"</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">TRY</span><br />      oCat:<span style="color: #000000;">Create</span><span style="color: #000000;">&#40;</span> cStr <span style="color: #000000;">&#41;</span><br />      lCreated    := .t.<br />   CATCH<br />   END<br /><br /><span style="color: #00C800;">return</span> lCreated<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> CreateTables<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> cName<br /><br />   oCn:<span style="color: #000000;">Execute</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"CREATE TABLE PARENT ( ID AUTOINCREMENT PRIMARY KEY, NAME VARCHAR( 20 ) )"</span> <span style="color: #000000;">&#41;</span><br />   oCn:<span style="color: #000000;">Execute</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"CREATE TABLE CHILD ( ID AUTOINCREMENT PRIMARY KEY, PARID INT, NAME VARCHAR( 20 ) )"</span> <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">for</span> each cName in <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"Albert"</span>, <span style="color: #ff0000;">"James"</span>, <span style="color: #ff0000;">"Edward"</span>, <span style="color: #ff0000;">"John"</span> <span style="color: #000000;">&#125;</span><br />      oCn:<span style="color: #000000;">Execute</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"INSERT INTO PARENT ( NAME ) VALUES ( '"</span> + cName + <span style="color: #ff0000;">"' )"</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">next</span><br />   oCn:<span style="color: #000000;">Execute</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"INSERT INTO CHILD ( PARID, NAME ) VALUES ( 1, 'David' )"</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 /> </div>[/code:3np2ajvu] [url=http&#58;//img707&#46;imageshack&#46;us/i/adoparent&#46;jpg/:3np2ajvu][img:3np2ajvu]http&#58;//img707&#46;imageshack&#46;us/img707/6123/adoparent&#46;jpg[/img:3np2ajvu][/url:3np2ajvu] I suggest first compile and run the program as it is.
xbrowse+ADO NO REFRESCA EL BROWSE
Aqui tienes una versión actualizada de FiveDBU (incluye todo el código fuente) que añade registros correctamente en un recordset de ADO: [url:1imw1dqz]https&#58;//code&#46;google&#46;com/p/fivewin-contributions/downloads/detail?name=fivedbu_20130530&#46;zip[/url:1imw1dqz] Como puedes comprobar, añade registros y el browse se muestra correctamente <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
xbrowse+ADO NO REFRESCA EL BROWSE
Muchas gracias por sus respuestas , voy a revisar y les cuento, saludos
xbrowse+ADO NO REFRESCA EL BROWSE
Revisa el código de la funcion RSAppendBlank( oRS ) en fivedbu.prg
xbrowse+ADO NO REFRESCA EL BROWSE
checando sus recomendaciones detecté lo siguiente: no es solo en el browse detalle, limpiando la tabla padre, tampoco muestra el primer registro agregado,(lo hace cuando cierro el dialogo y entro de nuevo) entonces concluyo que es al crear un browse:setado(oRs) con un recordset vacío cuando no se refresca. estamos cercando el problema. saludos y gracias
xbrowse+ADO NO REFRESCA EL BROWSE
Miguel, por qué no pruebas a crear un registro vacío en el recordset y lo modificas? Era lo que yo hacía cuando usaba el recordset a pelo y no me daba problemas.
xbrowse+tmysql Blank record
hi forum, somethig idea, i used xbrowse+tmysql(contrib) and this is my result, ever ever at the end append blank record, see image oBrw2 := TXBrowse():New( oDlg ) oBrw2:SetMySql( oQry2, .F. ) <!-- m --><a class="postlink" href="http://imageshack.us/photo/my-images/825/recblank.jpg/">http://imageshack.us/photo/my-images/825/recblank.jpg/</a><!-- m --> [url=http&#58;//imageshack&#46;us/photo/my-images/825/recblank&#46;jpg/:7qfjmfyg][img:7qfjmfyg]http&#58;//img825&#46;imageshack&#46;us/img825/2033/recblank&#46;th&#46;jpg[/img:7qfjmfyg][/url:7qfjmfyg] Uploaded with [url=http&#58;//imageshack&#46;us:7qfjmfyg]ImageShack.us[/url:7qfjmfyg] i'm freaky, regards paco
xbrowse+tmysql Blank record
After creating xBrowse, [code=fw:2iom9ijb]<div class="fw" id="{CB}" style="font-family: monospace;">oBrw:<span style="color: #000000;">bSkip</span> := <span style="color: #000000;">&#123;</span> |n,x| x := oBrw:<span style="color: #000000;">oMySql</span>:<span style="color: #000000;">RecNo</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; oBrw:<span style="color: #000000;">oMySql</span>:<span style="color: #000000;">GoTo</span><span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Max</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, <span style="color: #0000ff;">Min</span><span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">MySql</span>:<span style="color: #000000;">LastRec</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, x + n <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">oMySql</span>:<span style="color: #000000;">RecNo</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> - x <span style="color: #000000;">&#125;</span><br />&nbsp;</div>[/code:2iom9ijb] Please try and let us know the result.
xbrowse+tmysql Blank record
hi rao, i have this error: Error description: Error BASE/1081 Error de argumento: + Args: [ 1] = N 1 [ 2] = U variable "x" is NIL then no work.. regards paco
xbrowse+tmysql Blank record
Please try this revised code instead of the above: [code=fw:1ch9lgld]<div class="fw" id="{CB}" style="font-family: monospace;">oBrw:<span style="color: #000000;">bSkip</span> := <span style="color: #000000;">&#123;</span> |n,x| x := oBrw:<span style="color: #000000;">oMySql</span>:<span style="color: #000000;">RecNo</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, ;<br />                      oBrw:<span style="color: #000000;">oMySql</span>:<span style="color: #000000;">GoTo</span><span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Max</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, ;<br />                      <span style="color: #0000ff;">Min</span><span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">MySql</span>:<span style="color: #000000;">LastRec</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, x + IfNil<span style="color: #000000;">&#40;</span> n, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, ;<br />                      oBrw:<span style="color: #000000;">oMySql</span>:<span style="color: #000000;">RecNo</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> - x <span style="color: #000000;">&#125;</span><br /> </div>[/code:1ch9lgld] Please place this code after oBrw:SetMySql(...) Please let us know if this works.
xbrowse+tmysql Blank record
RRAAOO,, many many thanks, simply amazing !!!! Works fine!!! where is the bug, in xbrowse.prg? thanks regards paco
xbrowse+tmysql Blank record
RAO, in xbrowse.prg in methos setmysql change: this -> DEFAULT ::bSkip := {| n | ::oMysql:Skip( n ) } and put this -> DEFAULT ::bSkip := { |n,x| x := ::oMySql:RecNo(), ; ::oMySql:GoTo( Max( 1, Min( ::oMySql:LastRec(), x + IfNil( n, 1 ) ) ) ), ; ::oMySql:RecNo() - x } like you said, and correct all browses automatically.. is correct? thanks paco
xbrowse+tmysql Blank record
[quote="Francisco Horta":2ixjkrwe]RAO, in xbrowse.prg in methos setmysql change: this -> DEFAULT ::bSkip := {| n | ::oMysql:Skip( n ) } and put this -> DEFAULT ::bSkip := { |n,x| x := ::oMySql:RecNo(), ; ::oMySql:GoTo( Max( 1, Min( ::oMySql:LastRec(), x + IfNil( n, 1 ) ) ) ), ; ::oMySql:RecNo() - x } like you said, and correct all browses automatically.. is correct? thanks paco[/quote:2ixjkrwe] Yes, you are correct. We have now modified xbrowse.prg. This change will be available from the next release. I thank you for testing and confirming that this is working. You may make this change in your copy of xbrowse.prg and use it for your work.
xbrowse font from footer
Mr. Linares, in xbrowse the font from footer are always the font from header! Please check the source from method PaintFooter. Wrong is oFont := ::oHeaderFont.
xbrowse mysql y los checkbox... como?
hola. tengo una tabla en mysql con un campo definido como TINyINT, lo definí asi porque no existe el boolean y necesito que en el xbrowse se vea con un checkbox, no logro hacer que dicho campo sea editable en el xbrowse. logre que se muestre como un checkbox haciendo esto: [code=fw:1yc38l4r]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; &nbsp; &nbsp; &nbsp;oCol &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= :<span style="color: #000000;">AddCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oCol:<span style="color: #000000;">cHeader</span> &nbsp; &nbsp;:= <span style="color: #ff0000;">"Estado"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oCol:<span style="color: #000000;">bStrData</span> &nbsp; := <span style="color: #000000;">&#123;</span>|| armarColumna<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">oQuery</span>, <span style="color: #000000;">3</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oCol:<span style="color: #000000;">bEditValue</span>:= <span style="color: #000000;">&#123;</span>||armarcolumna<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">oQuery</span>,<span style="color: #000000;">3</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oCol:<span style="color: #000000;">nEditType</span> &nbsp;:= EDIT_GET<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oCol:<span style="color: #000000;">setcheck</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"on"</span>,<span style="color: #ff0000;">"off"</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ocol:<span style="color: #000000;">nWidth</span>:= <span style="color: #000000;">20</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oCol:<span style="color: #000000;">lHide</span> &nbsp; &nbsp; &nbsp;:= .F.</div>[/code:1yc38l4r] Pero no logro editarlo. Podrían por favor explicarme como hacerlo? gracias.
xbrowse mysql y los checkbox... como?
Hola goosfancito Leete este post completo, alli encontraras un ejemplo, esta en ADO pero te servira, encontraras cosas importantes alli como el driver de MySql a usar y el tipo de dato a definir en la BD. <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=6&t=14911&start=0&hilit=bit">viewtopic.php?f=6&t=14911&start=0&hilit=bit</a><!-- l -->
xbrowse mysql y los checkbox... como?
[quote="Daniel Garcia-Gil":3uddo53y]Hola goosfancito Leete este post completo, alli encontraras un ejemplo, esta en ADO pero te servira, encontraras cosas importantes alli como el driver de MySql a usar y el tipo de dato a definir en la BD. <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=6&t=14911&start=0&hilit=bit">viewtopic.php?f=6&t=14911&start=0&hilit=bit</a><!-- l -->[/quote:3uddo53y] gracias.
xbrowse pintado de row completo?
cual es la data que hay que poner para que cuando mueva el cursor sobre una xbrowse marque toda la linea y no la celda? gracias.
xbrowse pintado de row completo?
Depende de lo que quieras que se vea marcado [code=fw:24bjtimo]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">DATA</span> nMarqueeStyle; &nbsp;<span style="color: #B900B9;">// Marquee style (row selected)</span><br />&nbsp; &nbsp; &nbsp; &nbsp; AS NUMERIC &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// 0 No Marquee</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// 1 Dotted cell</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// 2 Solid cell</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// 3 Highlight cell</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// 4 Highlight row & Raise Cell</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// 5 Highlight row</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// 6 Highlight row & multiselect</span></div>[/code:24bjtimo] 6 Marcar la linea entera y permite multiselect
xbrowse pintado de row completo?
es lo que utilizo, pero me marca la celda, no toda la linea y no estoy editando... [code=fw:23dofj7v]<div class="fw" id="{CB}" style="font-family: monospace;">  oBrw:= TXBROWSE<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">new</span><span style="color: #000000;">&#40;</span>oDlg<span style="color: #000000;">&#41;</span><br />      oBrw:<span style="color: #000000;">setdolphin</span><span style="color: #000000;">&#40;</span>oQry, .t., .T., <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"codigo"</span>, <span style="color: #ff0000;">"unidad"</span>, <span style="color: #ff0000;">"fecha"</span>, <span style="color: #ff0000;">"precio"</span>, <span style="color: #ff0000;">"denominacion"</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br /><br />      WITH OBJECT oBrw<br /><br />         :<span style="color: #000000;">bClrStd</span>    := <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">KeyNo</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> % <span style="color: #000000;">2</span> == <span style="color: #000000;">0</span>, ;<br />                   <span style="color: #000000;">&#123;</span> CLR_BLACK, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">224</span>, <span style="color: #000000;">236</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>, ;<br />                   <span style="color: #000000;">&#123;</span> CLR_BLACK, RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">191</span>, <span style="color: #000000;">191</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />         :<span style="color: #000000;">bClrRowFocus</span>     := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> CLR_BLACK, CLR_WHITE<span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br />         :<span style="color: #000000;">nMarqueeStyle</span>       := <span style="color: #000000;">5</span><br /><br />         :<span style="color: #000000;">nRowHeight</span>          := <span style="color: #000000;">23</span><br />         :<span style="color: #000000;">lRecordSelector</span>     := .F.<br />         :<span style="color: #000000;">lColDividerComplete</span> := .T.<br />         :<span style="color: #000000;">nRowDividerStyle</span>    := <span style="color: #000000;">4</span><br />         :<span style="color: #000000;">lHScroll</span>            := .F.<br /><br />         :<span style="color: #000000;">nStretchCol</span>         := STRETCHCOL_LAST<br />         :<span style="color: #000000;">nColDividerStyle</span>    := <span style="color: #000000;">4</span></div>[/code:23dofj7v]
xbrowse preserve existing filter.
Good day, By using the class xbrowse noticed that preexitentes filters were not being maintained during the call to xbrowse, I made a small change in class to solve the problem if you can add the xbrowse. I do not know if the code is well written, can adapt to better performace. Thank U. xbrowse.prg [code=fw:16yi2kpm]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">METHOD</span> RddIncrFilter<span style="color: #000000;">&#40;</span> cExpr, uSeek <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TXBrowse<br /><br />   <span style="color: #00C800;">local</span> oBrw     := <span style="color: #00C800;">Self</span><br />   <span style="color: #00C800;">local</span> lFound   := .f.<br />   <span style="color: #00C800;">local</span> cKey<br />   <span style="color: #00C800;">local</span> cFilter<br /><br />   <span style="color: #00C800;">if</span> ::<span style="color: #000000;">bFilterExp</span> == <span style="color: #00C800;">nil</span><br />      <span style="color: #00C800;">DEFAULT</span> ::<span style="color: #000000;">cFilterFld</span>   := OrdKey<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      cKey  := ::<span style="color: #000000;">cFilterFld</span><br />      <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lSQLRDD</span><br />         <span style="color: #00C800;">if</span> Empty<span style="color: #000000;">&#40;</span> cExpr <span style="color: #000000;">&#41;</span><br />            cFilter  := <span style="color: #ff0000;">""</span><br />         <span style="color: #00C800;">else</span><br />            cExpr := <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lSeekWild</span>, <span style="color: #ff0000;">"'%"</span>, <span style="color: #ff0000;">"'"</span> <span style="color: #000000;">&#41;</span> + Upper<span style="color: #000000;">&#40;</span> Trim<span style="color: #000000;">&#40;</span> cExpr <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"%'"</span><br />            cFilter  := cKey + <span style="color: #ff0000;">" LIKE "</span> + cExpr<br />         <span style="color: #00C800;">endif</span><br />      <span style="color: #00C800;">else</span><br />         <span style="color: #00C800;">if</span> ValType<span style="color: #000000;">&#40;</span> &cKey <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">'C'</span><br />            <span style="color: #00C800;">if</span> ! <span style="color: #ff0000;">"UPPER"</span> $ Upper<span style="color: #000000;">&#40;</span> cKey <span style="color: #000000;">&#41;</span><br />               cKey  := <span style="color: #ff0000;">"UPPER( "</span> + cKey + <span style="color: #ff0000;">" )"</span><br />            <span style="color: #00C800;">endif</span><br />         <span style="color: #00C800;">else</span><br />            cKey  := <span style="color: #ff0000;">"CVALTOCHAR("</span> + cKey + <span style="color: #ff0000;">")"</span><br />         <span style="color: #00C800;">endif</span><br /><br />         <span style="color: #00C800;">if</span> Empty<span style="color: #000000;">&#40;</span> cExpr <span style="color: #000000;">&#41;</span><br />            cFilter     := <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span>!empty<span style="color: #000000;">&#40;</span>dbfilter<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> .and. <span style="color: #ff0000;">'.and. WildMatch'</span>$dbfilter<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, alltrim<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span>dbfilter<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">1</span>, ;<br />                           <span style="color: #00C800;">at</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'.and. WildMatch'</span>, dbfilter<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> - <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>, <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span>empty<span style="color: #000000;">&#40;</span>dbfilter<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">'!deleted()'</span>, dbfilter<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// '!deleted()'</span><br />            oBrw:<span style="color: #000000;">gotop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />         elseif ::<span style="color: #000000;">lSeekWild</span><br />   #ifdef __XHARBOUR__<br />            cFilter     := <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span>!empty<span style="color: #000000;">&#40;</span>dbfilter<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> .and. <span style="color: #ff0000;">'.and. WildMatch'</span>$dbfilter<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, alltrim<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span>dbfilter<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">1</span>, ;<br />                           <span style="color: #00C800;">at</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'.and. WildMatch'</span>, dbfilter<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> - <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>, dbfilter<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// '!deleted()'</span><br />            cFilter     := cFilter + <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span>!empty<span style="color: #000000;">&#40;</span>dbfilter<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">' .and. '</span>, <span style="color: #ff0000;">''</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">'WildMatch("*'</span> + Upper<span style="color: #000000;">&#40;</span> Trim<span style="color: #000000;">&#40;</span> cExpr <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">'*",'</span> + cKey + <span style="color: #ff0000;">')'</span><br />   #else<br />            cFilter     := dbfilter<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> + <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span>!empty<span style="color: #000000;">&#40;</span>dbfilter<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">' .and. '</span>, <span style="color: #ff0000;">''</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">'HB_WildMatch("*'</span> + Upper<span style="color: #000000;">&#40;</span> Trim<span style="color: #000000;">&#40;</span> cExpr <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">'*",'</span> + cKey + <span style="color: #ff0000;">')'</span><br />   #endif<br />         <span style="color: #00C800;">else</span><br />            cFilter     := <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span>!empty<span style="color: #000000;">&#40;</span>dbfilter<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> .and. <span style="color: #ff0000;">'.and. WildMatch'</span>$dbfilter<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, alltrim<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span>dbfilter<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">1</span>, ;<br />                           <span style="color: #00C800;">at</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'.and. WildMatch'</span>, dbfilter<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> - <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>, dbfilter<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// '!deleted()'</span><br />            cFilter     := cFilter + <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span>!empty<span style="color: #000000;">&#40;</span>dbfilter<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">' .and. '</span>, <span style="color: #ff0000;">''</span><span style="color: #000000;">&#41;</span> + cKey + <span style="color: #ff0000;">'="'</span> + Upper<span style="color: #000000;">&#40;</span> Trim<span style="color: #000000;">&#40;</span> cExpr <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">'"'</span><br />         <span style="color: #00C800;">endif</span><br />      <span style="color: #00C800;">endif</span><br /><br /><span style="color: #B900B9;">/*<br />         if Empty( cExpr )<br />            cFilter     := '!deleted()'<br />         elseif ::lSeekWild<br />#ifdef __XHARBOUR__<br />            cFilter     := 'WildMatch("*' + Upper( Trim( cExpr ) ) + '*",' + cKey + ')'<br />#else<br />            cFilter     := 'HB_WildMatch("*' + Upper( Trim( cExpr ) ) + '*",' + cKey + ')'<br />#endif<br />         else<br />            cFilter     := cKey + '="' + Upper( Trim( cExpr ) ) + '"'<br />         endif<br />      endif<br />*/</span><br />   <span style="color: #00C800;">else</span><br />      cFilter        := Eval<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">bFilterExp</span>, cExpr <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endif</span><br /><br />   <span style="color: #00C800;">if</span> ! ::<span style="color: #000000;">lSQLRDD</span> .and. &cFilter<br />      uSeek          := ::<span style="color: #000000;">BookMark</span><br />   <span style="color: #00C800;">endif</span><br />   SET FILTER <span style="color: #0000ff;">TO</span> &cFilter<br />   GO TOP<br />   lFound      := ::<span style="color: #000000;">KeyCount</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br /><br /><span style="color: #00C800;">return</span> lFound<br /><br /> </div>[/code:16yi2kpm]
xbrowse. bdata y array
hola. Quiero cambiar un valor en un xbrowse; intente esto y no da, como lo hago? [code=fw:3k6rur56]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; &nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">6</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bData</span> &nbsp; &nbsp;:= &nbsp;<span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">IF</span> <span style="color: #000000;">&#40;</span>aDatos<span style="color: #000000;">&#91;</span> oBrw:<span style="color: #000000;">Keyno</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>== <span style="color: #ff0000;">"21"</span>, <span style="color: #ff0000;">"Salio"</span>, <span style="color: #ff0000;">"Entro"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span></div>[/code:3k6rur56] Gracias.
xbrowse. bdata y array
oBrw:aCols[6]:bEditValue
xbrowse. bdata y array
bedit no es para cuando se quiere editar la celda?
xbrowse. bdata y array
[quote="goosfancito":3m9mi35u]bedit no es para cuando se quiere editar la celda?[/quote:3m9mi35u] No bEditValue is the codeblock for the value to be shown. Note: Use of bStrData is deprecated years ago. Instead we should use bEditValue. bEditValue can also be a SetGet block.
xbrowse. bdata y array
ok. try.
xbrowse. cada vez que toma el foco vuelve a calcular?
Hola. Mi definicion: [code=fw:106hegra]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; &nbsp; &nbsp; &nbsp;:<span style="color: #000000;">AddCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WITH object :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :<span style="color: #000000;">oheaderfont</span> &nbsp; := oFont<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :<span style="color: #000000;">cHeader</span> &nbsp; &nbsp; &nbsp; := <span style="color: #ff0000;">"Importe"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nHeadStrAlign</span> := AL_CENTER<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nDataStrAlign</span> := AL_RIGHT<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nWidth</span> &nbsp; &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">90</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :<span style="color: #000000;">odatafont</span> &nbsp; &nbsp; := oFont1<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bStrData</span> &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span>|| trans<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">importe</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">"@R 9999999.99"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;END with<br />...<br /><br /><span style="color: #B900B9;">// este metodo solo es para probar</span><br /><span style="color: #00C800;">method</span> importe<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;? <span style="color: #ff0000;">"hola"</span><br />&nbsp; &nbsp;<span style="color: #00C800;">return</span> <span style="color: #000000;">&#40;</span><span style="color: #000000;">10</span><span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:106hegra] y cada vez que toma el foco me vuelve a mostrar "hola" tantas veces como filas tenga el xbrowse ... a ver si entiendo se vuelve a ejecutar "x" veces cada vez q toma el foco? esta bien eso o estoy haciendo algo mal? gracias.
xbrowse. cada vez que toma el foco vuelve a calcular?
+1 esto sucede desde hace algunas versiones, creo q desde febrero o marzo en adelante Salu2, Ariel.
xbrowse. cada vez que toma el foco vuelve a calcular?
[quote="Ariel":1dt51gn3]esto sucede desde hace algunas versiones, creo q desde febrero o marzo en adelante[/quote:1dt51gn3] Me atreveria a decir que sucede desde siempre, es un comportamiento totalmente logico, pues las veces que un objeto toma el foco refresca su area visual, eso no exime al xbrowse, por ende cada vez que tome el foco refrescara el contenido que es visual en ese momento y si una de las columnas un dato es calculado, ejecutara el calculo por "n" lineas visibles. Aparte el ejemplo mostrado por goosfancito no ayuda mucho, este intencificara el repintado, pues por cada "?" (msginfo) que muestra, el xbrowse pierde el foco y al quitar el msginfo retoma el foco y volvera a refrescarse [quote="goosfancito":1dt51gn3] esta bien eso o estoy haciendo algo mal? gracias.[/quote:1dt51gn3] en pocas palabras, no veo nada malo con el proceso, es totalmente normal que suceda
xbrowse. cada vez que toma el foco vuelve a calcular?
[quote:2fkar3ko]Aparte el ejemplo mostrado por goosfancito no ayuda mucho, este intencificara el repintado, pues por cada "?" (msginfo) que muestra, el xbrowse pierde el foco y al quitar el msginfo retoma el foco y volvera a refrescarse[/quote:2fkar3ko] Probablemente asi ayudara a apreciar mejor el malefecto: [code=fw:2fkar3ko]<div class="fw" id="{CB}" style="font-family: monospace;"> :<span style="color: #000000;">bStrData</span>      := <span style="color: #000000;">&#123;</span>|| Time<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br /> </div>[/code:2fkar3ko]
xbrowse. definir color pero en HEXADECIMAL (solucionado)
hola. como le digo al xbrowse que una celda debe ser pintada pero con este valor: #FFFFFF gracias. Hoy dia me cuesta pensar... aca la solucion. [code=fw:3jtj9al3]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">FUNCTION</span> hextoRGB<span style="color: #000000;">&#40;</span>sCadenaHex<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> aRGB:= <span style="color: #000000;">&#123;</span> hextodec<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span>sCadenaHex,<span style="color: #000000;">2</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; &nbsp; &nbsp; hextodec<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span>sCadenaHex,<span style="color: #000000;">4</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; &nbsp; &nbsp; hextodec<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span>sCadenaHex,<span style="color: #000000;">6</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">RETURN</span> <span style="color: #000000;">&#40;</span>RGB<span style="color: #000000;">&#40;</span>aRgb<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>,aRgb<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>,aRgb<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span></div>[/code:3jtj9al3] Esto lo necesito porque tengo una tabla en donde acumulo en una columna el color que deseo que se muestre en la celda, y como el formato es mas facil para mi hacerlo asi: #00CCFF#000000 (vaya a uno saberlo porque...) es que necesitaba esa funcion para utilizarla aca: [code=fw:3jtj9al3]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp;WITH OBJECT oBrw<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :<span style="color: #000000;">cHeader</span>:= <span style="color: #ff0000;">"Item"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nWidth</span>:= <span style="color: #000000;">150</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bClrStd</span>:= <span style="color: #000000;">&#123;</span>|| <span style="color: #000000;">&#123;</span> hextoRGB<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"#000000"</span><span style="color: #000000;">&#41;</span>, hextoRGB<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"#00CCFF"</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;END</div>[/code:3jtj9al3] (ahi puse los valores, pero en realidad va un oRs:fields(0)...) gracias.
xbrowse.. y barras.
Estimados amigos.. trabajo con xbrowse.. FW13.2, xharbour,, usando tdolphin... el tema es que cuando genero el browse... no me aparecen o salen las barras horizontales y verticales... he intentado de todo pero no me salen, aca parte del codigo oBrw:=TxBrowse():New(oDlg) oBrw:nMarqueeStyle := MARQSTYLE_HIGHLROW oBrw:nColDividerStyle := LINESTYLE_RAISED oBrw:nRowDividerStyle := LINESTYLE_RAISED oBrw:bClrSelFocus := {|| { nRGB( 0, 0, 0), nRGB(128,255,128) } } oBrw:lColDividerComplete := (.t.) oBrw:nHeaderHeight := 35 oBrw:nRowHeight := 25 oBrw:nHeaderLines := 3 oBrw:nDataLines := 2 oBrw:nFooterHeight := 20 oBrw:nFooterLines := 2 oBrw:bClrHeader := {|| { nRGB(000,000,000), nRGB(128,255,128) } } oBrw:bClrStd := {|| If( oBrw:KeyNo() % 2 == 0, { CLR_BLACK, RGB( 224, 236, 255 ) }, { CLR_BLACK, RGB( 189, 211, 253 ) } ) } oBrw:bClrFooter := {|| { nRGB(000,000,000), nRGB(150,200,200) } } oBrw:bClrSel := {|| { nRGB(000,000,000), nRGB(128,255,128) } } oBrw:l2007:=.T. oBrw:lFooter := (.T.) oBrw:lHScroll := (.T.) // lo he cambiado por .F.. he sacado esta linea y nada... oBrw:lVScroll := (.T.) oBrw:nStretchCol := STRETCHCOL_WIDEST oBrw:bLDblClick := {|| Add_Producto(.F.,oBrw, cTab_Art), cTab_Art:Refresh() } oBrw:bKeyDown := { | nKey | TeclasProducto(nKey, oBrw, cTab_Art) } oBrw:oFont := oFont2 oBrw:SetDolphin(cTab_Art,.T.,.T.) alguien me orienta...no veo el error.
xbrowse.. y barras.
Yo lo hago desde el PellesC En el recurso pongo en Window Styles 0x50B00000 Saludos
xbrowse.. y barras.
Saludos, justamente uso Pelles, trabajaba con workshop y nunca me paso, pero con pelles si, disculpa la ignorancia.. en que parte puedo editar para colocar ese texto, o va en las propiedades del recurso, con workshop, se podia editar todo el recurso y aca no encuentro eso. Atte.,
xbrowse.. y barras.
[quote="kpidata":2umqt6yd]Saludos, justamente uso Pelles, trabajaba con workshop y nunca me paso, pero con pelles si, disculpa la ignorancia.. en que parte puedo editar para colocar ese texto, o va en las propiedades del recurso, con workshop, se podia editar todo el recurso y aca no encuentro eso. Atte.,[/quote:2umqt6yd] Saludos... /* styles posibles 0x50000000 -> desta forma ele fica por default com as barras Hor/Vert Ativas, ai sim, basta vc inserir no seu codigo : 0x50D00000 -> Barra Horizontal 0x50A00000 -> Barra Vertical 0x50B00000 -> Barra Horizontal e Vertical 0x50010000 -> sin barras en las propiedades del xbrowse pero el cual debe ser CUSTOM, gracias...saludos... <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: -->
xbrowse...Color a cell
I need some code to color a cell on screen and print, in an xbrowse when there is a value in the cell. Thanks
xbrowse...Color a cell
Harvey,I don't understanding what you want but, this example changes the colors of a xbrowse row:[code:1ufjriag]oBrw&#58;bClrStd &#58;= &#123;|| iif&#40; empty&#40; oBrw&#58;aCols&#91;1&#93;&#58;Value&#40;&#41; &#41; &#41;, &#123; CLR_WHITE, CLR_HGRAY &#125;, &#123; CLR_BLACK, getSysColor&#40; 5 &#41; &#125; &#41; &#125; oBrw&#58;bClrSel &#58;= &#123; || &#123; CLR_BLACK, GetSysColor&#40; COLOR_INACTIVECAPTION &#41; &#125; &#125; oBrw&#58;bClrSelFocus &#58;= &#123; || &#123; CLR_BLACK, GetSysColor&#40; COLOR_HIGHLIGHT &#41; &#125; &#125;[/code:1ufjriag]
xbrowse...Color a cell
Harvey,Maybe this is what you want?[code:35gfd5ir]FOR I = 1 TO LEN&#40;oBrw&#58;aCols&#41; oBrw&#58;aCols&#91;I&#93;&#58;bClrStd &#58;= &#123;|| &#123;CLR_BLUE, If&#40; DET->SDETAIL, CLR_YELLOW, CLR_WHITE&#41; &#125; &#125; NEXT[/code:35gfd5ir]Regards,James
xbrowse...Color a cell
Thanks for the replys. I've been out of town and not able to try suggestions. They don't seem to work.I need to color a cell (just one cell) when a variable is inacted. I'm using oBrw from resources. The variable is a calculation of several numeric variables. If the result is 500 or more, color the cell.[code:3cjp0iwj] FOR I = 1 TO LEN&#40;oBrw&#58;aCols&#41; oBrw&#58;aCols&#91;I&#93;&#58;bClrStd &#58;= &#123;|| &#123;CLR_BLUE, If&#40; DET->SDETAIL, CLR_YELLOW, CLR_WHITE&#41; &#125; &#125; NEXT [/code:3cjp0iwj] I tried this: [code:3cjp0iwj] FOR I = 1 TO LEN&#40;oBrw&#58;aCols&#41; oBrw&#58;aCols&#91;I&#93;&#58;bClrStd &#58;= &#123;|| &#123;CLR_BLUE, If&#40; nVara-nVarb, CLR_YELLOW, CLR_WHITE&#41; &#125; &#125; NEXT [/code:3cjp0iwj]At the column browse I did nothing except the same calculation.Nothing happened.Need some help. Thanks
xbrowse...Color a cell
try...[code:29i0s66p] FOR I = 1 TO LEN&#40;oBrw&#58;aCols&#41; oBrw&#58;aCols&#91;I&#93;&#58;bClrStd &#58;= &#123;|| If&#40; nVara-nVarb, &#123;CLR_BLUE, CLR_YELLOW&#125;, &#123;CLR_BLUE, CLR_WHITE &#125; &#41; &#125; NEXT [/code:29i0s66p]
xbrowse...Color a cell
[quote="hag":20b6imx4]I tried this: [code:20b6imx4] FOR I = 1 TO LEN&#40;oBrw&#58;aCols&#41; oBrw&#58;aCols&#91;I&#93;&#58;bClrStd &#58;= &#123;|| &#123;CLR_BLUE, If&#40; nVara-nVarb, CLR_YELLOW, CLR_WHITE&#41; &#125; &#125; NEXT [/code:20b6imx4] [/quote:20b6imx4]May be I'm missing something but... the function IF() does need a LOGICAL as first parameter ¿Isn't it? Something like ( nVara-nVarb ) > 500regards
xbrowse...Color a cell
Carlos is right, it needs to be a logical. Also, you need to use the data in the cell, rather than vars. Something like this:[code:3v96xdni]FOR I = 1 TO LEN&#40;oBrw&#58;aCols&#41; oBrw&#58;aCols&#91;I&#93;&#58;bClrStd &#58;= &#123;|| &#123;CLR_BLUE, If&#40; val&#40;eval&#40;oBrw&#58;aCols&#91;i&#93;&#58;bStrData&#41;&#41;>500 , CLR_YELLOW, CLR_WHITE&#41; &#125; &#125; NEXT [/code:3v96xdni] The above FOR/NEXT is only if you want all columns setup this way. If you only want one column then just do this (where i is the number of the column): [code:3v96xdni]oBrw&#58;aCols&#91;I&#93;&#58;bClrStd &#58;= &#123;|| &#123;CLR_BLUE, If&#40; val&#40;eval&#40;oBrw&#58;aCols&#91;i&#93;&#58;bStrData&#41;&#41;>500 , CLR_YELLOW, CLR_WHITE&#41; &#125; &#125;[/code:3v96xdni] Regards,James
xbrowse...Color a cell
Hello James,What happens after Col-swapping ?I think, it has to be a function.[img:1o4yu1dv]http&#58;//www&#46;pflegeplus&#46;com/pictures/cellcolor1&#46;jpg[/img:1o4yu1dv][img:1o4yu1dv]http&#58;//www&#46;pflegeplus&#46;com/pictures/cellcolor2&#46;jpg[/img:1o4yu1dv]RegardsUwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
xbrowse...Color a cell
Uwe,Good point. It would be better to define it when defining the column.[code:22k16763]oCol&#58;bClrStd &#58;= &#123;|| &#123;CLR_BLUE, If&#40; val&#40;eval&#40;oCol&#58;bStrData&#41;&#41;>500 , CLR_YELLOW, CLR_WHITE&#41; &#125; &#125;[/code:22k16763]James
xbrowse...Color a cell
Thanks all Still having problems:It colors the row perfectly with this code:[code:1yhtrn0n] oBrw&#58;bClrStd &#58;= &#123;|| &#123;CLR_BLACK,CLR_WHITE, If&#40; nVara-nVarb > 500, CLR_YELLOW, CLR_WHITE&#41; &#125; &#125; [/code:1yhtrn0n]I can't get the color confined to a single cell. I'm using xbrowse, column browse from resources and the code doesn't like oCol or aCol.Any suggsetions?
xbrowse...Color a cell
oBrw:aCols[ [b:2rv7nq83]n[/b:2rv7nq83] ]:bClrStd := {|| {CLR_BLACK,CLR_WHITE, If( oBrw:aRow[ [b:2rv7nq83] z [/b:2rv7nq83] ] > 500, CLR_YELLOW, CLR_WHITE) } }n = column get singel cell z = column into row to evalue (cell)it evalue cell by cellmy case...oBrw:aCols[ 3 ]:bClrStd := { ||{ CLR_BLACK,if (oBrw:aRow[ 1 ] = "NBA",CLR_RED,CLR_WHITE) } }[img:2rv7nq83]http&#58;//i485&#46;photobucket&#46;com/albums/rr217/danielgarciagil/brow&#46;jpg[/img:2rv7nq83]sorry my english <!-- s:oops: --><img src="{SMILIES_PATH}/icon_redface.gif" alt=":oops:" title="Embarassed" /><!-- s:oops: -->
xbrowse...Color a cell
Thanks for all the help. I have it working to highlight row but not single cell. aCol[] and aRow[] is the problem. How do i get the number of the array elements for these?
xbrowse...Color a cell
Cell-color for a certain field-value :[img:2fe5n1di]http&#58;//www&#46;pflegeplus&#46;com/pictures/brwcell1&#46;jpg[/img:2fe5n1di][code:2fe5n1di] #include "FiveWin&#46;ch" #include "xbrowse&#46;ch" #define WID 350 #define HGT 200 REQUEST DBFCDX function Main&#40;&#41; local oDlg, oBrw , oCol, nFor DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-18 USE CUSTOMER NEW SHARED VIA "DBFCDX" SET ORDER TO TAG FIRST GO TOP DEFINE DIALOG oDlg SIZE 2*WID,2*HGT PIXEL FONT oFont oBrw &#58;= TXBrowse&#40;&#41;&#58;New&#40; oDlg &#41; oBrw&#58;nMarqueeStyle &#58;= MARQSTYLE_HIGHLCELL oBrw&#58;nColDividerStyle &#58;= LINESTYLE_BLACK oBrw&#58;nRowDividerStyle &#58;= LINESTYLE_BLACK oBrw&#58;lColDividerComplete &#58;= &#46;t&#46; oCol &#58;= oBrw&#58;AddCol&#40;&#41; oCol&#58;AddResource&#40; "CLIP" &#41; oCol&#58;AddResource&#40; "star" &#41; oCol&#58;bLClickHeader = &#123; | nMRow, nMCol, nFlags, Self | ; If&#40; &#58;&#58;nHeadBmpNo == 2, &#58;&#58;nHeadBmpNo &#58;= 1, &#58;&#58;nHeadBmpNo &#58;= 2 &#41;, &#58;&#58;oBrw&#58;Refresh&#40;&#41; &#125; oCol&#58;cHeader &#58;= "CLIP" oCol&#58;nHeadBmpNo &#58;= 1 oCol&#58;nHeadBmpAlign &#58;= AL_RIGHT oCol &#58;= oBrw&#58;AddCol&#40;&#41; oCol&#58;bStrData &#58;= &#123; || _FIELD->First&#125; oCol&#58;cHeader &#58;= "First" oCol&#58;oDataFont &#58;= oFont oCol &#58;= oBrw&#58;AddCol&#40;&#41; oCol&#58;bStrData &#58;= &#123; || _FIELD->Last&#125; oCol&#58;cHeader &#58;= "Last" // ----------- Field-color ---------- oCol&#58;bClrStd &#58;= &#123; || IIF&#40; _FIELD->LAST = "Crystal", ; &#123; 16777215,128 &#125;, &#123; 16777215, 6534803 &#125; &#41; &#125; // ----------------------------------- oCol &#58;= oBrw&#58;AddCol&#40;&#41; oCol&#58;AddResource&#40;"GREEN"&#41; oCol&#58;AddResource&#40;"RED"&#41; oCol&#58;cHeader &#58;= "Married" oCol&#58;bBmpData &#58;= &#123; || iif&#40; _FIELD->Married, 1, 2&#41; &#125; oCol&#58;bStrData &#58;= &#123; || iif&#40; _FIELD->Married, "Yes", "No "&#41;&#125; oCol&#58;bEditValue &#58;= &#123; || _FIELD->Married &#125; oCol&#58;nDataStyle &#58;= oCol&#58;DefStyle&#40; AL_RIGHT, &#46;T&#46;&#41; oCol&#58;nEditType &#58;= EDIT_LISTBOX oCol&#58;aEditListTxt &#58;= &#123; "Yes", "No"&#125; oCol&#58;aEditListBound &#58;= &#123; &#46;t&#46;, &#46;f&#46; &#125; oCol&#58;bOnPostEdit &#58;= &#123;|o, v| &#40;DBRLOCK&#40;&#41;, _FIELD->Married &#58;= v, DBUNLOCK&#40;&#41; &#41; &#125; oBrw&#58;SetRDD&#40;&#41; oBrw&#58;CreateFromCode&#40;&#41; ACTIVATE DIALOG oDlg CENTER ON INIT &#40; oDlg&#58;oClient &#58;= oBrw, oDlg&#58;Resize&#40;&#41; &#41; CLOSE DATABASE RETURN NIL [/code:2fe5n1di][code]DEFINE BRUSH oBrush1 STYLE "BRICKS"oCol:oBrush := { || IIF( _FIELD->LAST = "Crystal", oBrush1, NIL ) }*oCol:bClrStd := { || IIF( _FIELD->LAST = "Crystal", { 16777215,128 }, { 16777215, 6534803 } ) } [img:2fe5n1di]http&#58;//www&#46;pflegeplus&#46;com/pictures/brwcell2&#46;jpg[/img:2fe5n1di]RegardsUwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
xbrowse...Color a cell
Uwe and all:My issue seems to be that I'm not using oCol:addCol() to set up colums. I'm using ADD COLUMN for each column and the oCol:bClrStd doesnt work. I'm using oBrw:bClrstd which places the color on the entire row. Is there a way to have it color the cell when using ADD COLUMN?
xbrowse...Color a cell
ADD COLUMN oCol TO oBrw...oCol:bClrstd:=...
xbrowse...Color a cell
James and all others thanks for the help. James: I'll send some code but so far not working.
xbrowse: caps lock plus scroll down buttons
Hello, should select multiple rows with caps lock plus scroll down button work in xBrowse? Thanks in advance Otto
xbrowse: caps lock plus scroll down buttons
Otto As you probably know you have to use the MargueeStyle below to turn on the mult-row select .. caps lock and scroll does not work but, the standard Hi-Lite first row and Shift and Click on the last row does select all rows in-between. Hope that helps? Rick Lipkin [code=fw:1ymxqevy]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oLbxA:<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLROW<br /> </div>[/code:1ymxqevy]
xbrowse: picture
Hola: estoy usando xbrowse y no se cómo darle formato a los campos para que me los muestre bien en el browse x que esto oCol:cEditPicture:="@z 999,999.99" lo respeta solo en la edición hay alguna manera de hacerlo? necesito que me muestre blancos cuando es cero.. sldos Silvina
xbrowse: picture
Yo lo tengo así : oCol:bEditValue :={|| (v:POL:cAlias)->z0Cta } oCol:cEditPicture:='@Z 999,999,999.99' funciona muy bien, tal vez tengas oCol:bStrData en lugar de oCol:bEditValue. saludos!!
xbrowse: picture
no entendí los parámetros que son, te recuerdo que lo que quiero es el picture en el browse no en la edición.. [quote="Joel Andujo":2evd8yqq]Yo lo tengo así : oCol:bEditValue :={|| (v:POL:cAlias)->z0Cta } oCol:cEditPicture:='@Z 999,999,999.99' funciona muy bien, tal vez tengas oCol:bStrData en lugar de oCol:bEditValue. saludos!![/quote:2evd8yqq]
xbrowse: picture
umm, revisando el codigo me encuentro: [code=fw:1ht2lhfn]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp;<span style="color: #00C800;">DATA</span> xEditPicture <span style="color: #00C800;">PROTECTED</span> &nbsp;<span style="color: #B900B9;">// Picture mask to be used for Get editing and display of data</span><br />&nbsp; &nbsp;ASSIGN cEditPicture<span style="color: #000000;">&#40;</span> u <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">INLINE</span> ::<span style="color: #000000;">xEditPicture</span> := u<br />&nbsp; &nbsp;ACCESS cEditPicture &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">INLINE</span> XEval<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">xEditPicture</span>, ::<span style="color: #000000;">Value</span>, <span style="color: #00C800;">Self</span> <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:1ht2lhfn] asi que en teoria el cEditPicture deberia funcionar tanto para la edicion, como para mostrarlo. salu2 carlos vargas
xbrowse: picture
Intenta con esto: [code=fw:vtylpg3e]<div class="fw" id="{CB}" style="font-family: monospace;">XbrNumFormat<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'A'</span>, .t. <span style="color: #000000;">&#41;</span><br /><br />@<span style="color: #000000;">1</span>,<span style="color: #000000;">1</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp;COLUMNS <span style="color: #ff0000;">"Texto"</span> ;<br />&nbsp; &nbsp; &nbsp;HEADERS <span style="color: #ff0000;">"TEXTO"</span> ;<br />&nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"PRUEBA"</span><br />&nbsp;</div>[/code:vtylpg3e]
xbrowse: picture
Hola, no se, para que sirve XbrNumFormat ? no hace nada... lo que yo quiero es formatear las columnas, poner el picture en los importes para que me muestre la columna como yo quiera o sea, no el ceditpicture no lo respeta, calculo que es solo para la edición [quote="FranciscoA":1dugf9em]Intenta con esto: [code=fw:1dugf9em]<div class="fw" id="{CB}" style="font-family: monospace;">XbrNumFormat<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'A'</span>, .t. <span style="color: #000000;">&#41;</span><br /><br />@<span style="color: #000000;">1</span>,<span style="color: #000000;">1</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oDlg ;<br />     COLUMNS <span style="color: #ff0000;">"Texto"</span> ;<br />     HEADERS <span style="color: #ff0000;">"TEXTO"</span> ;<br />     <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"PRUEBA"</span><br /> </div>[/code:1dugf9em][/quote:1dugf9em]
xbrowse: picture
Silvina Has intentado con TRANSFORM [code=fw:ja2xfefp]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oCol:<span style="color: #000000;">bEditValue</span> :=<span style="color: #000000;">&#123;</span>|| TRANS<span style="color: #000000;">&#40;</span>CAMPO,<span style="color: #ff0000;">"@Z 999,999.99) } <br /></span></div>[/code:ja2xfefp]
xbrowse: picture
no sé si se entendió la pregunta, quiero ponerle un formato para mostrar en el browse, no para la edición... si, utilizando trans() funciona pero me transforma la columna de nca a alfanca y luego no la reconoce el maketotal , etc [quote="acuellar":1loanjha]Silvina Has intentado con TRANSFORM [code=fw:1loanjha]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oCol:<span style="color: #000000;">bEditValue</span> :=<span style="color: #000000;">&#123;</span>|| TRANS<span style="color: #000000;">&#40;</span>CAMPO,<span style="color: #ff0000;">"@Z 999,999.99) } <br /></span></div>[/code:1loanjha][/quote:1loanjha]
xbrowse: picture
ESTABA HACIENDO ESTO oCol:=xLbx:AddCol() , oCol:cHeader:= cTitulo , oCol:bStrData := bCampo , oCol:nWidth := nAncho ) ,; AHORA HAGO oCol:=xLbx:AddColumn( cTitulo , bCampo , cPicture ,,,, nAncho , .F., .F.,,,,,, .F.,,,,, .F.,,, ) , oCol:oHeaderFont:=memvar->oDatos:oFont9 )
xbrowse: picture
Esto es lo que buscas: [quote:26vwjluj] WITH OBJECT ::oBrwCab:TotalVenta :nHeadStrAlign:= :nDataStrAlign:= AL_RIGHT :nWidth := 85 [b:26vwjluj]:cEditPicture:= "@E( 999,999,999.99"[/b:26vwjluj] END [/quote:26vwjluj]
xbrowse: too many recoursive handler calls error
Hi, a customer reported me the error in subject that was appairing after pressing the xbrowse scroll bar. I have been unable to repeat this problem.This is the image of the error:[img:3vggyxlt]http&#58;//www&#46;softwarexp&#46;co&#46;uk/beta/error&#46;gif[/img:3vggyxlt]Any ideas ?Thanks in advance.
xbrowse: too many recoursive handler calls error
Marco,Unfortunately, the first error is not visible. The second error is caused by the error handler processing the same error over and over.Can the customer repeat the error? If so, can you get them to send you a screenshot showing the first error?James
xbrowse: too many recoursive handler calls error
Unfortunately, when such errors occur, there is no way to stop the loop in errorsys. Also __sometimes__ when there are array bound problems, error appears without any clue about the offending code.These situations are very difficult to handle. I find no other way except to start with simplest code ( commenting out many other lines ) and slowly uncommenting one line after another or some other method similar to that.In most of the cases, the errors occur due to our code. Most FWH libraries assume that the variables we provide to the libraries are of valid type and are within bounds. FWH libraries do not _always_ check for validity of the values provided. May be such a check would slow down the performance. No doubt such cases do take lot of time to debug, but in all cases, I found the problem to be with my code rather than with FWH code.In this case also it is better to start with the offending browse in a separte module. Start with one column with simplest features and keep adding other features one by one till we face the problem
xbrowse: too many recoursive handler calls error
many times the error.log is generated with the original error, try reviewing it.
xbrowse: too many recoursive handler calls error
Maybe this error is the same as reported on 24/6/2006. I had never a answer and made some changes in the source from xbrowse to avoid the problem :On 24/6/2006 i reported (Bug report and fixes)Using xbrowse , i have problems with bPasteof() when the verical scroll bar is used . This bar can be used to scroll trough the database , and to put the record pointer on the last row. Now we can append with : 1) Pressing Key Down : ok it works 2) Clicking on the bottom from the vertical scroll bar WE BECOME A LOOPING FROM EXECUTING bPAstEof !!!!!!!!!!!! To test , testxbrw.prg , i changed : [code:2vbx5fb3] STATIC FUNCTION AutoEdit&#40; oWnd &#41; local oChild, oBrw, oCol local nFor DEFINE WINDOW oChild TITLE "Auto edit browse" MDICHILD OF oWnd oBrw &#58;= TXBrowse&#40;&#41;&#58;New&#40; oWnd &#41; oBrw&#58;nMarqueeStyle &#58;= MARQSTYLE_HIGHLCELL oBrw&#58;nColDividerStyle &#58;= LINESTYLE_BLACK oBrw&#58;nRowDividerStyle &#58;= LINESTYLE_BLACK oBrw&#58;lColDividerComplete &#58;= &#46;t&#46; oBrw&#58;SetRDD&#40;&#41; for nFor &#58;= 1 to len&#40; oBrw&#58;aCols &#41; oCol &#58;= oBrw&#58;aCols&#91; nFor &#93; oCol&#58;nEditType &#58;= 1 oCol&#58;bOnPostEdit &#58;= &#123;|o, v, n| iif&#40; n != VK_ESCAPE, FieldPut&#40; o&#58;nCreationOrder, v &#41;, &#41; &#125; next oBrw&#58;CreateFromCode&#40;&#41; oChild&#58;oClient &#58;= oBrw oBrw&#58;bPastEof&#40;&#41; &#58;= &#123;||msginfo&#40;"APND"&#41;&#125; // ADDED !!!!!!!!!!!! ACTIVATE WINDOW oChild ON INIT oBrw&#58;SetFocus&#40;&#41; RETURN [/code:2vbx5fb3][/code]
xbrowse: too many recoursive handler calls error
Frank and others,When you post a question and you don't get an answer, please insist and also email me directly.Sometimes we miss to answer questions, and the only way to get an answer is to insist asking for a solution, unless we publically comment that we don't know how to solve it yet.We are going to review this issue inmediately
xbrowse: too many recoursive handler calls error
If we keep pressing the down arrow of the vertical scroll bar, method godown is executed so many times and naturally the bPastEof is evaluated as many times as we keep the arrow button pressed. I think we need to expect this.
xbrowse: too many recoursive handler calls error
Here is a very simple program to append new records using bPastEof. The sample uses sales.dbf in the fwh\samples folder.[code:10n56s7t] #include 'fivewin&#46;ch' #include 'xbrowse&#46;ch' //----------------------------------------------------------------------------// function Main&#40;&#41; local oWnd, oBrw SET DELETED ON use sales alias test DEFINE WINDOW oWnd @ 0,0 XBROWSE oBrw ; ALIAS 'TEST' ; AUTOCOLS ; FASTEDIT AEval&#40; oBrw&#58;aCols, &#123; |o| o&#58;nEditType &#58;= EDIT_GET &#125; &#41; // oBrw&#58;bPastEof &#58;= &#123;||msginfo&#40;"APND"&#41;&#125; oBrw&#58;bPastEof &#58;= &#123; || AddRec&#40; oBrw &#41; &#125; oBrw&#58;bOnRowLeave &#58;= &#123; || RowLeave&#40; oBrw &#41; &#125; oBrw&#58;CreateFromCode&#40;&#41; oWnd&#58;oClient &#58;= oBrw ACTIVATE WINDOW oWnd return nil //----------------------------------------------------------------------------// static function AddRec&#40; oBrw &#41; local nRec if Empty&#40; &#40; oBrw&#58;cAlias &#41;->Date &#41; // We have already appended a blank record // user is still to edit the record // so we should not append one more record // Avoid responding to repeated multiple calls // Take no action&#46; else nRec &#58;= &#40; oBrw&#58;cAlias &#41;->&#40; RecNo&#40;&#41; &#41; &#40; oBrw&#58;cAlias &#41;->&#40; dbAppend&#40;&#41;, dbGoTo&#40; nRec &#41; &#41; oBrw&#58;GoDown&#40;&#41; // note this works when dbf is not in any index order // otherwise we need to code it differently oBrw&#58;lEdited &#58;= &#46;t&#46; endif return nil //----------------------------------------------------------------------------// static function RowLeave&#40; oBrw &#41; if Empty&#40; &#40; oBrw&#58;cAlias &#41;->Date &#41; &#46;and&#46; ; &#40; oBrw&#58;cAlias &#41;->&#40; RecNo&#40;&#41; &#41; == &#40; oBrw&#58;cAlias &#41;->&#40; LastRec&#40;&#41; &#41; // We are now leaving the last record just appended // user has not filled any valid data // we need to delete this record &#40; oBrw&#58;cAlias &#41;->&#40; DbDelete&#40;&#41; &#41; oBrw&#58;Refresh&#40;&#41; endif return nil //----------------------------------------------------------------------------// [/code:10n56s7t]
xbrowse: too many recoursive handler calls error
Frank,Besides Nageswararao's excellent example, here you have your modified code so it properly works:[code:1655slo6] #include 'fivewin&#46;ch' #include 'xbrowse&#46;ch' function Main&#40;&#41; local oChild, oBrw, oCol local nFor use sales alias test DEFINE WINDOW oWnd TITLE "Auto edit browse" oBrw &#58;= TXBrowse&#40;&#41;&#58;New&#40; oWnd &#41; oBrw&#58;nMarqueeStyle &#58;= MARQSTYLE_HIGHLCELL oBrw&#58;nColDividerStyle &#58;= LINESTYLE_BLACK oBrw&#58;nRowDividerStyle &#58;= LINESTYLE_BLACK oBrw&#58;lColDividerComplete &#58;= &#46;t&#46; oBrw&#58;SetRDD&#40;&#41; for nFor &#58;= 1 to len&#40; oBrw&#58;aCols &#41; oCol &#58;= oBrw&#58;aCols&#91; nFor &#93; oCol&#58;nEditType &#58;= 1 oCol&#58;bOnPostEdit &#58;= &#123;|o, v, n| iif&#40; n != VK_ESCAPE, FieldPut&#40; o&#58;nCreationOrder, v &#41;, &#41; &#125; next oBrw&#58;CreateFromCode&#40;&#41; oWnd&#58;oClient &#58;= oBrw oBrw&#58;bPastEof &#58;= &#123;|| PastEOF&#40;&#41; &#125; // ADDED !!!!!!!!!!!! ACTIVATE WINDOW oWnd ON INIT oBrw&#58;SetFocus&#40;&#41; RETURN nil static function PastEOF&#40;&#41; static lShown if Empty&#40; lShown &#41; &#46;or&#46; ! lShown lShown = &#46;T&#46; MsgInfo&#40; "APND" &#41; lShown = &#46;F&#46; endif return nil [/code:1655slo6]
xbrowse: too many recoursive handler calls error
Marco,Please check your error.log file and find the first error that generates the recursive error. Thanks,
xbrowse: too many recoursive handler calls error
I required the error.log to my customer.I will know you as soon as I will receive it. Thanks to all.
xbrowse: too many recoursive handler calls error
[quote="nageswaragunupudi":72qz9cee]If we keep pressing the down arrow of the vertical scroll bar, method godown is executed so many times and naturally the bPastEof is evaluated as many times as we keep the arrow button pressed. I think we need to expect this.[/quote:72qz9cee]Excuse me , but i sayed 'clicked' , not 'pressing'It is clear that the user expects that bpasteof will be executed only one timeI have made some changes in GoDown() : [code:72qz9cee] METHOD GoDown&#40;&#41; CLASS TXBrowse local nLines if &#58;&#58;nLen == 0 &#46;or&#46; Eval&#40; &#58;&#58;bEof, Self &#41; if &#58;&#58;bPastEof != nil # ifdef FRANKDEMONT IF PROCNAME&#40;1&#41; <> "TXBROWSE&#58;VSCROLL" Eval&#40; &#58;&#58;bPastEof &#41; END # else Eval&#40; &#58;&#58;bPastEof &#41; # endif endif return nil endif &#58;&#58;CancelEdit&#40;&#41; &#58;&#58;Seek&#40;&#41; nLines &#58;= &#58;&#58;RowCount&#40;&#41; &#58;&#58;DrawLine&#40;&#41; if Eval&#40; &#58;&#58;bSkip, 1, Self &#41; == 1 if &#58;&#58;nRowSel < nLines &#58;&#58;nRowSel++ else //XBrwScroll&#40; &#58;&#58;hWnd, 1, &#58;&#58;nRowHeight, &#58;&#58;nHeaderHeight , &#58;&#58;nFooterHeight &#41; XBrwScr2&#40; &#58;&#58;hWnd, &#58;&#58;nRowHeight, &#58;&#58;HeaderHeight&#40;&#41;, nLines * &#58;&#58;nRowHeight &#41; endif if &#58;&#58;bChange != nil Eval&#40; &#58;&#58;bChange, Self, &#46;t&#46; &#41; endif if &#58;&#58;oVScroll != nil &#58;&#58;VGoDown&#40;&#41; endif else if &#58;&#58;bPastEof != nil # ifdef FRANKDEMONT IF PROCNAME&#40;1&#41; <> "TXBROWSE&#58;VSCROLL" Eval&#40; &#58;&#58;bPastEof &#41; END # else Eval&#40; &#58;&#58;bPastEof &#41; # endif //Eval&#40; &#58;&#58;bPastEof, Self &#41; endif if &#58;&#58;oVScroll != nil &#58;&#58;VGoBottom&#40;&#41; endif endif &#58;&#58;DrawLine&#40; &#46;t&#46; &#41; return nil [/code:72qz9cee]
xbrowse: too many recoursive handler calls error
>>Excuse me , but i sayed 'clicked' , not 'pressing'>>Yes. Clicking more than once. Pressing amounts to clicking more than once.>>the user expects that bpasteof will be executed only one time>>Definitely so. Thats what we should take care of in our code. Both the above examples handle this properly.>>>> # ifdef FRANKDEMONT IF PROCNAME(1) <> "TXBROWSE:VSCROLL" Eval( ::bPastEof ) END # else Eval( ::bPastEof ) # endif >>>>This means, pressing down arrow button on vertial scroll bar does not evaluate bPostEof.Still pressing Down Arrow does call bpasteof, each time the user presses.Assuming we append a record and offer inline editing ( not in a separate dialog ), the user can again press down arrow and do we append another record? For that reason, I personally feel that the right place to avoid responding to second and subsequent ( 'click' of button or pressing down arrow) calls is our bPastEof codeblock till the intended append is finished or cancelled.
xbrowse: too many recoursive handler calls error
[quote="nageswaragunupudi":2nif0zp3]>> >>>> # ifdef FRANKDEMONT IF PROCNAME(1) <> "TXBROWSE:VSCROLL" Eval( ::bPastEof ) END # else Eval( ::bPastEof ) # endif >>>> This means, pressing down arrow button on vertial scroll bar does not evaluate bPostEof. Still pressing Down Arrow does call bpasteof, each time the user presses. Assuming we append a record and offer inline editing ( not in a separate dialog ), the user can again press down arrow and do we append another record? For that reason, I personally feel that the right place to avoid responding to second and subsequent ( 'click' of button or pressing down arrow) calls is our bPastEof codeblock till the intended append is finished or cancelled.[/quote:2nif0zp3]Normally is bpasteof a input routine , and yes there must be something when the user does not write the record (a OK button) . Working in a MDI environnement , it is still possible that the user returns to the browse and tries to append a second record, but the inputroutine activates then the dialog from the previous apended record (dialog was not closed) . I had never problems when the down arrow was used.BUT , using the scrollbar , in mine opinion the user tries only to navigate in the browse , without the intention to append . When he presses to long we have the described problems. When we don't change the source from xbrowse each bpasteof must have code to avoid it. for me , after discussing it with the customers , we choosed to not append records with the scrollbarSo we made it simple : to append press Ctrl-Pgdwn followed by arrow down , only this will appendANTONIO , what is your opinion on this matter ?Frank
xbrowse: too many recoursive handler calls error
Hi all,pls. find as follows the error.log info about this error.Any ideas ?Application=========== Path and name: C:\pigc\pigc.exe (32 bits) Size: 7,785,256 bytes Time from start: 26 hours 34 mins 22 secs Error occurred at: 29/07/08, 18:37:54 Error description: Error BASE/1132 Bound error: array access Args: [ 1] = A { ... } [ 2] = N 0Stack Calls=========== Called from: XBROWSE.PRG => (b)TXBROWSE:TXBROWSE(401) Called from: => TXBROWSE:AROW(0) Called from: XBROWSE.PRG => (b)TXBRWCOLUMN:ADJUST(4729) Called from: XBROWSE.PRG => TXBRWCOLUMN:PAINTDATA(5322) Called from: XBROWSE.PRG => TXBROWSE:DRAWLINE(1156) Called from: XBROWSE.PRG => TXBROWSE:PAINT(1032) Called from: XBROWSE.PRG => TXBROWSE:DISPLAY(786) Called from: CONTROL.PRG => TXBROWSE:HANDLEEVENT(0) Called from: WINDOW.PRG => _FWH(0) Called from: => SYSREFRESH(0) Called from: MOD110.PRG => SELECTFUNC_CONS(253) Called from: MOD110.PRG => (b)SELECTFUNC_CONS(268) Called from: XBROWSE.PRG => TXBROWSE:VSCROLL(1943) Called from: => TWINDOW:HANDLEEVENT(0) Called from: CONTROL.PRG => TXBROWSE:HANDLEEVENT(0) Called from: WINDOW.PRG => _FWH(0) Called from: => WINRUN(0) Called from: WINDOW.PRG => TMDIFRAME:ACTIVATE(0) Called from: MOD0.PRG => MOD0(287) Called from: PIGC.PRG => START(825)System====== CPU type: Intel(R) Core(TM)2 Duo CPU E4400 @ 2.00GHz 2000 Mhz Hardware memory: 2048 megs Free System resources: 90 % GDI resources: 90 % User resources: 90 % Compiler version: xHarbour build 1.1.0 Intl. (SimpLex) (Rev. 6095) Windows version: 5.1, Build 2600 Service Pack 3 Windows total applications running: 89 1 2 Elenco a discesa suggerimenti automatici 3 CiceroUIWndFrame 4 TF_FloatingLangBar_WndTitle 5 M 6 Default IME 7 SysFader 8 Menu Avvio 9 Fornitori 10 Invia 11 Collegamenti 12 PROCEDURA INTEGRATA GESTIONE CONDOMINIO 2008 13 SOFTWARE XP • Leggi argomento - ERRORE SU BARRE LATERALI IN CONSUNTIVO / ANAGRAFICHE - 14 Bogus 15 Menu di scelta rapida 16 Posta in arrivo - Microsoft Outlook 17 Layered Hidden Window 18 Connessione desktop remoto 19 Mario: andare da Sormani con stampante e router - Riunione 20 Temporary context menu 21 EnvTB 22 Microsoft Word 23 RLERRT59M18L736W 24 Impostazioni e-mail 25 Danea Easyfatt 2006 Professional rev. 21b < WINSOFT MARIO > 26 Danea Easyfatt 2006 27 Software XP's Customers Monitor v.2.2 28 BARBARA NICOLIG - Contatto 29 MCI command handling window 30 Acrobat IEHelper 31 DDE Server Window 32 4 Promemoria 33 Java Sys Tray 34 theAwtToolkitWindow 35 Richiesta versione in prova dal sito <!-- w --><a class="postlink" href="http://www.gestione-stabili.com">www.gestione-stabili.com</a><!-- w --> - Messaggio (Testo normale) 36 PRIMO FOSCHI - Contatto 37 GIORGIO BIONDI - Contatto 38 IGOR FEDRIGA - Contatto 39 Mario: passare da Zoffoli che ha problemi sul Server - Riunione 40 Mario: passa Santagati per consulenza Euro 54,00 ora - sala occupata - Riunione 41 Mario: passa Selene per assunzione - Riunione 42 Information 43 EPSON SMART PANEL for Scanner 44 Mario: contattare Rondalli per passaggio a PIGC 1000 - telefono 0341633041 - Riunione 45 Popup Firma automatica 46 <!-- m --><a class="postlink" href="http://www.condominio.mobi/xml/updater.php?import=winsoft&&erase=0">http://www.condominio.mobi/xml/updater. ... t&&erase=0</a><!-- m --> - 47 VINCENZO BONGHI - Contatto 48 SALVO SALIS - Contatto 49 LUCA COSENTINO - Contatto 50 VITTORIO POMPONIO - Contatto 51 Mario: corso da Baroni - Riunione 52 {A7E495BF-9589-4a6e-8479-DDA2D8D3C05F} 53 keyboard 54 OutlookFbThreadWnd 55 Stato invio/ricezione in Outlook 56 FRITZ!DSL Start Center 57 Skype™ - winsoft-italia 58 Connections Tray 59 Misuratore alimentazione 60 MS_WebcheckMonitor 61 SPAMfighter Update Agent 62 SPAMfighter Agent 63 PersistWndName 64 HkWndName 65 IAAMonitor Notify App 66 Aggiornamento protetto ETS 67 Stato di Intel® Active Management Technology 68 SMax4PNP 69 AEBalloonTip 70 Dialog 71 1785F61B 72 HOOK WINDOW 73 Actions 74 C:\Documents and Settings\Enrico\Dati applicazioni\Skype 75 ChatFormatter 76 ChatManager 77 SkyLibEx 78 WMS Idle 79 WMS ST Notif Window 00000E38 00000944 80 .NET-BroadcastEventWindow.2.0.0.0.11c7a8c.0 81 W 82 Microsoft Outlook 83 GDI+ Window 84 MsoDockLeft 85 MsoDockTop 86 MsoDockRight 87 MsoDockBottom 88 88.149.172.78:3389 - desktop remoto 89 Program ManagerVariables in use================ Procedure Type Value ========================== (b)TXBROWSE:TXBROWSE Param 1: O Class: TXBROWSE Local 1: A Len: 67 Local 2: N 0 Local 3: U Local 4: N 0 TXBROWSE:AROW (b)TXBRWCOLUMN:ADJUST Local 1: U Local 2: U TXBRWCOLUMN:PAINTDATA Param 1: N 20 Param 2: N 0 Param 3: N 19 Param 4: L .T. Param 5: L .T. Param 6: N 1 Local 1: O Class: TXBRWCOLUMN Local 2: U Local 3: U Local 4: U Local 5: U Local 6: U Local 7: U Local 8: U Local 9: U Local 10: U Local 11: U Local 12: U Local 13: U Local 14: U Local 15: U Local 16: U Local 17: U Local 18: U Local 19: U Local 20: U Local 21: U Local 22: L .F. Local 23: L .F. Local 24: L .F. TXBROWSE:DRAWLINE Param 1: L .T. Local 1: N 1 Local 2: O Class: TXBROWSE Local 3: O Class: TXBRWCOLUMN Local 4: N 20 Local 5: U Local 6: N 1 Local 7: N 2 Local 8: N 20 Local 9: N 5 Local 10: U Local 11: U Local 12: U Local 13: N 19 Local 14: N -637460409 Local 15: U Local 16: U Local 17: U Local 18: L .T. TXBROWSE:PAINT Local 1: O Class: TXBROWSE Local 2: A Len: 3 Local 3: A Len: 2 Local 4: O Class: TXBRWCOLUMN Local 5: N 3 Local 6: N 2 Local 7: N 600 Local 8: N 884 Local 9: N 19 Local 10: N 2 Local 11: U Local 12: U Local 13: N 863 Local 14: N 609 Local 15: U Local 16: N -1777332115 Local 17: N -637460409 Local 18: N -1976558542 Local 19: N 1747984409 Local 20: N -2077222339 Local 21: N -785375170 Local 22: N 135272270 Local 23: N 20 Local 24: N 609 Local 25: N 29 Local 26: N 2 Local 27: N 2 Local 28: N 30 Local 29: N 20 Local 30: N 0 Local 31: N 5 Local 32: U Local 33: L .F. Local 34: L .F. Local 35: L .F. Local 36: A Len: 5 TXBROWSE:DISPLAY Local 1: O Class: TXBROWSE TXBROWSE:HANDLEEVENT Param 1: N 15 Param 2: N 0 Param 3: N 0 Local 1: O Class: TXBROWSE Local 2: U _FWH Param 1: N 0 Param 2: N 15 Param 3: N 0 Param 4: N 0 Param 5: N 41 Local 1: O Class: TXBROWSE SYSREFRESH SELECTFUNC_CONS Local 1: N 67074.6490000 (b)SELECTFUNC_CONS Param 1: O Class: TXBROWSE Param 2: L .T. TXBROWSE:VSCROLL Param 1: N 4 Param 2: N 0 Local 1: O Class: TXBROWSE Local 2: N 0 Local 3: N 4 Local 4: N 0 Local 5: N 16 Local 6: N 0 TWINDOW:HANDLEEVENT Param 1: N 277 Param 2: N 4 Param 3: N 0 TXBROWSE:HANDLEEVENT Param 1: N 277 Param 2: N 4 Param 3: N 0 Local 1: O Class: TXBROWSE Local 2: U _FWH Param 1: N 0 Param 2: N 277 Param 3: N 4 Param 4: N 0 Param 5: N 41 Local 1: O Class: TXBROWSE WINRUN Param 1: N 1573746 TMDIFRAME:ACTIVATE Param 1: C "MAXIMIZED" Param 2: U Param 3: U Param 4: U Param 5: U Param 6: B {|| ... } Param 7: U Param 8: B {|| ... } Param 9: U Param 10: U Param 11: U Param 12: U Param 13: U Param 14: U Param 15: U Param 16: U Param 17: B {|| ... } Param 18: U Param 19: U Local 1: O Class: TMDIFRAME Local 2: U Local 3: U MOD0 Local 1: C "PROCEDURA INTEGRATA GESTIONE CONDOMINIO 2008" START Local 1: C "" Local 2: U Local 3: U Local 4: U Local 5: U Linked RDDs=========== DBF DBFFPT DBFBLOB DBFNTXDataBases in use================Classes in use:=============== 1 HASHENTRY 2 HBCLASS 3 HBOBJECT 4 TMUTEX 5 TPRINTER 6 TSYSTEMINFO 7 TSTRUCT 8 TREG32 9 TCURSOR 10 TFONT 11 TWINDOW 12 TMDIFRAME 13 TMENU 14 TMENUITEM 15 TCONTROL 16 TICON 17 TBRUSH 18 TMDICLIENT 19 TBAR 20 TRECT 21 TBTNBMP 22 TMSGBAR 23 TMSGITEM 24 TDIALOG 25 TBITMAP 26 TSAY 27 TURLLINK 28 TBUTTON 29 TGET 30 GET 31 TCLIPGET 32 TCHECKBOX 33 TSCROLLBAR 34 TRADMENU 35 TRADIO 36 TPROGRESS 37 TBUTTONBMP 38 TCLIPBOARD 39 TWBROWSE 40 TCBROWSE 41 TCCOLUMN 42 TCOMBOBOX 43 TPEN 44 TMULTIGET 45 TTITLE 46 TTIMER 47 TC5STBAR 48 TC5STBARITEM 49 TXBROWSE 50 TXBRWCOLUMN 51 TFOLDER 52 TSPLITTER 53 TCOMBOLIST 54 TIMAGE 55 ERRORMemory Analysis=============== 831 Static variables Dynamic memory consume: Actual Value: 0 bytes Highest Value: 0 bytes
xbrowse: too many recoursive handler calls error
Can you please let us know the FWH version? The line number in the error log does not correspond to any executable code either in 8.06 or 8.07.In any case, since the error is in oBrw:aRow method, it appears that ::nArrayAt is 0 (Zero) at the time of the call. A relook into the code is needed.
xbrowse: too many recoursive handler calls error
Hi,I'm using FWH May 2008.The problem appairs in the row METHOD aRow INLINE ( ::aArrayData[ ::nArrayAt ] )The strange is that I didn't make any changes on the nArrayAt value,the error start from a simply sysrefresh().In order to increase the selection speed I made in my function a routine that execute my code only when a key is released for more than 0.25 seconds. Could be this a problem ? See my code as follows.Function Main() .. && I create xbrowse as Objects[6] .. .. aObjects[6]:bChange:={|| SelectFunc_Cons()} && action to do when any selection is madereturnFunction SelectFunc_Cons()local nSecondsaObjects[6]:bChange:={|| nil}nSeconds:=seconds()do while .t.sysrefresh() && xbrowse is refreshed and the error appairsif seconds()-nSeconds>.25 exitendifenddo.... .. my code..aObjects[6]:bChange:={|| SelectFunc_Cons()}return
xbrowse: too many recoursive handler calls error
Frank,> what is your opinion on this matter ?Windows has its own rules to generate and manage events. If Windows allows to click several times and keep generating an event, then we have to adapt our code to Windows.
xbrowse: too many recoursive handler calls error
Marco,This could be a possible temporary workaround:METHOD aRow INLINE ( ::aArrayData[ Max( ::nArrayAt, 1 ) ] ) orMETHOD aRow INLINE If( Len( ::aArrayData ) > 0, ::aArrayData[ Max( ::nArrayAt, 1 ) ], "" ) // maybe nil instead of ""Please try it and lets see what further info we get
xbrowse: too many recoursive handler calls error
I just sent to my customer an update with the turn-around.I will know you if the problem still appairs.Thanks for the support.
xbrowse:brwfitsize(.T.)
[code=fw:n9lxnl7i]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.ch"</span><br />PROC MAIN<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />********************<br /><span style="color: #00C800;">LOCAL</span> oDlg<br /><span style="color: #00C800;">LOCAL</span> WinTit := <span style="color: #ff0000;">"Test BrwFitSize"</span><br /><span style="color: #00C800;">LOCAL</span> oBrw1 , oBrw2 , aData1 , aData2 , aData<br /><br />aData1 := <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"el 1"</span>,<span style="color: #ff0000;">"el 2"</span>, <span style="color: #ff0000;">"el 3"</span><span style="color: #000000;">&#125;</span><br />aData2 := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"el 1"</span>,<span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"el 11"</span>,<span style="color: #ff0000;">"el 12"</span> , <span style="color: #ff0000;">"el 13"</span> , <span style="color: #ff0000;">"el 14"</span>,<span style="color: #ff0000;">"el 15"</span> , <span style="color: #ff0000;">"el 16"</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span>,;<br />           <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"el 2"</span>,<span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"el 21"</span>,<span style="color: #ff0000;">"el 22"</span> , <span style="color: #ff0000;">"el 23"</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span>,;<br />                     <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"el 3"</span>,<span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"el 31"</span>,<span style="color: #ff0000;">"el 32"</span> , <span style="color: #ff0000;">"el 33"</span> , <span style="color: #ff0000;">"el 34"</span>,<span style="color: #ff0000;">"el 35"</span> , <span style="color: #ff0000;">"el 36"</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><br />aData := aData2<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#93;</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;">900</span>,<span style="color: #000000;">600</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">TITLE</span> WinTit<br /><br /> @ <span style="color: #000000;">2</span> ,<span style="color: #000000;">2</span> <span style="color: #0000ff;">XBROWSE</span> oBrw1 <span style="color: #0000ff;">OF</span> oDlg ARRAY aData1;<br />                    <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">50</span> , <span style="color: #000000;">230</span> <span style="color: #0000ff;">PIXEL</span>;<br />          <span style="color: #0000ff;">AUTOCOLS</span> LINES<br /><br /> WITH OBJECT oBrw1<br />    :<span style="color: #000000;">lRecordSelector</span> := .F.<br />    :<span style="color: #000000;">lHscroll</span>        := .F.<br />    :<span style="color: #000000;">bChange</span> :=  <span style="color: #000000;">&#123;</span>|self,lRow|oBrw2:<span style="color: #000000;">aArrayData</span> := aData2<span style="color: #000000;">&#91;</span>oBrw1:<span style="color: #000000;">nArrayAt</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> ,;<br />                             oBrw2:<span style="color: #000000;">BrwFitSize</span><span style="color: #000000;">&#40;</span>.T.<span style="color: #000000;">&#41;</span> , oBrw2:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span>.T.<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br />    :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /> END<br /> <br /> @ <span style="color: #000000;">2</span>, <span style="color: #000000;">100</span> <span style="color: #0000ff;">XBROWSE</span> oBrw2 <span style="color: #0000ff;">OF</span> oDlg ARRAY aData;<br />                    <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">50</span> , <span style="color: #000000;">230</span> <span style="color: #0000ff;">PIXEL</span>;<br />          <span style="color: #0000ff;">AUTOCOLS</span> LINES<br /><br /> WITH OBJECT oBrw2<br />    :<span style="color: #000000;">lRecordSelector</span> := .F.<br />    :<span style="color: #000000;">lHscroll</span>        := .F.<br />    :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /> END<br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTER</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oBrw2:<span style="color: #000000;">BrwFitSize</span><span style="color: #000000;">&#40;</span>.T.<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">RETURN</span><br /> </div>[/code:n9lxnl7i] Starting this aplication , RowCount() from oBrw2 is adjusted to 6 elements , the second browse fit's to 6 elements. Giving el2 from obrw1 (second row) focus adjust rowcount() from obrw2 to 3 elements , the second browse fit's to 3 elements , CORRECT ! Giving el3 from obrw1 (third row) focus adjust rowcount() from obrw2 to 3 elements , the second browse fit's to 3 elements , FALSE , it should be 6 ! Originally oBrw2 could have 24 elements. BrwFitsize overwrite oBrw2:nHeight , the originally value is lost I added a second parameter to BrwFitSize (nMaxRow) , BrwFitSize should be replaced with BrwFitSize(.T.,nMaxRow) [code=fw:n9lxnl7i]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">LOCAL</span> nMaxRow <br />......<br />  :<span style="color: #000000;">bChange</span> :=  <span style="color: #000000;">&#123;</span>|self,lRow|oBrw2:<span style="color: #000000;">aArrayData</span> := aData2<span style="color: #000000;">&#91;</span>oBrw1:<span style="color: #000000;">nArrayAt</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> ,;<br />                             oBrw2:<span style="color: #000000;">BrwFitSize</span><span style="color: #000000;">&#40;</span>.T. , nMaxRow<span style="color: #000000;">&#41;</span> , oBrw2:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span>.T.<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br />......<br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTER</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span>nMaxRow := oBrw2:<span style="color: #000000;">RowCount</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> , oBrw2:<span style="color: #000000;">BrwFitSize</span><span style="color: #000000;">&#40;</span>.T. , nMaxRow<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">METHOD</span> BrwFitSize<span style="color: #000000;">&#40;</span> lReSize , nMaxRow <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TXBrowse<br />...<br /><span style="color: #00C800;">DEFAULT</span> nMaxRow := ::<span style="color: #000000;">RowCount</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />...<br />nHeight  := <span style="color: #0000ff;">Max</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">3</span>, <span style="color: #0000ff;">Min</span><span style="color: #000000;">&#40;</span> nMaxRow, ::<span style="color: #000000;">KeyCount</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> * ::<span style="color: #000000;">nRowHeight</span> + ;<br />                        <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lHeader</span>, ::<span style="color: #000000;">nHeaderHeight</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> + ;<br />                        <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lFooter</span>, ::<span style="color: #000000;">nFooterHeight</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> + <span style="color: #000000;">1</span> + nY<br /> </div>[/code:n9lxnl7i] Frank
xbrowse:brwfitsize(.T.)
Glad to see somone using this method. The method was originally written for one time use initially to adjust sizes. Your use of this method is interesting. Incorporated your suggestion in the next release.
xbrowse:brwfitsize(.T.)
[quote="nageswaragunupudi":15o96vta]Glad to see somone using this method. The method was originally written for one time use initially to adjust sizes. Your use of this method is interesting. Incorporated your suggestion in the next release.[/quote:15o96vta] Thanks for your kind words. Another possible solution is to create a new DATA in Txbrowse , nMaxrow. First lines from BrwFitsize local nMaxRow IF ::nMaxRow == nil ::nMaxRow := ::RowCount() END DEFAULT nMaxRow := ::nMaxrow Then we can call Brwfitsize as usual and must give no attention to set nMaxrow in the calling routine. Another change i made was to provide two parameters to resize : lHresize and lVresize. Frank [code=fw:15o96vta]<div class="fw" id="{CB}" style="font-family: monospace;"><br />PROC MAIN<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />********************<br /><span style="color: #00C800;">LOCAL</span> oDlg<br /><span style="color: #00C800;">LOCAL</span> WinTit := <span style="color: #ff0000;">"Test BrwFitSize"</span><br /><span style="color: #00C800;">LOCAL</span> oBrw1 , oBrw2 , aData1 , aData2 , aData<br /><span style="color: #00C800;">LOCAL</span> nMaxRow<br /><br />aData1 := <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"el 1"</span>,<span style="color: #ff0000;">"el 2"</span>, <span style="color: #ff0000;">"el 3"</span><span style="color: #000000;">&#125;</span><br />aData2 := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"el 1"</span>,<span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"el 11"</span>,<span style="color: #ff0000;">"el 12"</span> , <span style="color: #ff0000;">"el 13"</span> , <span style="color: #ff0000;">"el 14"</span>,<span style="color: #ff0000;">"el 15"</span> , <span style="color: #ff0000;">"el 16"</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span>,;<br />           <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"el 2"</span>,<span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"el 21"</span>,<span style="color: #ff0000;">"el 22"</span> , <span style="color: #ff0000;">"el 23"</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span>,;<br />                     <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"el 3"</span>,<span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"el 31"</span>,<span style="color: #ff0000;">"el 32"</span> , <span style="color: #ff0000;">"el 33"</span> , <span style="color: #ff0000;">"el 34"</span>,<span style="color: #ff0000;">"el 35"</span> , <span style="color: #ff0000;">"el 36"</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><br />aData := aData2<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#93;</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;">900</span>,<span style="color: #000000;">600</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">TITLE</span> WinTit<br /><br /> @ <span style="color: #000000;">2</span> ,<span style="color: #000000;">2</span> <span style="color: #0000ff;">XBROWSE</span> oBrw1 <span style="color: #0000ff;">OF</span> oDlg ARRAY aData1;<br />                    <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">50</span> , <span style="color: #000000;">230</span> <span style="color: #0000ff;">PIXEL</span>;<br />          <span style="color: #0000ff;">AUTOCOLS</span> LINES<br /><br /> WITH OBJECT oBrw1<br />    :<span style="color: #000000;">lRecordSelector</span> := .F.<br />    :<span style="color: #000000;">lHscroll</span>        := .F.<br />    :<span style="color: #000000;">bChange</span> :=  <span style="color: #000000;">&#123;</span>|self,lRow|oBrw2:<span style="color: #000000;">aArrayData</span> := aData2<span style="color: #000000;">&#91;</span>oBrw1:<span style="color: #000000;">nArrayAt</span>,<span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> ,;<br />                             oBrw2:<span style="color: #000000;">BrwFitSize</span><span style="color: #000000;">&#40;</span>.T.<span style="color: #000000;">&#41;</span> , oBrw2:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span>.T.<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</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: #000000;">2</span>, <span style="color: #000000;">100</span> <span style="color: #0000ff;">XBROWSE</span> oBrw2 <span style="color: #0000ff;">OF</span> oDlg ARRAY aData;<br />                    <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">50</span> , <span style="color: #000000;">230</span> <span style="color: #0000ff;">PIXEL</span>;<br />          <span style="color: #0000ff;">AUTOCOLS</span> LINES<br /><br /> WITH OBJECT oBrw2<br />    :<span style="color: #000000;">lRecordSelector</span> := .F.<br />    :<span style="color: #000000;">lHscroll</span>        := .F.<br />    :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /> END<br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTER</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span>oBrw2:<span style="color: #000000;">BrwFitSize</span><span style="color: #000000;">&#40;</span>.T. <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">RETURN</span><br /> </div>[/code:15o96vta] In Xbrowse : [code=fw:15o96vta]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">METHOD</span> BrwFitSize<span style="color: #000000;">&#40;</span> lReSize  <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TXBrowse<br /><br />   <span style="color: #00C800;">local</span> oRect, nX, nY<br />   <span style="color: #00C800;">local</span> nWidth      := ::<span style="color: #000000;">nWidth</span><br />   <span style="color: #00C800;">local</span> nHeight     := ::<span style="color: #000000;">nHeight</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nMaxRow &nbsp; &nbsp; := ::<span style="color: #000000;">RowCount</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> ! __ObjHasData<span style="color: #000000;">&#40;</span><span style="color: #00C800;">self</span>,<span style="color: #ff0000;">"nMaxRow"</span><span style="color: #000000;">&#41;</span> <br />&nbsp; &nbsp; &nbsp;__ObjAddData<span style="color: #000000;">&#40;</span><span style="color: #00C800;">self</span>,<span style="color: #ff0000;">"nMaxRow"</span><span style="color: #000000;">&#41;</span>&nbsp; &nbsp;<br />&nbsp; &nbsp;END<br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> ::<span style="color: #000000;">nMaxRow</span> == <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp;::<span style="color: #000000;">nMaxRow</span> := ::<span style="color: #000000;">RowCount</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;END<br />&nbsp; &nbsp;nMaxRow := ::<span style="color: #000000;">nMaxRow</span><br />   <br />   <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lAdjusted</span><br /><br />      <span style="color: #00C800;">DEFAULT</span> lReSize   := .f.<br /><br />      oRect    := ::<span style="color: #000000;">GetCliRect</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      nX             := nWidth  - oRect:<span style="color: #000000;">nWidth</span><br />      nY             := nHeight - oRect:<span style="color: #000000;">nHeight</span><br /><br />      nWidth         := ::<span style="color: #000000;">GetDisplayColsWidth</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> + <span style="color: #000000;">1</span> + nX<br />      nHeight        := <span style="color: #0000ff;">Max</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">3</span>, <span style="color: #0000ff;">Min</span><span style="color: #000000;">&#40;</span> nMaxRow, ::<span style="color: #000000;">KeyCount</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> * ::<span style="color: #000000;">nRowHeight</span> + ;<br />                        <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lHeader</span>, ::<span style="color: #000000;">nHeaderHeight</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> + ;<br />                        <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lFooter</span>, ::<span style="color: #000000;">nFooterHeight</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> + <span style="color: #000000;">1</span> + nY<br />.....<br /> </div>[/code:15o96vta]
xbrowse:cHeader
Desde hace bastante tiempo se puede llamar a las columnas de xbrowse con Llamada a la columna de xbrowse con oBrw:cHeader en lugar de usar oBrw:oCol( <cHeader> ) El problema es que ahora tengo que cambiar el nombre de algunas columnas durante la ejecución, y por tanto el sistema genera errores. Ejemplo: La columna "Debe" durante la ejecución pasa a llamarse "Debit". En el código fuente hay llamadas a oBrw:Debe:... ¿Puedo ver como se realiza esa sustitución en fwh, para ver como puedo cambiarlo?
xbrowse:cHeader
Fernando, Aunque Rao es el gran expero de XBrowse, en mi opinión se está usando el METHOD OnError( uParam1 ) CLASS TXBrowse Prueba a poner un MsgInfo() ahí y debería llamarse en esos casos
xbrowse:cHeader
Antonio, Sí figura ahí la sustitución. Muchas gracias por tu ayuda.
xbrowse:cHeader
Yo no las llamo por el nombre sino por el numero de la columna, asi si cambia el nombre es transparente, lo uso asi, nose si eso te ayude...saludos... <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: --> oBrw:aCols[nCol]
xbrowse:cHeader
Muchas gracias José Luis, Antes también lo usaba así. Llamando por el número de la columna. Pero eso conllevaba 2 problemas: 1º Que cambien el orden de las columnas. 2º Con el tiempo, al leer el código, saber que columna es la que estoy modificando, ya que sólo veía oBrw:aCols[ nCol ] La mejor solución que encontré es llamar a las columnas con oBrw:Debe (Siendo "debe" el cHeader de una columna) Hasta aquí todo perfecto y funcionando de maravilla. El problema ahora, es que he tenido que migrar al Inglés todo el sistema (gracias Antonio por el contacto de los tractuctores). Resultado, ahora la columna se llama Debit y cuando llega a la línea con oBrw:Debe, aparece el error. Solución: He incluido en TXBrwColumn el DATA cHeaderLang. y en este valor guardo el nombre de la columna en Español. La sustitución de oBrw:Debe por oBrw:aCols[ nCol ], se realiza en el METHOD OnError( uParam1 ) como indicó Antonio. En este método se llama al METHOD oCol( u ) y este es el que con un aScan busca el nombre "u" entre los cHeader que tiene oBrw:aCols He modificado el método oCol, añadiendo que si el resultado del primer aScan es 0, volver a buscar con aScan, pero esta vez sobre el data cHeaderLang [code=fw:150zgsrg]<div class="fw" id="{CB}" style="font-family: monospace;">nAt := AScan<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aCols</span>, <span style="color: #000000;">&#123;</span> |o| Upper<span style="color: #000000;">&#40;</span>o:<span style="color: #000000;">cHeaderLang</span><span style="color: #000000;">&#41;</span> == Upper<span style="color: #000000;">&#40;</span>u<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span></div>[/code:150zgsrg]