topic
stringlengths 1
63
| text
stringlengths 1
577k
⌀ |
---|---|
sumar una columna como le hago??? (YA RESUELTO GRACIAS) | Aida, depende como estes presentando los datos en el footer, si es con un bloque de codigo, un oBrowse:refresh(.t.) si no recuerdo mal, evalua el bloque nuevamente y refresca el contenido del footer.dejame buscar un ejemplo y lo posteo en breve. |
sumar una columna como le hago??? (YA RESUELTO GRACIAS) | NO LE ENTIENDO A NADA <!-- s:cry: --><img src="{SMILIES_PATH}/icon_cry.gif" alt=":cry:" title="Crying or Very sad" /><!-- s:cry: --> <!-- s:cry: --><img src="{SMILIES_PATH}/icon_cry.gif" alt=":cry:" title="Crying or Very sad" /><!-- s:cry: --> <!-- s:cry: --><img src="{SMILIES_PATH}/icon_cry.gif" alt=":cry:" title="Crying or Very sad" /><!-- s:cry: --> if ! Empty( oCol := oBrw:oCol( "Salary" ) ) oCol:bFooter := { || nTotal } oCol:lTotal := .t. oCol:nEditType := EDIT_GET oCol:bOnPostEdit := {| o, u, n| If( n == 13, ( nTotal += (u - oCust:Salary), oCust:Salary := u, oCust:Save() ), nil ) } // total salary in the footer changes automatically. // no need to code or call refresh endifToy como atarantada el dia de hoy <!-- s:oops: --><img src="{SMILIES_PATH}/icon_redface.gif" alt=":oops:" title="Embarassed" /><!-- s:oops: --> |
sumar una columna como le hago??? (YA RESUELTO GRACIAS) | Aida..precisamente estoy terminando algo parecido usando TWBrowse.. siguiendo los ejemplos que vienen en los fuentes de la clase..[code:37pq48la]
// Los TEXTBOX que pintan los totales
REDEFINE GET oGets[15] VAR hVars["SUBTOTAL"] ID 1115 OF oDlg PICTURE '99,999,999,999.99' UPDATE;
COLOR CLR_BLACK, RGB(176,196,222) WHEN .F. FONT oFontImp
REDEFINE GET oGets[16] VAR hVars["DESCTOS"] ID 1116 OF oDlg PICTURE '99,999,999,999.99' UPDATE;
COLOR CLR_BLACK, RGB(176,196,222) WHEN .F. FONT oFontImp
REDEFINE GET oGets[17] VAR hVars["TOT_IVA"] ID 1117 OF oDlg PICTURE '99,999,999,999.99' UPDATE;
COLOR CLR_BLACK, RGB(176,196,222) WHEN .F. FONT oFontImp
REDEFINE GET oGets[18] VAR hVars["IMPORTE"] ID 1118 OF oDlg PICTURE '99,999,999,999.99' UPDATE;
COLOR CLR_BLACK, RGB(176,196,222) WHEN .F. FONT oFontImp
oGets[15]:lDisColors = .F.
oGets[16]:lDisColors = .F.
oGets[17]:lDisColors = .F.
oGets[18]:lDisColors = .F.
// El bitmap que se pinta en la primera columna del browse estilo de xBrowse
hBitmap := LoadBitmap( GetResources(),"BMP_ROW_SELECTION" )
// Se crea el browse desde recurso usando TWBROWSE
aDetalle:= {}
REDEFINE LISTBOX oBrwDetalle ;
FIELDS "" ;
HEADERS "", "Codigo", "Nombre/Titulo del libro", "Cantidad", "Costo Unitario", ;
"D-1", "D-2", "Importe";
ID 1200 OF oDlg;
FIELDSIZES 30, 120, 327, 75, 100, 50, 50, 100
oBrwDetalle:bLine:= {|nAt| nAt:= oBrwDetalle:nAt, ;
If( Len( aDetalle ) < 1 .or. nAt > Len( aDetalle ),;
Array(8), ;
{ If( oBrwDetalle != NIL .and. oBrwDetalle:lSelect, hBitmap, 0 ),;
aDetalle[nAt,1], ;
aDetalle[nAt,2], ;
Transform( aDetalle[nAt,3], '@Z 999,999,999' ), ;
Transform( aDetalle[nAt,4], '@Z 999,999,999.99' ), ;
Transform( aDetalle[nAt,5], '@Z 99.99' ), ;
Transform( aDetalle[nAt,6], '@Z 99.99' ), ;
Transform( aDetalle[nAt,7], '@Z 999,999,999.99' ) } ) }
oBrwDetalle:aJustify:= { 2, .F., .F., .T., .T., .T., .T., .T. } // Se justifican las columnas left-center-right
oBrwDetalle:SetArray( aDetalle ) // Se asignan los datos del arreglo en este caso esta VACIO
// Bloque de codigo que sirve para controlar la edicion en el browse
oBrwDetalle:bEdit:= {|nCol, cBuffer, lFirstEdit|;
EditaCelda( oBrwDetalle, nCol, cBuffer, aDetalle, lFirstEdit, ;
aTotales, Self, hVars, oGets ) }
// Este es estetico solo para mostrar la primera columna con el color de windows tipo xBrowse
oBrwDetalle:bBkColor:= {|nRow,nCol,nStyle| ;
if( nStyle==3 .OR. nStyle=0, if( nCol==1,GetSysColor( COLOR_BTNFACE ),),) }
oBrwDetalle:bTextColor:= {|nRow,nCol,nStyle| ;
if( nStyle==3 .OR. nStyle=0, if( nCol==1,RGB( 192,192,192 ),),) }
// Configuracion del browse
oBrwDetalle:lAdjLastCol := .T.
oBrwDetalle:lAutoEdit := .T.
oBrwDetalle:lAutoSkip := .T.
oBrwDetalle:lAdjLastCol := .F.
oBrwDetalle:lDrawHeaders := .T.
oBrwDetalle:lDrawFooters := .F.
oBrwDetalle:lVScroll := .T.
oBrwDetalle:lHScroll := .F.
oBrwDetalle:nLineStyle := 1
oBrwDetalle:nHeaderStyle := 2
oBrwDetalle:nClrLine := RGB(179,219,255) // Color de las lineas que separan las columnas y filas
oBrwDetalle:nLineHeight := 18
oBrwDetalle:nHeaderHeight:= 20
// Botones para el ABC en el browse
REDEFINE SBUTTON oBtns[1] ID 1201 OF oDlg;
ACTION ( AddNewItem( aDetalle, oBrwDetalle, hVars ), oBrwDetalle:Edit() );
RESOURCE "BMP_ITEM_ADD",,"BMP_ITEM_ADD_GREY" LOOK W97;
TOOLTIP "Agregar titulo a la compra"
REDEFINE SBUTTON oBtns[2] ID 1202 OF oDlg;
ACTION DelSelItem( aDetalle, oBrwDetalle, aTotales ) ;
RESOURCE "BMP_ITEM_DEL",,"BMP_ITEM_DEL_GREY" LOOK W97;
TOOLTIP "Eliminar titulo de la compra"
REDEFINE SBUTTON oBtns[3] ID 1203 OF oDlg;
ACTION If( Len(aDetalle) > 0 .AND. ;
oBrwDetalle:nAt <= Len(aDetalle) .AND. oBrwDetalle:nAt > 0,;
( oBrwDetalle:Edit(), oBrwDetalle:SetFocus() ), ) ;
RESOURCE "BMP_ITEM_EDIT",,"BMP_ITEM_EDIT_GREY" LOOK W97;
TOOLTIP "Modificar titulo"
/*----------------------------------------------------------------------------------------------------*/
STATIC FUNCTION EditaCelda( oLbx, nCol, cBuffer, aDatos, lFirstEdit, aTotal, ;
oSelf, hGets, oGets )
// oLbx - Objeto tWbrowse
// nCol - Columna sobre la cual se esta haciendo edicion
// cBuffer - Valor de la celda sobre la que se escribe
// aDatos - Array de datos del browse
// lFirstEdit - Si es la primera vez que se edita
// aTotal - Arrau de totales de las columnas del browse SubTotal -Iva - Descuentos - Total Gral
// oSelf - oApplication
// hGets - Array de variables de los gets
// oGets - Array de objetos gets
/*----------------------------------------------------------------------------------------------------*/
LOCAL aResult, nAt:= oLbx:nAt, uBuffer, lContinue:= .t.
LOCAL bValid, nColReal:= nCol
LOCAL nSubTotal, nImport_1, nImport_2, nDescto_1, nDescto_2
nCol-- // Para que sea como si no exisiera la primer columna del BitMap flechita
uBuffer := aDatos[nAt,nCol]
DO WHILE .T.
DO CASE
CASE nCol == 1
bValid:= {|| aResult:= ValidaItems( @uBuffer, oSelf ), aResult[2] }
IF lContinue:= oLbx:lEditCol( nColReal, @uBuffer,, bValid, RGB(0,0,0), RGB(149,198,147) )
aDatos[nAt,1]:= uBuffer
aDatos[nAt,2]:= aResult[1]
aDatos[nAt,4]:= aResult[3]
ENDIF
CASE nCol == 3 // Cantidad
IF lContinue:= oLbx:lEditCol( nColReal, @uBuffer, "@Z 999,999,999",,RGB(0,0,0), RGB(149,198,147))
If uBuffer <= 0
MsgAlert("Debe Especificar una cantidad !!!")
Loop
EndIf
aDatos[nAt,3]:= uBuffer
ENDIF
CASE nCol == 4 // Costo Unitario
If lContinue:= oLbx:lEditCol( nColReal, @uBuffer, "@Z 999,999,999.99",,RGB(0,0,0), RGB(149,198,147) )
aDatos[nAt,4]:= uBuffer
ENDIF
CASE nCol == 5 // Descuento 1
If lContinue:= oLbx:lEditCol( nColReal, @uBuffer, "@Z 99.99",, RGB(0,0,0), RGB(149,198,147) )
aDatos[nAt,5]:= uBuffer
ENDIF
CASE nCol == 6 // Descuento 2
If lContinue:= oLbx:lEditCol( nColReal, @uBuffer, "@Z 99.99",, RGB(0,0,0), RGB(149,198,147) )
aDatos[nAt,6]:= uBuffer
aDatos[nAt,8]:= .F. // Ya no es un Nuevo Registro !!!
EndIf
CASE nCol == 7 .AND. ! lFirstEdit .and. Len( aDatos ) == nAt // Importe total
AddNewItem( aDatos, oLbx, hGets )
ENDCASE
IF ! lContinue .AND. aDatos[nAt,8] // Se habia agregado un nuevo Item !!!
DelSelItem( aDatos, oLbx, hGets, oGets )
RETURN .F.
ENDIF
EXIT
ENDDO
IF Len( aDatos ) > 0
// Estas operaciones son para poner el importe de la columna de Total aplicando
// los vbalores de las columnas Descuento-1 y Descuento-2
nSubTotal:= aDatos[nAt,3] * aDatos[nAt,4]
nDescto_1:= IF( aDatos[nAt,5] > 0, ( nSubTotal * ( aDatos[nAt,5] / 100) ), 0 )
nImport_1:= nSubTotal - nDescto_1
nDescto_2:= IF( aDatos[nAt,6] > 0, ( nImport_1 * ( aDatos[nAt,6] / 100) ), 0 )
nImport_2:= nImport_1 - nDescto_2
aDatos[nAt,7]:= nImport_2
SumaTotal( aDatos, hGets, oGets )
ENDIF
IF lContinue
DO CASE
CASE oLbx:nLastKey == VK_UP
return If( !GetKeyState(VK_SHIFT), -3, -2 )
CASE oLbx:nLastKey == VK_DOWN
return If( !GetKeyState(VK_SHIFT), 3, 2 )
CASE oLbx:nLastKey == VK_TAB
return If( GetKeyState(VK_SHIFT), -1, 1 )
ENDCASE
ENDIF
RETURN lContinue
/*----------------------------------------------------------------------------------------------------*/
STATIC Function AddNewItem( aDatos, oLbx, hGets )
// Funcion donde se agrega un nuevo elemento al arreglo de los datos del browse
/*----------------------------------------------------------------------------------------------------*/
LOCAL nAt, nDescto1, nDescto2
nDescto1:= 0
nDescto2:= 0
IF hGets["DESCTO1"] > 0
nDescto1:= hGets["DESCTO1"]
ENDIF
IF hGets["DESCTO2"] > 0
nDescto2:= hGets["DESCTO2"]
ENDIF
// Aqui se agrega un nuevo registro al browse
Aadd( aDatos, { Space(20), Space(45), 1, 0, nDescto1, nDescto2, 0, .T. } )
oLbx:Refresh()
oLbx:lHitBottom:= .F.
oLbx:GoBottom()
SysRefresh()
return NIL
/*----------------------------------------------------------------------------------------------------*/
STATIC Function DelSelItem( aDatos, oLbx, hGets, oGets )
// Elimina un elemento del arreglo lo cual significa un registro del browse
/*----------------------------------------------------------------------------------------------------*/
LOCAL nAt:= oLbx:nAt
ADel( aDatos, nAt )
ASize( aDatos, Len( aDatos ) - 1 )
oLbx:GoUp()
oLbx:Refresh()
SumaTotal( aDatos, hGets, oGets )
RETURN NIL
/*----------------------------------------------------------------------------------------------------*/
STATIC Function SumaTotal( aDatos, hGets, oGets )
/*----------------------------------------------------------------------------------------------------*/
LOCAL aItems, nSubTotal, nImport_1, nImport_2, nDescto_1, nDescto_2, nIva, nTotal
hGets["SUBTOTAL"]:= 0
hGets["DESCTOS"] := 0
hGets["TOT_IVA"] := 0
hGets["IMPORTE"] := 0
FOR EACH aItems IN aDatos
nSubTotal:= aItems[3] * aItems[4] // Cantidad * Costo Unitario
nDescto_1:= IF( aItems[5] > 0, ( nSubTotal * ( aItems[5] / 100) ), 0 )
nImport_1:= nSubTotal - nDescto_1
nDescto_2:= IF( aItems[6] > 0, ( nImport_1 * ( aItems[6] / 100) ), 0 )
nImport_2:= nImport_1 - nDescto_2
nIva := IF( hGets["IVA"] > 0, ( nImport_2 * ( hGets["IVA"] / 100) ), 0 )
nTotal := nImport_2 + nIva
hGets["SUBTOTAL"]+= nImport_2
hGets["DESCTOS"] += (nDescto_1 + nDescto_2)
hGets["TOT_IVA"] += nIva
hGets["IMPORTE"] += nTotal
END
// Y por fin aqui se actualiza los totales refrescando los TEXTBOX
oGets[15]:Refresh()
oGets[16]:Refresh()
oGets[17]:Refresh()
oGets[18]:Refresh()
RETURN NIL
/*----------------------------------------------------------------------------------------------------*/
STATIC FUNCTION ValidaItems( xVar, oSelf )
// Valida la clave del ITEM en esta caso son libros o sea la clave del libro y despliega una ventana
// en caso que la clave no se encuentre el archivo de catalogo
/*----------------------------------------------------------------------------------------------------*/
LOCAL cOLdOrder, lRetorno, aRetorno, cClave, cDescrip
cOldOrder:= ( oSelf:oTbLibros:cAlias )->( OrdSetFocus("CLAVE") )
IF oSelf:oTbLibros:Seek( xVar )
aRetorno:= { oSelf:oTbLibros:FieldGet( "TITULO" ), .T., oSelf:oTbLibros:FieldGet("COSTO") }
ELSE
lRetorno:= HlpTitulos( @cClave, xVar, @cDescrip, oSelf, 100, 200 )
IF lRetorno
aRetorno:= { oSelf:oTbLibros:FieldGet("TITULO"), .T., oSelf:oTbLibros:FieldGet("COSTO") }
xVar:= cClave
ELSE
aRetorno:= { " ", .F., 0 }
ENDIF
ENDIF
( oSelf:oTbLibros:cAlias )->( OrdSetFocus( cOldOrder ) )
RETURN aRetorno
[/code:37pq48la]Espero y te pueda servir yo tambien pase por esa jaqueca.. saludosGABO |
sumar una columna como le hago??? (YA RESUELTO GRACIAS) | Y tambien es igual con txbrowse es el que toy usando <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: --> me pondre a leerlo con calmita <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> Que lindo y muchas gracias <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> Aida <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: --> |
sumar una columna como le hago??? (YA RESUELTO GRACIAS) | Hola aida La forma de de definir un Listbox y que sume tu footer es la siguienteREDEFINE LISTBOX oLbx ; FIELDS oPreccos:Codigo , ; oPreccos:Nombre , ; transform(oPreccos:ventas,"999,999,999.99") , ; transform(oPreccos:Costo ,"999,999,999.99") , ; transform(oPreccos:margen,"999,999,999.99") , ; transform(oPreccos:utilidad,"999,999,999.99")+"%" ; HEADER "Código","Nombre","Ventas", "Costo","Utilidad","Margen" ; ID 172 ; OF oWndFact01 ; ON DBLCLICK funcion( variable para mandar a la funcion ) ; SIZES 40,380,75,75,75,50 UPDATE oPreccos:SetBrowse( oLbx ) oLbx:nLineHeight := 16 oLbx:nHeaderHeight := 16 oLbx:nFreeze := 4 oLbx:aHJustify:={2,2,2,2,2} oLbx:aJustify:={.t.,.f.,.t.,.t.,.t.} oLbx:lDrawFooters :=.T. oLbx:aActions := Array( 6 ) oLbx:aActions[1] := { || OrdenArEq( 3, 3 , oPreccos, oLbx,oWndFact01,aGets ) } oLbx:aActions[2] := { || OrdenArEq( 2, 3 , oPreccos, oLbx,oWndFact01,aGets ) } oLbx:aActions[3] := { || OrdenArEq( 1, 3 , oPreccos, oLbx,oWndFact01,aGets ) } oLbx:aActions[4] := { || OrdenArEq( 4, 3 , oPreccos, oLbx,oWndFact01,aGets ) } oLbx:aActions[5] := nil oLbx:aActions[6] := nil aTot1 := aTot1 + 1+2+3 etcaTot2 := aTot2 + 1+2+3 etcaTot3 := aTot3 + 1+2+3 etcaTot4 := aTot4 + 1+2+3 etc ///Esta seria la forma de sumar en el foote del oLbx oLbx:aFooters :={|| {"","Total",Tran(aTot[1],"9,999,999,999 "),Tran(aTot[2],"9,999,999,999 "),Tran(aTot[3],"9,999,999,999 "),Tran(aTot[4],"9,999,999,999 ") }}//Ahora para refrescar seria de la siguiente formaoWndFact01:Update() oLbx:Refresh()Espero que te sirva Atentamente Julio Ponce |
sumar una columna como le hago??? (YA RESUELTO GRACIAS) | Hola!!!Ya por fin le entendi ya pude poner una sumita en el en el Footer <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> y que se refresque cuando ponen o modifican un dato.agradesco mucho a:carlos vargas <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: --> gabo <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: --> jponce <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: --> Vicente Heredia Guijarro <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: --> y si me falto alguien tambien muchas gracias por su ayuda <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: --> es chistoso como algunas cosas nos pueden atorar y mas cuando nos bloqueamos del cerebrito pero con amigos como ustedes todo se aclara.AtentamenteAida <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: -->PD aqui falta una carita de beso y otra de habrazo <!-- s:wink: --><img src="{SMILIES_PATH}/icon_wink.gif" alt=":wink:" title="Wink" /><!-- s:wink: --> |
sumatraPDF ( SOLUCIONADO ) | Estimados
Alguien ocupa este software libre para imprimir archivos PDF
he seguido este post
[url:3ejkpbva]http://forums.fivetechsupport.com/viewtopic.php?f=3&t=14673&p=75921&hilit=sumatra+pdf#p75921[/url:3ejkpbva]
funciona bien en impresoras local, pero si esta en red esta no funciona, manda un mensaje de que no existe la impresora
adjunto el ejemplo
[code=fw:3ejkpbva]<div class="fw" id="{CB}" style="font-family: monospace;">cPrinter := prngetname<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">// \\rodrigo\BROTHER MFC-240 USB</span><br /><span style="color: #B900B9;">/*<br />ademas probe sacando el computador quedando asi<br /> BROTHER MFC-240 USB<br />*/</span><br /><br /><span style="color: #00C800;">for</span> i := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> len<span style="color: #000000;">(</span> aFilePdf <span style="color: #000000;">)</span><br /> cFile := aFilePdf<span style="color: #000000;">[</span>i<span style="color: #000000;">]</span><br /> cCmd := cSumatra + <span style="color: #ff0000;">' -Print-to "'</span> + ;<br /> alltrim<span style="color: #000000;">(</span> StrToken<span style="color: #000000;">(</span> cPrinter, <span style="color: #000000;">1</span>, <span style="color: #ff0000;">","</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> + ;<br /> <span style="color: #ff0000;">'" -exit-on-print '</span> + cFile<br /><br /> MsgRun<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Imprimiendo archivo "</span>+cFile, <span style="color: #ff0000;">"Espere.."</span>, ;<br /> <span style="color: #000000;">{</span> || winexec<span style="color: #000000;">(</span> cCmd, SW_HIDE <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">next</span> i</div>[/code:3ejkpbva] |
sumatraPDF ( SOLUCIONADO ) | La solucion es SACANDO UN POCO DE CARACTERES a la impresora
BROTHER MFC-240 USB a BROTHER MFC-240 y luego volver a instalar la impresora en las estaciones
para quien le sirva |
sumup | QUALCUNO DI VOI è RIUSCITO A COLLEGARE SUMUP AD UN PROGRAMAM IN FIVEWIN? |
super... objetos | Hola
[code=fw:3khbi676]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">class</span> t1<br /> <span style="color: #00C800;">method</span> guardar<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />end <span style="color: #00C800;">class</span><br /><br /><span style="color: #00C800;">class</span> t2 <span style="color: #0000ff;">from</span> t1<br /> <span style="color: #00C800;">method</span> guardar<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">method</span> pantalla<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />end <span style="color: #00C800;">class</span><br /><br /><span style="color: #00C800;">method</span> pantalla<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">class</span> T2<br /> ::<span style="color: #000000;">guardar</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">return</span> <span style="color: #000000;">(</span><span style="color: #00C800;">nil</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">method</span> guardar<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">class</span> T2<br /> <span style="color: #00C800;">SUPER</span>:<span style="color: #000000;">guardar</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <-------------------- aca necesito sber como llamar al metodo guardar de la clase T1 y despues seguir con las instrucciones <br /> ...<br /> ...<br /> <span style="color: #00C800;">return</span> <span style="color: #000000;">(</span><span style="color: #00C800;">nil</span><span style="color: #000000;">)</span><br /> </div>[/code:3khbi676]
cmo lo hago? |
super... objetos | Prueba este código
[code=fw:17jmqvtn]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">Local</span> oT2 := T2<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> oT2:<span style="color: #000000;">Guardar</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oT2:<span style="color: #00C800;">Super</span>:<span style="color: #000000;">Guardar</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #000000;">(</span> <span style="color: #00C800;">nil</span> <span style="color: #000000;">)</span> <br /><br /><span style="color: #00C800;">CLASS</span> T1<br /><br /> <span style="color: #00C800;">METHOD</span> Guardar<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br />END <span style="color: #00C800;">CLASS</span><br /><br /><span style="color: #00C800;">METHOD</span> Guardar<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> T1<br /><br /> ? <span style="color: #ff0000;">"Guardar T1"</span><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #000000;">(</span> <span style="color: #00C800;">nil</span> <span style="color: #000000;">)</span> <br /><br /><span style="color: #00C800;">CLASS</span> T2 <span style="color: #0000ff;">FROM</span> T1<br /><br /> <span style="color: #00C800;">METHOD</span> Guardar<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br />END <span style="color: #00C800;">CLASS</span><br /><br /><span style="color: #00C800;">METHOD</span> Guardar<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> T2<br /><br /> ? <span style="color: #ff0000;">"Guardar T2"</span><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #000000;">(</span> <span style="color: #00C800;">nil</span> <span style="color: #000000;">)</span><br /><br /><br /> </div>[/code:17jmqvtn] |
super... objetos | pasa que desde la clase T2 necesito llamar a la claase super guardar() |
super... objetos | Ok, entonces ...
[code=fw:311wj9fj]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">Local</span> oT2 := T2<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> oT2:<span style="color: #000000;">Guardar</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #000000;">(</span> <span style="color: #00C800;">nil</span> <span style="color: #000000;">)</span> <br /><br /><span style="color: #00C800;">CLASS</span> T1<br /><br /> <span style="color: #00C800;">METHOD</span> Guardar<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br />END <span style="color: #00C800;">CLASS</span><br /><br /><span style="color: #00C800;">METHOD</span> Guardar<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> T1<br /><br /> ? <span style="color: #ff0000;">"Guardar T1"</span><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #000000;">(</span> <span style="color: #00C800;">nil</span> <span style="color: #000000;">)</span> <br /><br /><span style="color: #00C800;">CLASS</span> T2 <span style="color: #0000ff;">FROM</span> T1<br /><br /> <span style="color: #00C800;">METHOD</span> Guardar<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br />END <span style="color: #00C800;">CLASS</span><br /><br /><span style="color: #00C800;">METHOD</span> Guardar<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #00C800;">CLASS</span> T2<br /><br /> ::<span style="color: #00C800;">Super</span>:<span style="color: #000000;">Guardar</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #000000;">(</span> <span style="color: #00C800;">nil</span> <span style="color: #000000;">)</span><br /><br /><br /><br /> </div>[/code:311wj9fj] |
super... objetos | Ganial. Gracias.
Me faltaban los :: delante del súper |
superbase | Can anyone tell me how to convert superbase files to dbase format? |
superbase | You´ll probably need to get an ODBC driver. |
support foreign language | Can I write my gets/reads,says in foreign langauge ? in VB I can write Arabic for example for text and variables got from screen . |
support foreign language | create table lang1.dbf:
clang1 c ,20
clang2 c,20
clang3 c,20
,...
index on clang1 to lang1
function main()
public nlang:=1
@1,1 get nlang of odlg
if nalng>1
use lang1 new
end
.....
rturn
All classes which include ccation like dialog,get,say,folder,checkbox,browse,..., about 10 classes modify like:
if nlang>1
select lang1
seek ::ccaption
if found()
::ccaption:=lang1->(fieldget(nlang))
end
end
Source prgs even not need modify , you can get your app support multi lang .
Best Regards!
Shuming Wang |
support foreign language | I need to ask a primitive question :
What will be the contents of lang1.dbf ? |
support foreign language | first field clang1 c ,20 as native language (original in source prg ) ted,others like clang2 as second foreign languange,... .
clang1 , clang2
not found , 没有发现 , ...
itemid , 编号 ,...
can't open , 打不开,...
date , 日期
regards
Shuming Wang |
swicth xbrowse datalines | on a xbrowse I use
[code=fw:16ecqtie]<div class="fw" id="{CB}" style="font-family: monospace;"> WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">4</span><span style="color: #000000;">]</span><br /> :<span style="color: #000000;">oHeaderFont</span>:= oBold<br /> <span style="color: #00C800;">IF</span> lMore<br /> :<span style="color: #000000;">bStrData</span> := <span style="color: #000000;">{</span> || oDbf:<span style="color: #000000;">Street</span> + CRLF +Padright<span style="color: #000000;">(</span>alltrim<span style="color: #000000;">(</span>oDbf:<span style="color: #000000;">city</span><span style="color: #000000;">)</span>+<span style="color: #ff0000;">" "</span>+ oDbf:<span style="color: #000000;">state</span>,<span style="color: #000000;">60</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">else</span><br /> :<span style="color: #000000;">bStrData</span> := <span style="color: #000000;">{</span> || Padright<span style="color: #000000;">(</span>oDbf:<span style="color: #000000;">Street</span>,<span style="color: #000000;">60</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">ENDIF</span><br /> END</div>[/code:16ecqtie]
IF lmore I change the ndatalines on xbrowse from 1 to 2
when I change on one line I see allways as lMore is true
[img:16ecqtie]https://i.postimg.cc/MGYgcQjS/1f.png[/img:16ecqtie]
when I set one line I see
[img:16ecqtie]https://i.postimg.cc/Bn9zMgT3/2.png[/img:16ecqtie]
while I must see only the oDbf:city
How I can resolve it? |
switch between multiple windows | How can we switch between multiple windows?
I tried with the following keys but with no success. Should this work?
ALT+F6: Switch between multiple windows in the same program
CTRL+TAB: Switch to next child window of a Multiple Document Interface (MDI) program
Thanks in advance
Otto |
switch between multiple windows | Otto,
Is it for a MDI windows application ? |
switch between multiple windows | Hello Antonio,
have you seen my post:
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=22052">viewtopic.php?f=3&t=22052</a><!-- l -->
I would like to start with a prototype. I thought to place some windows without borders inside a window.
Thanks in advance and best regards,
Otto |
switch between multiple windows | Otto,
May I suggest using panels instead.
Regards,
James |
switch between multiple windows | Otto,
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?p=117649#p117649">viewtopic.php?p=117649#p117649</a><!-- l --> |
switch data between FWH and excel 2007 | Hiany example for problem on subject ?I have this code: DEFINE WINDOW m_get[40] // ownd @ 0, 0 ACTIVEX m_get[41]; // oOWc PROGID "OWC11.Spreadsheet" m_get[44] = m_get[41]:GetProp( "ActiveWindow" ) OleSetProperty( m_get[44], "ColumnHeadings", 1, "Descrizione" ) OleSetProperty( m_get[44], "ColumnHeadings", 2, "Vendita Euro" ) OleSetProperty( m_get[44], "ColumnHeadings", 3, "Tot CM" ) OleSetProperty( m_get[44], "ColumnHeadings", 4, "% CM" ) OleSetProperty( m_get[44], "ColumnHeadings", 5, "Tot CU" ) OleSetProperty( m_get[44], "ColumnHeadings", 6, "% CU" ) m_get[42] = m_get[41]:GetProp( "ActiveSheet" ) //hsheetand worked fine on excel 2003but if I try that on excel 2007get window error.why? |
symbol € in picture | can I insert the symbol € into get and How ?
Can I insert it on Xbrowse, wbrowse ?
thanks |
symbol € in picture | Silvio,
I don't tested it but I think you can use "@R € 999.99".
To xBrowse I think using this with transform( ) it will display € like you want.
Regards,
Maurilio |
symbol € in picture | sorry I have an mistake...on my Head... I'm on bed and My head run!!!
Sorry... |
symbol € on xbrowse | How insert this symbol on a row of xbrowse and on footer ?
I made this but not show the symbol €
[code=fw:2lzdto0n]<div class="fw" id="{CB}" style="font-family: monospace;">WITH OBJECT oRLbx<br /> WITH OBJECT oRLbx:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">6</span> <span style="color: #000000;">]</span><br /> :<span style="color: #000000;">cFooter</span>:=<span style="color: #ff0000;">"Totale :"</span><br /> END<br /> WITH OBJECT oRLbx:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">7</span> <span style="color: #000000;">]</span><br /> :<span style="color: #000000;">nDataStrAlign</span> := AL_RIGHT<br /> :<span style="color: #000000;">cEditPicture</span> := <span style="color: #ff0000;">'@€ 99,999.99'</span><br /> :<span style="color: #000000;">lTotal</span> := .t.<br /> :<span style="color: #000000;">nTotal</span> := <span style="color: #000000;">0</span><br /> :<span style="color: #000000;">nFooterType</span> := AGGR_TOTAL<br /> :<span style="color: #000000;">nFootStrAlign</span> := AL_RIGHT<br /> END<br /> END<br /><br /> WITH OBJECT oRLbx<br /> :<span style="color: #000000;">nFooterLines</span> := <span style="color: #000000;">1</span><br /> :<span style="color: #000000;">nStretchCol</span> :=<span style="color: #000000;">-1</span><br /> :<span style="color: #000000;">lFooter</span>:= .T.<br /><br /> END</div>[/code:2lzdto0n] |
symbol € on xbrowse | Silvio,
try with cEditPicture:= "Alt+128 999,99"
(Alt + 128 is the symbol of euro )
Best Regards
Saluti
Giuseppe Romano |
symbol € on xbrowse | not run ! |
symbol € on xbrowse | This run for me ...
: :cEditPicture := "@ €99,999.99"
Best Regards |
symbol € on xbrowse | The below given code is working fine for me
[url=http://img824.imageshack.us/i/xbrowse.jpg/:27owhl1f][img:27owhl1f]http://img824.imageshack.us/img824/1183/xbrowse.jpg[/img:27owhl1f][/url:27owhl1f]
[code=fw:27owhl1f]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">Function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <br /> <span style="color: #00C800;">Local</span> oDlg,oBrw<br /> <span style="color: #00C800;">Local</span> aData:=<span style="color: #000000;">{</span> <span style="color: #000000;">{</span><span style="color: #ff0000;">"Item 1"</span>,<span style="color: #000000;">23.00</span><span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"Item 2"</span>,<span style="color: #000000;">10.50</span><span style="color: #000000;">}</span>,; <br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"Item 3"</span>, <span style="color: #000000;">0.60</span><span style="color: #000000;">}</span>,; <br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"Item 4"</span>, <span style="color: #000000;">0.00</span><span style="color: #000000;">}</span>,; <br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"Item 5"</span>, <span style="color: #000000;">0.00</span><span style="color: #000000;">}</span>,; <br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"Item 6"</span>, <span style="color: #000000;">0.00</span><span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /> <br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Testing xBrowse"</span><br /> <br /> @<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg;<br /> COLUMNS <span style="color: #000000;">1</span>,<span style="color: #000000;">2</span> ;<br /> HEADERS <span style="color: #ff0000;">"Item Name"</span>, <span style="color: #ff0000;">"Amount"</span> ;<br /> PICTURES ,<span style="color: #ff0000;">"9999.99"</span> ;<br /> ARRAY aData CELL LINES FOOTERS NOBORDER FASTEDIT<br /> <br /> <br /> oBrw:<span style="color: #000000;">ItemName</span>:<span style="color: #000000;">cFooter</span>:=<span style="color: #ff0000;">"Total"</span> <br /> <br /> WITH OBJECT oBrw:<span style="color: #000000;">Amount</span><br /> :<span style="color: #000000;">nEditType</span> := EDIT_GET<br /> :<span style="color: #000000;">cEditPicture</span> := <span style="color: #ff0000;">'@ €99,999.99'</span> <br /> :<span style="color: #000000;">lTotal</span>:=.T.<br /> :<span style="color: #000000;">nTotal</span>:=<span style="color: #000000;">0.00</span><br /> END<br /> <br /> oBrw:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> oBrw:<span style="color: #000000;">nStretchCol</span> := STRETCHCOL_WIDEST <br /> oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</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: #00C800;">Return</span> </div>[/code:27owhl1f]
Regards
Anser |
symbol € on xbrowse | Anserk
can you help me please
Look it please
Can you try this test sample please
it create also the dbf
[code=fw:1tlvjj2e]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Report.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xBrowse.ch"</span><br /><br />REQUEST DBFCDX<br />REQUEST DBFFPT<br />EXTERNAL ORDKEYNO,ORDKEYCOUNT,ORDCREATE,ORDKEYGOTO<br /><br /><span style="color: #00C800;">Function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">Local</span> oDlg,oBrw,aBrowseRb<br /> <span style="color: #00C800;">Local</span> aData:=<span style="color: #000000;">{</span> <span style="color: #000000;">{</span><span style="color: #ff0000;">"Item 1"</span>,<span style="color: #000000;">23.00</span><span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"Item 2"</span>,<span style="color: #000000;">10.50</span><span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"Item 3"</span>, <span style="color: #000000;">0.60</span><span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"Item 4"</span>, <span style="color: #000000;">0.00</span><span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"Item 5"</span>, <span style="color: #000000;">0.00</span><span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">"Item 6"</span>, <span style="color: #000000;">0.00</span><span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /><br /><br /><br /><br /> RddSetDefault<span style="color: #000000;">(</span> <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #000000;">)</span><br /><br /> Crea_dbf<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">//create and popolate dbf</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Testing xBrowse"</span><br /><br /> @<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg;<br /> CELL LINES FOOTERS NOBORDER FASTEDIT<br /><br /> aBrowseRb := <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> || RB->CodArt <span style="color: #000000;">}</span>, i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Codice"</span><span style="color: #000000;">)</span>, <span style="color: #000000;">40</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> || RB->Articolo<span style="color: #000000;">}</span>, i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Articolo"</span><span style="color: #000000;">)</span>,<span style="color: #000000;">140</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> || RB->Misura<span style="color: #000000;">}</span>, i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Unità"</span><span style="color: #000000;">)</span>, <span style="color: #000000;">50</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> || RB->Quantita<span style="color: #000000;">}</span>, i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Qt."</span><span style="color: #000000;">)</span>, <span style="color: #000000;">30</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> || RB->Iva<span style="color: #000000;">}</span>, i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Iva"</span><span style="color: #000000;">)</span>, <span style="color: #000000;">30</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> || RB->Unitario<span style="color: #000000;">}</span>, i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Unitario"</span><span style="color: #000000;">)</span>, <span style="color: #000000;">80</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> || TRANSFORM<span style="color: #000000;">(</span> RB->Totale,<span style="color: #ff0000;">'@E 999,999.99'</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span>, i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Totale"</span><span style="color: #000000;">)</span>, <span style="color: #000000;">90</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /><br /><br /> <span style="color: #00C800;">FOR</span> i := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> Len<span style="color: #000000;">(</span>aBrowseRb<span style="color: #000000;">)</span><br /> oCol := oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oCol:<span style="color: #000000;">bStrData</span> := aBrowseRb<span style="color: #000000;">[</span> i, <span style="color: #000000;">1</span> <span style="color: #000000;">]</span><br /> oCol:<span style="color: #000000;">cHeader</span> := aBrowseRb<span style="color: #000000;">[</span> i, <span style="color: #000000;">2</span> <span style="color: #000000;">]</span><br /> oCol:<span style="color: #000000;">nWidth</span> := aBrowseRb<span style="color: #000000;">[</span> i, <span style="color: #000000;">3</span> <span style="color: #000000;">]</span><br /> <span style="color: #00C800;">NEXT</span><br /><br /><br /><br /><br /><br /><br /> WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span><br /> :<span style="color: #000000;">cFooter</span>:=<span style="color: #ff0000;">"Total"</span><br /> END<br /> WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">6</span> <span style="color: #000000;">]</span><br /> :<span style="color: #000000;">nEditType</span> := EDIT_GET<br /> :<span style="color: #000000;">cEditPicture</span> := <span style="color: #ff0000;">'@ €99,999.99'</span><br /> :<span style="color: #000000;">lTotal</span>:=.T.<br /> :<span style="color: #000000;">nTotal</span>:=<span style="color: #000000;">0.00</span><br /> END<br /><br /> oBrw:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oBrw:<span style="color: #000000;">nStretchCol</span> := STRETCHCOL_WIDEST<br /> oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /> close all<br /> <span style="color: #00C800;">Return</span><br /><br /><br /><br /> <span style="color: #00C800;">Function</span> Crea_dbf<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> DbCreate<span style="color: #000000;">(</span><span style="color: #ff0000;">'RB'</span>, <span style="color: #000000;">{</span><span style="color: #000000;">{</span><span style="color: #ff0000;">'Documento'</span> , <span style="color: #ff0000;">'C'</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">0</span><span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'CodArt'</span> , <span style="color: #ff0000;">'C'</span>, <span style="color: #000000;">4</span>, <span style="color: #000000;">0</span><span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Articolo'</span> , <span style="color: #ff0000;">'C'</span>, <span style="color: #000000;">30</span>, <span style="color: #000000;">0</span><span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Misura'</span> , <span style="color: #ff0000;">'C'</span>, <span style="color: #000000;">8</span>, <span style="color: #000000;">0</span><span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Quantita'</span> , <span style="color: #ff0000;">'N'</span>, <span style="color: #000000;">4</span>, <span style="color: #000000;">0</span><span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Iva'</span> , <span style="color: #ff0000;">'N'</span>, <span style="color: #000000;">5</span>, <span style="color: #000000;">2</span><span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Unitario'</span> , <span style="color: #ff0000;">'N'</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">2</span><span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Totale'</span> , <span style="color: #ff0000;">'N'</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">2</span><span style="color: #000000;">}</span><span style="color: #000000;">}</span>, <span style="color: #ff0000;">'DBFCDX'</span><span style="color: #000000;">)</span><br /><br /> close all<br /> use &<span style="color: #000000;">(</span><span style="color: #ff0000;">'RB'</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">alias</span> RB <span style="color: #00C800;">new</span><br /> <span style="color: #0000ff;">select</span> RB<br /> <span style="color: #00C800;">if</span> FILE<span style="color: #000000;">(</span><span style="color: #ff0000;">'RICAMBI.DBF'</span><span style="color: #000000;">)</span><br /> delete file &<span style="color: #000000;">(</span><span style="color: #ff0000;">'RICAMBI.cdx'</span><span style="color: #000000;">)</span><br /> append <span style="color: #0000ff;">from</span> &<span style="color: #000000;">(</span><span style="color: #ff0000;">'RICAMBI'</span><span style="color: #000000;">)</span><br /> dbcommitall<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> close all<br /> delete file &<span style="color: #000000;">(</span><span style="color: #ff0000;">'RICAMBI.dbf'</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> close all<br /> rename &<span style="color: #000000;">(</span><span style="color: #ff0000;">'RB.dbf'</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">to</span> &<span style="color: #000000;">(</span><span style="color: #ff0000;">'RICAMBI.dbf'</span><span style="color: #000000;">)</span><br /> close all<br /><br /><br /> use ricambi <span style="color: #0000ff;">alias</span> RB <span style="color: #00C800;">new</span><br /> <span style="color: #00C800;">For</span> n=<span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">30</span><br /> RB-><span style="color: #000000;">(</span>DbAppend<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> Replace RB->Documento with <span style="color: #ff0000;">"0010"</span><br /> Replace RB->CodArt with strzero<span style="color: #000000;">(</span>n,<span style="color: #000000;">4</span><span style="color: #000000;">)</span><br /> Replace RB->Articolo with str<span style="color: #000000;">(</span>n<span style="color: #000000;">)</span><br /> Replace RB->Misura with <span style="color: #ff0000;">"SC"</span><br /> Replace RB->Quantita with n<span style="color: #000000;">+1</span><br /> Replace RB->Iva with <span style="color: #000000;">20</span><br /> Replace RB->Unitario with n<br /> Replace RB->Totale with <span style="color: #000000;">(</span>n*n<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">next</span><br /> <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//---------------------------------------------------------</span><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> </div>[/code:1tlvjj2e] |
symbol € on xbrowse | Hope it is working fine now.
Regards
Anser |
symbol € on xbrowse | yes, I insert the first mode but the second you made when I insert it on my application here not run ( make error on maketotals) |
symbol € on xbrowse | [quote="Silvio":1ovouj00]yes, I insert the first mode but the second you made when I insert it on my application here not run ( make error on maketotals)[/quote:1ovouj00]
Please check whether you have missed oBrw:SetRDD() in your code.
For eg.
[code=fw:1ovouj00]<div class="fw" id="{CB}" style="font-family: monospace;">oBrw:<span style="color: #000000;">SetRDD</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />oBrw:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span></div>[/code:1ovouj00]
Regards
[b:1ovouj00]Anser[/b:1ovouj00] |
symbol € on xbrowse | look it please
go to 2# mode
[code=fw:juwrth50]<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;">"Report.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xBrowse.ch"</span><br /><br />REQUEST DBFCDX<br />REQUEST DBFFPT<br />EXTERNAL ORDKEYNO,ORDKEYCOUNT,ORDCREATE,ORDKEYGOTO<br /><br /><br /> <span style="color: #B900B9;">// first mode OK</span><br /><span style="color: #B900B9;">/*<br /><br /> Function Main()<br /><br /> Local oDlg,oBrw<br /><br /> RddSetDefault( "DBFCDX" )<br /><br /> Crea_dbf() //create and popolate dbf<br /><br /> DEFINE DIALOG oDlg TITLE "Testing xBrowse" ;<br /> SIZE 600,400<br /><br /> @ 82.3, 4 FOLDEREX oFld PIXEL ADJUST ;<br /> ITEMS "&Richiedente","Guasto &segnalato","&Guasto riscontrato","Soluzione","Parti di ricambio";<br /> SIZE 280,80 ANIMATE SPEED 10<br /> oFld:nOption:=2<br /><br /> @0,0 XBROWSE oBrw SIZE 0,0 PIXEL OF oFld:aDialogs[5] ALIAS "RB";<br /> COLUMNS 'RB->CodArt','RB->Articolo','RB->Misura','RB->Quantita','RB->Iva','RB->Unitario','RB->Totale' ;<br /> COLSIZES 40,140,50,30,40,80,90 ;<br /> HEADERS i18n("Codice"),i18n("Articolo"), i18n("Unità"),i18n("Qt."),i18n("Iva"),i18n("Unitario"),i18n("Totale") ;<br /> PICTURES ,,,'@ 9999',,'@ €99,999.99','@ €99,999.99' ;<br /> CELL LINES FOOTERS NOBORDER FASTEDIT<br /><br /> WITH OBJECT oBrw:aCols[ 1 ]<br /> :cFooter:="Total"<br /> END<br /><br /> WITH OBJECT oBrw:aCols[ 4 ]<br /> :nEditType := EDIT_GET<br /> :lTotal:=.T.<br /> :nTotal:=000<br /> END<br /><br /><br /><br /> WITH OBJECT oBrw:aCols[ 6 ]<br /> :nEditType := EDIT_GET<br /> :lTotal:=.T.<br /> :nTotal:=0.00<br /> END<br /> WITH OBJECT oBrw:aCols[ 7 ]<br /> :nEditType := EDIT_GET<br /> :lTotal:=.T.<br /> :nTotal:=0.00<br /> END<br /> oBrw:MakeTotals()<br /> oBrw:nStretchCol := STRETCHCOL_WIDEST<br /> oBrw:CreateFromCode()<br /><br /> ACTIVATE DIALOG oDlg CENTERED<br /> Close All<br />Return<br /> */</span><br /><br /><span style="color: #B900B9;">// Second mode K.O.</span><br /><br /><span style="color: #B900B9;">//------------------//</span><br /><span style="color: #00C800;">Function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">Local</span> oDlg,oBrw,aBrowseRb<br /><br /> RddSetDefault<span style="color: #000000;">(</span> <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #000000;">)</span><br /><br /> Crea_dbf<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">//create and popolate dbf</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Testing xBrowse"</span><br /><br /> @<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ; <span style="color: #B900B9;">//ALIAS "RB";</span><br /> CELL LINES FOOTERS NOBORDER FASTEDIT<br /><br /><br /> aBrowseRb := <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> || RB->CodArt <span style="color: #000000;">}</span>, i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Codice"</span><span style="color: #000000;">)</span>, <span style="color: #000000;">40</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> || RB->Articolo<span style="color: #000000;">}</span>, i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Articolo"</span><span style="color: #000000;">)</span>,<span style="color: #000000;">140</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> || RB->Misura<span style="color: #000000;">}</span>, i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Unità"</span><span style="color: #000000;">)</span>, <span style="color: #000000;">50</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> || TRANSFORM<span style="color: #000000;">(</span> RB->Quantita,<span style="color: #ff0000;">'@99999'</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span>, i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Qt."</span><span style="color: #000000;">)</span>, <span style="color: #000000;">30</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> || RB->Iva<span style="color: #000000;">}</span>, i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Iva"</span><span style="color: #000000;">)</span>, <span style="color: #000000;">30</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> || TRANSFORM<span style="color: #000000;">(</span> RB->Unitario,<span style="color: #ff0000;">'@€ 999,999.99'</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span>, i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Unitario"</span><span style="color: #000000;">)</span>, <span style="color: #000000;">80</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> || TRANSFORM<span style="color: #000000;">(</span> RB->Totale,<span style="color: #ff0000;">'@€ 999,999.99'</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span>, i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Totale"</span><span style="color: #000000;">)</span>, <span style="color: #000000;">90</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /><br /><br /><br /> <span style="color: #00C800;">FOR</span> i := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> Len<span style="color: #000000;">(</span>aBrowseRb<span style="color: #000000;">)</span><br /> oCol := oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oCol:<span style="color: #000000;">bEditValue</span> := aBrowseRb<span style="color: #000000;">[</span> i, <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> <span style="color: #B900B9;">// Changed to bEditValue from bStrData</span><br /> oCol:<span style="color: #000000;">cHeader</span> := aBrowseRb<span style="color: #000000;">[</span> i, <span style="color: #000000;">2</span> <span style="color: #000000;">]</span><br /> oCol:<span style="color: #000000;">nWidth</span> := aBrowseRb<span style="color: #000000;">[</span> i, <span style="color: #000000;">3</span> <span style="color: #000000;">]</span><br /> <span style="color: #00C800;">NEXT</span><br /><br /> WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span><br /> :<span style="color: #000000;">cFooter</span>:=<span style="color: #ff0000;">"Total"</span><br /> END<br /><br /> WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">4</span> <span style="color: #000000;">]</span><br /> :<span style="color: #000000;">nEditType</span> := EDIT_GET<br /> :<span style="color: #000000;">lTotal</span>:=.T.<br /> :<span style="color: #000000;">nTotal</span>:=<span style="color: #000000;">0.00</span><br /> END<br /><br /> WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">6</span> <span style="color: #000000;">]</span><br /> :<span style="color: #000000;">nEditType</span> := EDIT_GET<br /> :<span style="color: #000000;">lTotal</span>:=.T.<br /> :<span style="color: #000000;">nTotal</span>:=<span style="color: #000000;">0.00</span><br /> END<br /><br /> WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">7</span> <span style="color: #000000;">]</span><br /> :<span style="color: #000000;">nEditType</span> := EDIT_GET<br /> :<span style="color: #000000;">lTotal</span>:=.T.<br /> :<span style="color: #000000;">nTotal</span>:=<span style="color: #000000;">0.00</span><br /> END<br /><br /><br /> oBrw:<span style="color: #000000;">nStretchCol</span> := STRETCHCOL_WIDEST<br /> <span style="color: #B900B9;">//oBrw:MakeTotals()</span><br /> oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oBrw:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> Close All<br /><span style="color: #00C800;">Return</span><br /><br /><br /><span style="color: #B900B9;">//----------------------------</span><br /><span style="color: #00C800;">Function</span> Crea_dbf<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> DbCreate<span style="color: #000000;">(</span><span style="color: #ff0000;">'RB'</span>, <span style="color: #000000;">{</span><span style="color: #000000;">{</span><span style="color: #ff0000;">'Documento'</span> , <span style="color: #ff0000;">'C'</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">0</span><span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'CodArt'</span> , <span style="color: #ff0000;">'C'</span>, <span style="color: #000000;">4</span>, <span style="color: #000000;">0</span><span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Articolo'</span> , <span style="color: #ff0000;">'C'</span>, <span style="color: #000000;">30</span>, <span style="color: #000000;">0</span><span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Misura'</span> , <span style="color: #ff0000;">'C'</span>, <span style="color: #000000;">8</span>, <span style="color: #000000;">0</span><span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Quantita'</span> , <span style="color: #ff0000;">'N'</span>, <span style="color: #000000;">4</span>, <span style="color: #000000;">0</span><span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Iva'</span> , <span style="color: #ff0000;">'N'</span>, <span style="color: #000000;">5</span>, <span style="color: #000000;">2</span><span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Unitario'</span> , <span style="color: #ff0000;">'N'</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">2</span><span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Totale'</span> , <span style="color: #ff0000;">'N'</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">2</span><span style="color: #000000;">}</span><span style="color: #000000;">}</span>, <span style="color: #ff0000;">'DBFCDX'</span><span style="color: #000000;">)</span><br /><br /> close all<br /> use &<span style="color: #000000;">(</span><span style="color: #ff0000;">'RB'</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">alias</span> RB <span style="color: #00C800;">new</span><br /> <span style="color: #0000ff;">select</span> RB<br /> <span style="color: #00C800;">if</span> FILE<span style="color: #000000;">(</span><span style="color: #ff0000;">'RICAMBI.DBF'</span><span style="color: #000000;">)</span><br /> delete file &<span style="color: #000000;">(</span><span style="color: #ff0000;">'RICAMBI.cdx'</span><span style="color: #000000;">)</span><br /> append <span style="color: #0000ff;">from</span> &<span style="color: #000000;">(</span><span style="color: #ff0000;">'RICAMBI'</span><span style="color: #000000;">)</span><br /> dbcommitall<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> close all<br /> delete file &<span style="color: #000000;">(</span><span style="color: #ff0000;">'RICAMBI.dbf'</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> close all<br /> rename &<span style="color: #000000;">(</span><span style="color: #ff0000;">'RB.dbf'</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">to</span> &<span style="color: #000000;">(</span><span style="color: #ff0000;">'RICAMBI.dbf'</span><span style="color: #000000;">)</span><br /> close all<br /><br /><br /> use ricambi <span style="color: #0000ff;">alias</span> RB <span style="color: #00C800;">new</span><br /> <span style="color: #00C800;">For</span> n=<span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">3</span><br /> RB-><span style="color: #000000;">(</span>DbAppend<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> Replace RB->Documento with <span style="color: #ff0000;">"0010"</span><br /> Replace RB->CodArt with strzero<span style="color: #000000;">(</span>n,<span style="color: #000000;">4</span><span style="color: #000000;">)</span><br /> Replace RB->Articolo with str<span style="color: #000000;">(</span>n<span style="color: #000000;">)</span><br /> Replace RB->Misura with <span style="color: #ff0000;">"SC"</span><br /> Replace RB->Quantita with n<span style="color: #000000;">+1</span><br /> Replace RB->Iva with <span style="color: #000000;">20</span><br /> Replace RB->Unitario with n<br /> Replace RB->Totale with <span style="color: #000000;">(</span>n*n<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">next</span><br /> Go Top<br /><br /><span style="color: #00C800;">return</span> ni</div>[/code:juwrth50] |
symbol € on xbrowse | [quote="Silvio":5po6v91u]Anserk
can you help me please[/quote:5po6v91u]
[url=http://img801.imageshack.us/i/xbrowse.jpg/:5po6v91u][img:5po6v91u]http://img801.imageshack.us/img801/1183/xbrowse.jpg[/img:5po6v91u][/url:5po6v91u]
[code=fw:5po6v91u]<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;">"Report.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xBrowse.ch"</span><br /><br />REQUEST DBFCDX<br />REQUEST DBFFPT<br />EXTERNAL ORDKEYNO,ORDKEYCOUNT,ORDCREATE,ORDKEYGOTO<br /><span style="color: #B900B9;">//------------------//</span><br /><span style="color: #00C800;">Function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">Local</span> oDlg,oBrw,aBrowseRb<br /><br /> RddSetDefault<span style="color: #000000;">(</span> <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #000000;">)</span><br /><br /> Crea_dbf<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">//create and popolate dbf</span><br /> <br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Testing xBrowse"</span><br /> <br /> @<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ; <span style="color: #B900B9;">//ALIAS "RB";</span><br /> CELL LINES FOOTERS NOBORDER FASTEDIT<br /> <br /> aBrowseRb := <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> || RB->CodArt <span style="color: #000000;">}</span>, i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Codice"</span><span style="color: #000000;">)</span>, <span style="color: #000000;">40</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> || RB->Articolo<span style="color: #000000;">}</span>, i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Articolo"</span><span style="color: #000000;">)</span>,<span style="color: #000000;">140</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> || RB->Misura<span style="color: #000000;">}</span>, i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Unità"</span><span style="color: #000000;">)</span>, <span style="color: #000000;">50</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> || RB->Quantita<span style="color: #000000;">}</span>, i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Qt."</span><span style="color: #000000;">)</span>, <span style="color: #000000;">30</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> || RB->Iva<span style="color: #000000;">}</span>, i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Iva"</span><span style="color: #000000;">)</span>, <span style="color: #000000;">30</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> || RB->Unitario<span style="color: #000000;">}</span>, i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Unitario"</span><span style="color: #000000;">)</span>, <span style="color: #000000;">80</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> || TRANSFORM<span style="color: #000000;">(</span> RB->Totale,<span style="color: #ff0000;">'@E 999,999.99'</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span>, i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Totale"</span><span style="color: #000000;">)</span>, <span style="color: #000000;">90</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /> <br /> <br /> <span style="color: #00C800;">FOR</span> i := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> Len<span style="color: #000000;">(</span>aBrowseRb<span style="color: #000000;">)</span><br /> oCol := oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oCol:<span style="color: #000000;">bEditValue</span> := aBrowseRb<span style="color: #000000;">[</span> i, <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> <span style="color: #B900B9;">// Changed to bEditValue from bStrData</span><br /> oCol:<span style="color: #000000;">cHeader</span> := aBrowseRb<span style="color: #000000;">[</span> i, <span style="color: #000000;">2</span> <span style="color: #000000;">]</span><br /> oCol:<span style="color: #000000;">nWidth</span> := aBrowseRb<span style="color: #000000;">[</span> i, <span style="color: #000000;">3</span> <span style="color: #000000;">]</span><br /> <span style="color: #00C800;">NEXT</span><br /> <br /> WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span><br /> :<span style="color: #000000;">cFooter</span>:=<span style="color: #ff0000;">"Total"</span><br /> END<br /> <br /> WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">6</span> <span style="color: #000000;">]</span><br /> :<span style="color: #000000;">nEditType</span> := EDIT_GET<br /> :<span style="color: #000000;">cEditPicture</span> := <span style="color: #ff0000;">'@ €99,999.99'</span><br /> :<span style="color: #000000;">lTotal</span>:=.T.<br /> :<span style="color: #000000;">nTotal</span>:=<span style="color: #000000;">0.00</span><br /> END<br /><br /> oBrw:<span style="color: #000000;">SetRDD</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> oBrw:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oBrw:<span style="color: #000000;">nStretchCol</span> := STRETCHCOL_WIDEST<br /> oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /> Close All<br /><span style="color: #00C800;">Return</span><br /><br /><br /><span style="color: #B900B9;">//----------------------------</span><br /><span style="color: #00C800;">Function</span> Crea_dbf<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> DbCreate<span style="color: #000000;">(</span><span style="color: #ff0000;">'RB'</span>, <span style="color: #000000;">{</span><span style="color: #000000;">{</span><span style="color: #ff0000;">'Documento'</span> , <span style="color: #ff0000;">'C'</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">0</span><span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'CodArt'</span> , <span style="color: #ff0000;">'C'</span>, <span style="color: #000000;">4</span>, <span style="color: #000000;">0</span><span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Articolo'</span> , <span style="color: #ff0000;">'C'</span>, <span style="color: #000000;">30</span>, <span style="color: #000000;">0</span><span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Misura'</span> , <span style="color: #ff0000;">'C'</span>, <span style="color: #000000;">8</span>, <span style="color: #000000;">0</span><span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Quantita'</span> , <span style="color: #ff0000;">'N'</span>, <span style="color: #000000;">4</span>, <span style="color: #000000;">0</span><span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Iva'</span> , <span style="color: #ff0000;">'N'</span>, <span style="color: #000000;">5</span>, <span style="color: #000000;">2</span><span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Unitario'</span> , <span style="color: #ff0000;">'N'</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">2</span><span style="color: #000000;">}</span> ,;<br /> <span style="color: #000000;">{</span><span style="color: #ff0000;">'Totale'</span> , <span style="color: #ff0000;">'N'</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">2</span><span style="color: #000000;">}</span><span style="color: #000000;">}</span>, <span style="color: #ff0000;">'DBFCDX'</span><span style="color: #000000;">)</span><br /> <br /> close all<br /> use &<span style="color: #000000;">(</span><span style="color: #ff0000;">'RB'</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">alias</span> RB <span style="color: #00C800;">new</span><br /> <span style="color: #0000ff;">select</span> RB<br /> <span style="color: #00C800;">if</span> FILE<span style="color: #000000;">(</span><span style="color: #ff0000;">'RICAMBI.DBF'</span><span style="color: #000000;">)</span><br /> delete file &<span style="color: #000000;">(</span><span style="color: #ff0000;">'RICAMBI.cdx'</span><span style="color: #000000;">)</span><br /> append <span style="color: #0000ff;">from</span> &<span style="color: #000000;">(</span><span style="color: #ff0000;">'RICAMBI'</span><span style="color: #000000;">)</span><br /> dbcommitall<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> close all<br /> delete file &<span style="color: #000000;">(</span><span style="color: #ff0000;">'RICAMBI.dbf'</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> close all<br /> rename &<span style="color: #000000;">(</span><span style="color: #ff0000;">'RB.dbf'</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">to</span> &<span style="color: #000000;">(</span><span style="color: #ff0000;">'RICAMBI.dbf'</span><span style="color: #000000;">)</span><br /> close all<br /> <br /> <br /> use ricambi <span style="color: #0000ff;">alias</span> RB <span style="color: #00C800;">new</span><br /> <span style="color: #00C800;">For</span> n=<span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">30</span><br /> RB-><span style="color: #000000;">(</span>DbAppend<span style="color: #000000;">(</span><span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> Replace RB->Documento with <span style="color: #ff0000;">"0010"</span><br /> Replace RB->CodArt with strzero<span style="color: #000000;">(</span>n,<span style="color: #000000;">4</span><span style="color: #000000;">)</span><br /> Replace RB->Articolo with str<span style="color: #000000;">(</span>n<span style="color: #000000;">)</span><br /> Replace RB->Misura with <span style="color: #ff0000;">"SC"</span><br /> Replace RB->Quantita with n<span style="color: #000000;">+1</span><br /> Replace RB->Iva with <span style="color: #000000;">20</span><br /> Replace RB->Unitario with n<br /> Replace RB->Totale with <span style="color: #000000;">(</span>n*n<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">next</span><br /> Go Top<br /> <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:5po6v91u]
We are advised to use bEditValue only. Codeblocks returning any datatype ( numeric, date, or whatever ) can be assigned to bEditValue. XBrowse internally constructs bStrData codeblock from bEditValue and cEditPicture ( if assigned ).
Here is the another way (easiest) way of using xBrowse.
[code=fw:5po6v91u]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">Function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">Local</span> oDlg,oBrw<br /><br /> RddSetDefault<span style="color: #000000;">(</span> <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #000000;">)</span><br /><br /> Crea_dbf<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">//create and popolate dbf</span><br /> <br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Testing xBrowse"</span><br /> <br /> @<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"RB"</span>;<br /> COLUMNS <span style="color: #ff0000;">'RB->CodArt'</span>,<span style="color: #ff0000;">'RB->Articolo'</span>,<span style="color: #ff0000;">'RB->Misura'</span>,<span style="color: #ff0000;">'RB->Quantita'</span>,<span style="color: #ff0000;">'RB->Iva'</span>,<span style="color: #ff0000;">'RB->Unitario'</span>,<span style="color: #ff0000;">'RB->Totale'</span> ;<br /> COLSIZES <span style="color: #000000;">40</span>,<span style="color: #000000;">140</span>,<span style="color: #000000;">50</span>,<span style="color: #000000;">30</span>,<span style="color: #000000;">40</span>,<span style="color: #000000;">80</span>,<span style="color: #000000;">90</span> ;<br /> HEADERS i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Codice"</span><span style="color: #000000;">)</span>,i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Articolo"</span><span style="color: #000000;">)</span>, i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Unità"</span><span style="color: #000000;">)</span>,i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Qt."</span><span style="color: #000000;">)</span>,i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Iva"</span><span style="color: #000000;">)</span>,i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Unitario"</span><span style="color: #000000;">)</span>,i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Totale"</span><span style="color: #000000;">)</span> ;<br /> PICTURES ,,,,,<span style="color: #ff0000;">'@ €99,999.99'</span>,<span style="color: #ff0000;">'@E 999,999.99'</span> ;<br /> CELL LINES FOOTERS NOBORDER FASTEDIT<br /> <br /> WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span><br /> :<span style="color: #000000;">cFooter</span>:=<span style="color: #ff0000;">"Total"</span><br /> END<br /> <br /> WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">6</span> <span style="color: #000000;">]</span><br /> :<span style="color: #000000;">nEditType</span> := EDIT_GET<br /> :<span style="color: #000000;">lTotal</span>:=.T.<br /> :<span style="color: #000000;">nTotal</span>:=<span style="color: #000000;">0.00</span><br /> END<br /> <br /> oBrw:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oBrw:<span style="color: #000000;">nStretchCol</span> := STRETCHCOL_WIDEST<br /> oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /> Close All<br /><span style="color: #00C800;">Return</span></div>[/code:5po6v91u]
Both the samples aer working fine.
Regards
[b:5po6v91u]Anser[/b:5po6v91u] |
symbol € on xbrowse | Anser the column I want the total is the seven not the six column
and if I modify this
WITH OBJECT oBrw:aCols[ 6]
:nEditType := EDIT_GET
:cEditPicture := '@ €99,999.99'
:lTotal:=.T.
:nTotal:=0.00
END
TO
[b:1nn52m85]WITH OBJECT oBrw:aCols[ 7 ]
:nEditType := EDIT_GET
:cEditPicture := '@ €99,999.99'
:lTotal:=.T.
:nTotal:=0.00
END[/b:1nn52m85]
here NOT RUN ( I see the footer but it not make the total) |
symbol € on xbrowse | If I Made:
@ 1, 1 XBROWSE oRLbx SIZE 0,0 PIXEL oFld:aDialogs[5] ALIAS "RB";
COLUMNS 'RB->CodArt','RB->Articolo','RB->Misura',;
'RB->Quantita','RB->Iva','RB->Unitario','RB->Totale' ;
COLSIZES 40,140,50,30,40,80,90 ;
HEADERS i18n("Codice"),i18n("Articolo"), i18n("Unità"),;
i18n("Qt."),i18n("Iva"),i18n("Unitario"),i18n("Totale") ;
PICTURES ,,,'@ 9999',,'@ €99,999.99','@ €99,999.99' ;
CELL LINES FOOTERS NOBORDER FASTEDIT
WITH OBJECT oRLbx:aCols[ 1 ]
:cFooter:="Total"
END
WITH OBJECT oRLbx:aCols[ 4 ]
:nEditType := EDIT_GET
:lTotal:=.T.
:nTotal:=000
END
WITH OBJECT oRLbx:aCols[ 6 ]
:nEditType := EDIT_GET
:lTotal:=.T.
:nTotal:=0.00
END
WITH OBJECT oRLbx:aCols[ 7 ]
:nEditType := EDIT_GET
:lTotal:=.T.
:nTotal:=0.00
END
oRLbx:MakeTotals()
oRLbx:nStretchCol := STRETCHCOL_WIDEST
oRLbx:CreateFromCode()
then make error
Application
===========
Path and name: C:\Work\Prg2\GUT\GUT.Exe (32 bits)
Size: 3,474,944 bytes
Time from start: 0 hours 0 mins 4 secs
Error occurred at: 08-03-2011, 09:27:55
Error description: Error BASE/1004 Class: 'NIL' has no exported method: ISKINDOF
Args:
[ 1] = U
[ 2] = C TDIALOG
Stack Calls
===========
Called from: => ISKINDOF(0)
Called from: .\source\classes\XBROWSE.PRG => XBROWSENEW(11627)
Called from: source\Pripara.prg => RPEDITA(439)
Called from: source\Pripara.prg => (b)RIPARAZIONI(170)
Called from: VMenu.prg => TVMENU:EVALACTION(1700)
Called from: VMenu.prg => TVMENU:LBUTTONUP(1398)
Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1489)
Called from: VMenu.prg => TVMENU:HANDLEEVENT(905)
Called from: .\source\classes\WINDOW.PRG => _FWH(3408)
Called from: => WINRUN(0)
Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE(992)
Called from: source\main.prg => TAPPLICATION:ACTIVATE(202)
Called from: source\main.prg => MAIN(51) |
symbol € on xbrowse | error here ?
if oWnd:IsKindOf( "TDIALOG" )
I use tfolferex there are problems ? |
symbol € on xbrowse | sorry I found the error
"OF" |
symbol € on xbrowse | Did you miss my post ?
[quote="anserkk":w538w7du]
Please check whether you have missed oBrw:SetRDD() in your code.
For eg.
[code=fw:w538w7du]<div class="fw" id="{CB}" style="font-family: monospace;">oBrw:<span style="color: #000000;">SetRDD</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />oBrw:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span></div>[/code:w538w7du]
Regards
[b:w538w7du]Anser[/b:w538w7du][/quote:w538w7du]
If you have decided not to use the xBrowse via xBrowse command syntax, then please use oCol:cEditPicture instead of Transform(). I have changed your code to use cEditPicture. Inserted the missing oBrw:SetRDD() in your code. The below given code is working fine for me. <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
[code=fw:w538w7du]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">Function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">Local</span> oDlg,oBrw,aBrowseRb,i<br /><br /> RddSetDefault<span style="color: #000000;">(</span> <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #000000;">)</span><br /><br /> Crea_dbf<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">//create and popolate dbf</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Testing xBrowse"</span><br /><br /> @<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"RB"</span>;<br /> CELL LINES FOOTERS NOBORDER FASTEDIT<br /><br /><br /> aBrowseRb := <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> || RB->CodArt <span style="color: #000000;">}</span>, i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Codice"</span><span style="color: #000000;">)</span>, <span style="color: #000000;">40</span>, <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> || RB->Articolo<span style="color: #000000;">}</span>, i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Articolo"</span><span style="color: #000000;">)</span>,<span style="color: #000000;">140</span>, <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> || RB->Misura<span style="color: #000000;">}</span>, i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Unità"</span><span style="color: #000000;">)</span>, <span style="color: #000000;">50</span>, <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> || RB->Quantita<span style="color: #000000;">}</span>, i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Qt."</span><span style="color: #000000;">)</span>, <span style="color: #000000;">30</span>,<span style="color: #ff0000;">'@99999'</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> || RB->Iva<span style="color: #000000;">}</span>, i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Iva"</span><span style="color: #000000;">)</span>, <span style="color: #000000;">30</span>, <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> || RB->Unitario<span style="color: #000000;">}</span>, i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Unitario"</span><span style="color: #000000;">)</span>, <span style="color: #000000;">80</span>,<span style="color: #ff0000;">'@ €999,999.99'</span> <span style="color: #000000;">}</span>,;<br /> <span style="color: #000000;">{</span> <span style="color: #000000;">{</span> || RB->Totale<span style="color: #000000;">}</span>, i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Totale"</span><span style="color: #000000;">)</span>, <span style="color: #000000;">90</span>,<span style="color: #ff0000;">'@ €999,999.99'</span> <span style="color: #000000;">}</span> <span style="color: #000000;">}</span><br /><br /> <span style="color: #00C800;">FOR</span> i := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> Len<span style="color: #000000;">(</span>aBrowseRb<span style="color: #000000;">)</span><br /> oCol := oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oCol:<span style="color: #000000;">bEditValue</span> := aBrowseRb<span style="color: #000000;">[</span> i, <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> <span style="color: #B900B9;">// Changed to bEditValue from bStrData</span><br /> oCol:<span style="color: #000000;">cHeader</span> := aBrowseRb<span style="color: #000000;">[</span> i, <span style="color: #000000;">2</span> <span style="color: #000000;">]</span><br /> oCol:<span style="color: #000000;">nWidth</span> := aBrowseRb<span style="color: #000000;">[</span> i, <span style="color: #000000;">3</span> <span style="color: #000000;">]</span><br /> <span style="color: #00C800;">if</span> !Empty<span style="color: #000000;">(</span>aBrowseRb<span style="color: #000000;">[</span> i, <span style="color: #000000;">4</span> <span style="color: #000000;">]</span><span style="color: #000000;">)</span><br /> oCol:<span style="color: #000000;">cEditPicture</span>:=aBrowseRb<span style="color: #000000;">[</span> i, <span style="color: #000000;">4</span> <span style="color: #000000;">]</span><br /> <span style="color: #00C800;">Endif</span><br /> <span style="color: #00C800;">NEXT</span><br /><br /> WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span><br /> :<span style="color: #000000;">cFooter</span>:=<span style="color: #ff0000;">"Total"</span><br /> END<br /><br /> WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> <span style="color: #000000;">4</span> <span style="color: #000000;">]</span><br /> :<span style="color: #000000;">nEditType</span> := EDIT_GET<br /> :<span style="color: #000000;">lTotal</span>:=.T.<br /> :<span style="color: #000000;">nTotal</span>:=<span style="color: #000000;">0.00</span><br /> END<br /><br /> <span style="color: #00C800;">For</span> i:=<span style="color: #000000;">6</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">7</span><br /> WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span> i <span style="color: #000000;">]</span><br /> :<span style="color: #000000;">nEditType</span> := EDIT_GET<br /> :<span style="color: #000000;">lTotal</span>:=.T.<br /> :<span style="color: #000000;">nTotal</span>:=<span style="color: #000000;">0.00</span><br /> END<br /> <span style="color: #00C800;">Next</span><br /><br /> oBrw:<span style="color: #000000;">SetRDD</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oBrw:<span style="color: #000000;">nStretchCol</span> := STRETCHCOL_WIDEST<br /> oBrw:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /> Close All<br /><span style="color: #00C800;">Return</span></div>[/code:w538w7du]
Regards
[b:w538w7du]Anser[/b:w538w7du] |
symbol € on xbrowse | Now run also here
Perhaps Nages tell me once to rem setrdd() I don't Know why...
thanks |
symbol € on xbrowse | If you utilise xBrowse command style syntax then you don't have to provide oBrw:SetRDD() and xBrowse will do the required setups automatically. Please see the code (2nd one) which I have posted in this topic. <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=21058#p111886">viewtopic.php?f=3&t=21058#p111886</a><!-- l --> There I have NOT used SetRDD(). If you are using command syntax, this is automatically taken care of.
[code=fw:2kv8ilul]<div class="fw" id="{CB}" style="font-family: monospace;">@<span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"RB"</span>;<br /> COLUMNS <span style="color: #ff0000;">'CodArt'</span>,<span style="color: #ff0000;">'Articolo'</span>,<span style="color: #ff0000;">'Misura'</span>,<span style="color: #ff0000;">'Quantita'</span>,<span style="color: #ff0000;">'Iva'</span>,<span style="color: #ff0000;">'Unitario'</span>,<span style="color: #ff0000;">'Totale'</span> ;<br /> COLSIZES <span style="color: #000000;">40</span>,<span style="color: #000000;">140</span>,<span style="color: #000000;">50</span>,<span style="color: #000000;">30</span>,<span style="color: #000000;">40</span>,<span style="color: #000000;">80</span>,<span style="color: #000000;">90</span> ;<br /> HEADERS i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Codice"</span><span style="color: #000000;">)</span>,i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Articolo"</span><span style="color: #000000;">)</span>, i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Unità"</span><span style="color: #000000;">)</span>,i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Qt."</span><span style="color: #000000;">)</span>,i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Iva"</span><span style="color: #000000;">)</span>,i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Unitario"</span><span style="color: #000000;">)</span>,i18n<span style="color: #000000;">(</span><span style="color: #ff0000;">"Totale"</span><span style="color: #000000;">)</span> ;<br /> PICTURES ,,,,,<span style="color: #ff0000;">'@ €99,999.99'</span>,<span style="color: #ff0000;">'@E 999,999.99'</span> ;<br /> CELL LINES FOOTERS NOBORDER FASTEDIT<br /> </div>[/code:2kv8ilul]
Regards
[b:2kv8ilul]Anser[/b:2kv8ilul] |
symbol € on xbrowse | ok |
syntax function FW_AdoImportFromDBF | what is syntax function FW_AdoImportFromDBF
best regards
kajot |
syntax function FW_AdoImportFromDBF | function FW_AdoImportFromDBF( oCn, cDbf, cAdoTable, cColPrefix, nMultiRowSize, aFields ) |
syntax for passing variable as reference type | can some one clear my doubt.
syntax for passing variable as reference type
thanks in advance |
syntax for passing variable as reference type | Dear Sajith,
To pass a variable by reference you should use @ along with the variable. For eg
[code=fw:1taq3x5q]<div class="fw" id="{CB}" style="font-family: monospace;">@<span style="color: #000000;">10</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">BUTTON</span> oBtn <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Save"</span> <span style="color: #0000ff;">ACTION</span> MyFunc<span style="color: #000000;">(</span>@cName,@nAge,dDateOfBirth<span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">FUNCTION</span> MyFunc<span style="color: #000000;">(</span>cName,nAge,dDateOfBirth<span style="color: #000000;">)</span> <br />.....<br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span></div>[/code:1taq3x5q]
The first 2 variables are passed by reference and the last one is passed by value
Hope it is clear to you
Regards
Anser |
syntax for passing variable as reference type | thank u for ur Support
Regards
sajith <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> |
syntax on a class | I with create a method if I have a logic value .t.
[b:122qdnrv]METHOD SetUpperCaps(lUpp) INLINE if(lUpp, ::func1(),::func2())[/b:122qdnrv]
or
how I must make it ? |
syntax on a class | Silvio,
Normally you would do something like this:
[code=fw:20wdm049]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">Method</span> SetUpper<span style="color: #000000;">(</span> lUpper <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> lUpper != <span style="color: #00C800;">nil</span><br /> ::<span style="color: #000000;">lUpper</span>:= lUpper<br /> <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">return</span> ::<span style="color: #000000;">lUpper</span><br /><br /><span style="color: #00C800;">Method</span> Whatever<span style="color: #000000;">(</span> cString <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lUpper</span><br /> cString:= upper<span style="color: #000000;">(</span> cString <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">return</span> cString<br /> </div>[/code:20wdm049]
Note that you could just access ::lUpper directly like oObj:lUpper:=.t. without the setUpper() method, but OOP principles state that no DATA should be accessed directly, but rather should be set using a method. This does prevent data from being changed that may depend on other settings (DATA) being set a particular way, and visa versa. I think this is a bigger concern when you have multiple programmers working on a project that might not be fully aware of the consequences of changing DATA directly.
However, your definition could work. Did you try it? However, if you need to pass something to either func1() or func2() then they would have to be passed to the setUpper() method which is very confusing. It is better to set the DATA (::lUpper) then use that data in a method that does different things depending on its value (such as my Whatever() method).
James |
syntax on a class | resolve
xhabour not want !lUpp on comand inline |
systime | Antonio,
tdatapick and ttimepick( with sysxxxx.c) are include on new fw 7.12 ? |
systime | Silvio,
We have not included any modules from you as you were considering to sell them, so we were respecting your desition |
systray and shellexecute | Does someone have a sample with systray and shellexecute.I inserted following code into testtray.prg of the fivewin samples.Testdlg is executed but not shown. MENUITEM "Testdlg" ACTION ( nRet:= Shellexecute(0,0,"c:\FWH\samples\test\testdlg.exe","c:\FWH\samples\test",1),msginfo(nRet)) MENUITEM "winexec" ACTION winexec ("c:\xwinhotel\xwinhotel.exe")is working. But how can I setup the woring directory?Thanks in advanceOtto |
systray and shellexecute | Otto,It seems that you are not using the right parameters when calling ShellExecute:HINSTANCE ShellExecute( HWND hwnd, // handle to parent window LPCTSTR lpOperation, // pointer to string that specifies operation to perform LPCTSTR lpFile, // pointer to filename or folder name string LPCTSTR lpParameters, // pointer to string that specifies executable-file parameters LPCTSTR lpDirectory, // pointer to string that specifies default directory INT nShowCmd // whether file is shown when opened ); |
systray and shellexecute | Antonio,thank you for your help.Yes the parameters where wrong.Regards,Otto |
tActivex | Hi
I found this code sample by Enrico for displaying a pdf
oPdf := TActiveX():New( oWnd, "AcroPDF.PDF" )
oPdf:Do( "LoadFile", "WIP-14.PDF")
oWnd:oClient := oPdf
This works fine but when I place the code in the action of a button
the "oWnd:oClient := oPdf" does not work , the pdf opens but is not
a client of oWnd - how can I set it to work properly.
Regards
Colin |
tActivex | Hi
I think you can try it below:
[code:2bemh9sg]
Function Main()
Local oWnd, oBtn
DEFINE WINDOW oWnd TITLE "Main Window"
............
@ 5, 5 Button ...... Action OpenPDF()
ACTIVATE WINDOW oWnd
RETURN NIL
Function OpenPDF()
LOCAL oPdfWnd, oPdf
DEFINE WINDOW oPdfWnd TITLE "Open PDF Window"
oPdf := TActiveX():New( oPdfWnd, "AcroPDF.PDF" )
oPdf:Do( "LoadFile", "WIP-14.PDF")
oPdfWnd:oClient := oPdf
ACTIVATE WINDOW oPdfWnd
RETURN NIL
[/code:2bemh9sg]
Regards,
Richard |
tAds 2.1b | VERSION 2.1b
============
* Novos Methods
- Method DataLoadToFR(f_oFastRep,f_cTituloGrupo) > Parametriza Grupos e Variaveis para o objeto FastReport
Exemplo:
oFastRep := frReportManager():new()
oFastRep:SetIcon(1)
oFastRep:ClearDataSets()
oFastRep:LoadLangRes( "brazil.frc")
oFastRep:SetTitle( "Dados do Cliente" )
oFastRep:PreviewOptions:SetAllowEdit( .F. )
oFastRep:PreviewOptions:SetZoomMode(2)
oFastRep:ClearDataSets()
oFastRep:LoadFromFile("ClienteDados.fr3")
oDb_Clientes := DB_CLIENTES():OpenRdd()
oDb_Clientes:GoTo(100) // Ir para registro 100
oDb_Clientes:DataLoadToFR(oFastRep,"Cliente Dados") // Todos os campos serão parametrizados no Relatorio de Fast Report
oFastRep:DesignReport()
oFastRep:ClearDataSets()
oFastRep:DestroyFR()
-Method DsAddVar(f_cTxtVarInQuery,f_uVarBlock) e DsSetVar(f_cTxtVarInQuery,f_uVarBlock)
Exemplo:
oDs_ListaCliente := tAds():DsNew(1)
oDs_ListaCliente:cQrySql := "Select * from CLIENTES Where DT_ANIVER >= _DtHoje_ and DT_ANIVER <= _DtSemana_ Order By DT_ANIVER"
oDs_ListaCliente:DsAddVar("_DtHoje_",Date())
oDs_ListaCliente:DsAddVar("_DtSemana_",Date()+7)
oDs_ListaCliente:DsExecute()
(oDs_ListaCliente:cAlias)->(xBrowse())
oDs_ListaCliente:End()
oDs_MyQuery := tAds():DsNew(1)
oDs_MyQuery:cQrySql := "Select * from CLIENTES Where SALARIO > _Salario_"
oDs_MyQuery:DsAddVar("_Salario_",1200.00)
oDs_MyQuery:DsExecute()
(oDs_MyQuery:cAlias)->(xBrowse())
oDs_MyQuery:End()
oDb_Clientes := tAds():NewRdd("CLIENTES")
oDs_MyQuery := tAds():DsNew(1)
oDs_MyQuery:cQrySql := "Select * from VENDAS Where COD_CLIENTE == _CodigoCliente_"
oDs_MyQuery:DsAddVar("_CodigoCliente_",{||oDb_Clientes:VarGet("CODIGO")})
Do While !oDb_Clientes:Eof()
oDs_MyQuery:DsExecute()
oDb_Clientes:Skip()
EndDo
Repositorio de tAds
[url:1wmn2ysw]https://tads-class-for-harbour.googlecode.com/svn/trunk[/url:1wmn2ysw] |
tAds Class 2.1 Open source | DownLoad by tortoise: <!-- m --><a class="postlink" href="http://tads-class-for-harbour.googlecode.com/svn/trunk/">http://tads-class-for-harbour.googlecode.com/svn/trunk/</a><!-- m -->
Page [url:395buzly]http://tads-class-for-harbour.googlecode.com[/url:395buzly]
Forum [url:395buzly]http://groups.google.com/group/tads-class-for-harbour-discuss[/url:395buzly] |
tAds Class 2.1 Open source | DownLoad by tortoise: <!-- m --><a class="postlink" href="http://tads-class-for-harbour.googlecode.com/svn/trunk/">http://tads-class-for-harbour.googlecode.com/svn/trunk/</a><!-- m -->
Page [url:2042tkor]http://tads-class-for-harbour.googlecode.com[/url:2042tkor]
Forum [url:2042tkor]http://groups.google.com/group/tads-class-for-harbour-discuss[/url:2042tkor]
VERSION 2.1
===========
* Função para verificar a Versão de tAds
- tAds_Version() -> 2.1
* Novas funções para efeitos de transações em multi conexão
- tAds_Begintransaction(f_nConnection)
- tAds_CommitTransaction(f_nConnection)
- tAds_RollBackTransaction(f_nConnection)
Use f_nconnection para determinar qual conexão deseja aplicar as funções.
Caso f_nConnection igual a Nil, sera aplicado na conexão Default determinada por tAdsConnectionDefault() |
tAnimate ? | Hola amigos
Alguien me puede decir como se podria poner una imagen con la clase Tanimate como la que aparece en link ?
Un saludo y gracias desde ya
[url:9b9mq7r6]http://img50.imageshack.us/img50/299/animate1pe.png[/url:9b9mq7r6] |
tAnimate ? | Revisa samples\copyfile.prg |
tAnimate ? | Gracias Antonio, ya lo to tengo funcioando
METHOD CopyInternet() BLOCK { | Self, h | h := LoadLibrary( "shell32.dll" ),;
::OpenEx( h, 170 ), FreeLibrary( h ) }
un saludo |
tAnimate ? | Cierto, es la solución correcta. Gracias |
tAplication Create applications(window menu bar.. | Helloan application example, Class taplication()window main, menu, bar<!-- m --><a class="postlink" href="http://www.box.net/shared/vx7wvafwwk">http://www.box.net/shared/vx7wvafwwk</a><!-- m --> greetingsFrancisco Nuñez LIMA-PERU |
tAplication Create applications(window menu bar.. | Hello from Germany,it looks very nice and fits more together with the office-bar.RegardsUwe |
tAplication Estilo de Crear aplicaciones (window menu bar.. | Saludos a todosaqui les dejo un estilo de construir aplicaciones mediante parametros, el ejemplo muestra los detalles (window principal menus y barra de herramientas)<!-- m --><a class="postlink" href="http://www.box.net/shared/vx7wvafwwk">http://www.box.net/shared/vx7wvafwwk</a><!-- m -->espero les guste.SaludosFrancisco NuñezLIMA-PERU |
tAplication Estilo de Crear aplicaciones (window menu bar.. | Buen aporte Francisco, me ha parecido muy interesante tu clase tAplication.Gracias por compartirla. |
tArrayData | Buenas noches, estoy necesitando filtrar en un tArrayData por fecha y no logro hacerlo, me da error.
Ejemplo: 1
[code=fw:1a43qvdv]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> cFilter += <span style="color: #000000;">[</span>id_cliente=<span style="color: #000000;">]</span> + FW_ValToSQL<span style="color: #000000;">(</span>::<span style="color: #000000;">id_contribuyente</span><span style="color: #000000;">)</span> + <span style="color: #ff0000;">" "</span><br /> cFilter += <span style="color: #ff0000;">" .AND. "</span> + <span style="color: #000000;">[</span>DTOS<span style="color: #000000;">(</span>cpte_fecha<span style="color: #000000;">)</span>>=<span style="color: #000000;">]</span> + ClipValue2SQL<span style="color: #000000;">(</span>DTOS<span style="color: #000000;">(</span>dFecDes<span style="color: #000000;">)</span><span style="color: #000000;">)</span> <br /> cFilter += <span style="color: #ff0000;">" .AND. "</span> + <span style="color: #000000;">[</span>DTOS<span style="color: #000000;">(</span>cpte_fecha<span style="color: #000000;">)</span><=<span style="color: #000000;">]</span> + ClipValue2SQL<span style="color: #000000;">(</span>DTOS<span style="color: #000000;">(</span>dFecHas<span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> </div>[/code:1a43qvdv]
Time from start: 0 hours 0 mins 14 secs
Error occurred at: 31/08/2020, 19:08:38
Error description: Error BASE/1003 Variable does not exist: CPTE_FECHA
Ejemplo:2
[code=fw:1a43qvdv]<div class="fw" id="{CB}" style="font-family: monospace;"> cFilter += <span style="color: #ff0000;">" .AND. "</span> + <span style="color: #000000;">[</span>cpte_fecha>=<span style="color: #000000;">]</span> + FW_ValToSQL<span style="color: #000000;">(</span>dFecDes<span style="color: #000000;">)</span><br /> cFilter += <span style="color: #ff0000;">" .AND. "</span> + <span style="color: #000000;">[</span>cpte_fecha<=<span style="color: #000000;">]</span> + FW_ValToSQL<span style="color: #000000;">(</span>dFecHas<span style="color: #000000;">)</span><br /> </div>[/code:1a43qvdv]
Time from start: 0 hours 0 mins 16 secs
Error occurred at: 31/08/2020, 19:07:03
Error description: Error BASE/1076 Argument error: >=
Args:
[ 1] = D 28/08/2020
[ 2] = C 2020-08-01 |
tArrayData | When you use a TArrayData object, use filters with familiar Clipper/Harbour syntax.
Build filter expressions exactly the same way you do for DBF.
Example:
[code=fw:2pdn5hb3]<div class="fw" id="{CB}" style="font-family: monospace;"><br />cState := <span style="color: #ff0000;">"NY"</span><br />dDate := STOD<span style="color: #000000;">(</span> <span style="color: #ff0000;">"19990101"</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">// cFilter := "STATE = '" + cState + "' .AND. HIREDATE >= STOD( '" + DTOS( dDate ) "' )" // This is difficult to write</span><br /><span style="color: #B900B9;">// Here is a simple way</span><br /><br />cFilter := DBF_ApplyParams<span style="color: #000000;">(</span> <span style="color: #ff0000;">"STATE = ? .AND. HIREDATE >= ?"</span>, <span style="color: #000000;">{</span> cState, dDate <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><br />oData:<span style="color: #000000;">SetFilter</span><span style="color: #000000;">(</span> cFilter <span style="color: #000000;">)</span><br /> </div>[/code:2pdn5hb3] |
tArrayData | Instead of this:
[code=fw:281jl3yk]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> cFilter += <span style="color: #000000;">[</span>id_cliente=<span style="color: #000000;">]</span> + FW_ValToSQL<span style="color: #000000;">(</span>::<span style="color: #000000;">id_contribuyente</span><span style="color: #000000;">)</span> + <span style="color: #ff0000;">" "</span><br /> cFilter += <span style="color: #ff0000;">" .AND. "</span> + <span style="color: #000000;">[</span>DTOS<span style="color: #000000;">(</span>cpte_fecha<span style="color: #000000;">)</span>>=<span style="color: #000000;">]</span> + ClipValue2SQL<span style="color: #000000;">(</span>DTOS<span style="color: #000000;">(</span>dFecDes<span style="color: #000000;">)</span><span style="color: #000000;">)</span> <br /> cFilter += <span style="color: #ff0000;">" .AND. "</span> + <span style="color: #000000;">[</span>DTOS<span style="color: #000000;">(</span>cpte_fecha<span style="color: #000000;">)</span><=<span style="color: #000000;">]</span> + ClipValue2SQL<span style="color: #000000;">(</span>DTOS<span style="color: #000000;">(</span>dFecHas<span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> </div>[/code:281jl3yk]
Use this code:
[code=fw:281jl3yk]<div class="fw" id="{CB}" style="font-family: monospace;">cFilter := DBF_ApplyParams<span style="color: #000000;">(</span> <span style="color: #ff0000;">"id_cliente = ? .AND. cpte_fecha >= ? .AND. cpte_fecha <= ?"</span>, <span style="color: #000000;">{</span> ::<span style="color: #000000;">id_contribuyente</span>, dFecDes, dFecHas <span style="color: #000000;">}</span> <span style="color: #000000;">)</span></div>[/code:281jl3yk]
Easy to write, easy to understand and easy to maintain and most importantly, bug-free.
Note: The function DBF_ApplyParams() was first released in FWH1905. |
tArrayData | Buenas tardes Mr Rao
Anduvo perfecto, muy agradecido haces desde el domingo que estoy con esto pero quería agotar todas las posibilidades antes de molestar.
Corrijo el mensaje,
Me da este error usandolo asi tal cual:
cFilter := DBF_ApplyParams( "id_cliente = ? .AND. cpte_fecha >= ? .AND. cpte_fecha <= ?", { ::id_contribuyente, dFecDes, dFecHas } )
Time from start: 0 hours 0 mins 19 secs
Error occurred at: 01/09/2020, 16:34:03
Error description: Error BASE/1003 Variable does not exist: CPTE_FECHA
Saludos
Marcelo |
tArrayData | [img:o795nh71]https://i.postimg.cc/6p2t9SgT/RAO-FILTER.png[/img:o795nh71]
Fijese la fecha que me pone Mr Rao. |
tArrayData | [quote:2d10ef4j]Error description: Error BASE/1003 Variable does not exist: CPTE_FECHA[/quote:2d10ef4j]
Use the field name that exists in your TArrayData object. |
tArrayData | Asi es Mr Rao. utilizo los campos que se corresponden. |
tArrayData | We will check and come back to you.
Let us also know your FWH version. |
tArrayData | Firstly, thank you for bringing this problem to our notice.
There is a bug when the same field name is used twice in the same expression.
This is fixed in the next version to be released.
If you let us know the FWH version you are using, we will also provide you the solution suitable for your version. |
tArrayData | This is the fix:
\fwh\source\function\vstrfun1.prg
function FW_ExprnAsBlock(....)
Please locate these lines: (353 to 359)
[code=fw:vrabl2kp]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">if</span> ValType<span style="color: #000000;">(</span> cFormat <span style="color: #000000;">)</span> == <span style="color: #ff0000;">"B"</span><br /> AEval<span style="color: #000000;">(</span> aStruct, <span style="color: #000000;">{</span> |a,i| FW_At<span style="color: #000000;">(</span> c := Trim<span style="color: #000000;">(</span> a<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span>, @cTran, <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, .t., .t., <span style="color: #00C800;">nil</span>, ;<br /> Eval<span style="color: #000000;">(</span> cFormat, i, c <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> AEval<span style="color: #000000;">(</span> aStruct, <span style="color: #000000;">{</span> |a,i| FW_At<span style="color: #000000;">(</span> Trim<span style="color: #000000;">(</span> a<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span>, @cTran, <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, .t., .t., <span style="color: #00C800;">nil</span>, ;<br /> Transform<span style="color: #000000;">(</span> i, cFormat <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> </div>[/code:vrabl2kp]
Substitute with:
[code=fw:vrabl2kp]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">if</span> ValType<span style="color: #000000;">(</span> cFormat <span style="color: #000000;">)</span> == <span style="color: #ff0000;">"B"</span><br /> AEval<span style="color: #000000;">(</span> aStruct, <span style="color: #000000;">{</span> |a,i| FW_At<span style="color: #000000;">(</span> c := Trim<span style="color: #000000;">(</span> a<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span>, @cTran, <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, .t., .t., <span style="color: #00C800;">nil</span>, ;<br /> Eval<span style="color: #000000;">(</span> cFormat, i, c <span style="color: #000000;">)</span>, .t. <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">else</span><br /> AEval<span style="color: #000000;">(</span> aStruct, <span style="color: #000000;">{</span> |a,i| FW_At<span style="color: #000000;">(</span> Trim<span style="color: #000000;">(</span> a<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span>, @cTran, <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span>, .t., .t., <span style="color: #00C800;">nil</span>, ;<br /> Transform<span style="color: #000000;">(</span> i, cFormat <span style="color: #000000;">)</span>, .t. <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">endif</span><br /> </div>[/code:vrabl2kp] |
tArrayData | Mr Rao muchas gracias por tomarse el tiempo de solucionarlo.
Mi version de FWH es la July 2020
Saludos
Marcelo |
tArrayData | Is it working for you now with this fix? |
tArrayData | [quote="nageswaragunupudi":vh0cmdai]Is it working for you now with this fix?[/quote:vh0cmdai]
Si Mr. Rao funciona a la perfección ahora
Saludos desde Argentina
Marcelo |
tAutoGet de Maurilio Viana | A través del blog de un fivewiner, llegué a esta clase magnífica, la cual [u:29t2q4v3][b:29t2q4v3]está en este foro [/b:29t2q4v3][/u:29t2q4v3]como un aporte de [b:29t2q4v3]Maurilio Viana[/b:29t2q4v3], pero [u:29t2q4v3][b:29t2q4v3]no la había visto[/b:29t2q4v3][/u:29t2q4v3].
[u:29t2q4v3]Se trata de una clase que autocompleta a partir de un array lo que se escribe en un get.. permitiendo eliminar unos cuantos comboboxes.[/u:29t2q4v3]
Me atrevo, por valorarla mucho, a hacer un "copy, paste" y ponerla en el foro de utilidades para que esté más accesible a todos nosotros.
Muchas Gracias Maurilio por tan buen aporte, sea este post una muestra de gratitud por tu trabajo.
[quote:29t2q4v3]
I use this class I created: TAutoGet
New features, bug fixes and enhancements are welcome
Código:
// TAutoGet.prg
// Auto complete text in get features
// By: Maurilio Viana <!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->
//
// New features, bug fixes and enhancements are welcome <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
// Please, let me now when you include new features, bug fixes etc in this class
//
// ToDo: Show drop down window with possible options when typing
//
#include "fivewin.ch"
CLASS TAutoGet FROM TGet
DATA aItems AS ARRAY
METHOD New( nRow , nCol , bSetGet , oWnd , nWidth , nHeight,;
cPict , bValid , nClrFore , nClrBack , oFont , lDesign,;
oCursor , lPixel , cMsg , lUpdate , bWhen , lCenter,;
lRight , bChanged, lReadOnly, lPassword, lNoBorder, nHelpID,;
lSpinner, bUp , bDown , bMin , bMax , aItems ) CONSTRUCTOR
METHOD ReDefine( nID , bSetGet , oWnd , nHelpId , cPict, bValid ,;
nClrFore, nClrBack, oFont , oCursor , cMsg , lUpdate,;
bWhen , bChanged, lReadOnly, lSpinner, bUp , bDown ,;
bMin , bMax, aItems ) CONSTRUCTOR
METHOD SetItems( aItems )
METHOD AutoFill()
END CLASS
//-----------------------------------------------------------------------------------------
METHOD New(nRow , nCol , bSetGet , oWnd , nWidth , nHeight , cPict ,;
bValid , nClrFore , nClrBack, oFont , lDesign, oCursor , lPixel ,;
cMsg , lUpdate , bWhen , lCenter , lRight , bChanged, lReadOnly,;
lPassword, lNoBorder, nHelpId , lSpinner, bUp , bDown , bMin ,;
bMax , aItems) CLASS TAutoGet
local nLen, i
Super:New(nRow , nCol , bSetGet , oWnd , nWidth , nHeight,;
cPict , bValid , nClrFore , nClrBack , oFont , lDesign,;
oCursor, lPixel , cMsg , lUpdate , bWhen , lCenter,;
lRight , ::bChange, lReadOnly, lPassword, lNoBorder, nHelpId,;
lSpinner, bUp , bDown , bMin , bMax )
if(aItems == Nil, aItems := {}, )
::aItems := aItems
::bPostKey := {|oGet, cBuffer| ::AutoFill() }
return( Self )
//-----------------------------------------------------------------------------------------
METHOD ReDefine(nID , bSetGet , oWnd , nHelpId, cPict , bValid, nClrFore,;
nClrBack , oFont , oCursor, cMsg , lUpdate, bWhen , bChanged,;
lReadOnly, lSpinner, bUp , bDown , bMin , bMax , aItems ) CLASS TAutoGet
Super:ReDefine(nID , bSetGet , oWnd , nHelpId, cPict , bValid, nClrFore ,;
nClrBack , oFont , oCursor, cMsg , lUpdate, bWhen , ::bChange,;
lReadOnly, lSpinner, bUp , bDown , bMin , bMax , aItems )
if(aItems == Nil, aItems := {}, )
::aItems := aItems
::bPostKey := {|oGet, cBuffer| ::AutoFill() }
return( Self )
//---------------------------------------------------------------------------------------
// Set items of AutoGet
//---------------------------------------------------------------------------------------
METHOD SetItems( aItems ) CLASS TAutoGet
if(aItems == Nil, aItems := {}, )
::aItems := aItems
return( Nil )
//---------------------------------------------------------------------------------------
// Auto fill text when type based on aItems options
// Return: Ever return .T.
//---------------------------------------------------------------------------------------
METHOD AutoFill() CLASS TAutoGet
local nPosItem := 0 // Text position into ::aItems
local nPosCursor := ::nPos // Current cursor position
local nLenght := len(::cText) // Text lenght
local cStartTxt := left(::cText, nPosCursor-1) // Start text (position 1 to cursor position -1)
local cItem
if len(::aItems) = 0 // We have no items to search in this GET
return(.T.)
endif
//-------------------------------------------------------------------------
// We use ::cargo to control when we must search in ::aItems for typed text
// We must seek in ::aItems when GET is blank or when user clear it
//-------------------------------------------------------------------------
if valtype(::Cargo) != "L" // Cargo isn't logical yet -> GET received focus now
if ! empty(::Value) // GET isn't empty
::Cargo := .F. // We don't use autofill
else // GET is empty
::Cargo := .T. // Use autofill
endif
else // We are controlling if use or no autofill
if empty(::Value) // User could cleaned the GET text
::Cargo := .T. // Use autofill
endif
endif
//-------------------------------------------------------------------------
// When lost focus we clean ::Cargo and set GET cursor position to 1st pos
//-------------------------------------------------------------------------
::bLostFocus := {|| ::SetPos(1), ::Cargo := Nil }
if ! ::Cargo // If don't control autofill
return(.t.)
endif
nKey := ::nLastKey
do case
case nKey == 9 .or. ; // Tab key
nKey == 13 .or. ; // Enter key
nKey == 46 // Del key
::Assign() // Assign typed text
case nKey > 31
FOR EACH cItem IN ::aItems
nPosItem += 1
if ToUpper( cItem ) = ToUpper(cStartTxt)
nLenght := len( rtrim( cItem ) )
cItem += space( nLenght - len(cItem) )
::SetText( cItem )
::SetSel( nPosCursor -1, nLenght) // Select found text
return(.t.)
endif
NEXT
::HideSel() // Text not found -> Undo selected text
endcase
return( .T. )
// Convert latin characters to ANSI upper case
// (for any reason AnsiUpper cause a GPF with Comercial xHB)
STATIC function ToUpper( cString )
cString := upper( cString )
cString := strtran(strtran(strtran(strtran(cString,"á","Á"),"à","À"),"ã","Ã"),"â","Â")
cString := strtran(strtran(cString,"é","É"),"ê","Ê")
cString := strtran(cString,"í","Í")
cString := strtran(strtran(strtran(cString,"ó","Ó"),"õ","Õ"),"ô","Ô")
cString := strtran(strtran(strtran(cString,"ú","Ú"),"ñ","Ñ"),"ç","Ç")
return( cString )
// --- EoF ---
xBase definition (AutoGet.ch):
Código:
/*----------------------------------------------------------------------------//
!short: AUTOGET */
#xcommand REDEFINE AUTOGET [ <oGet> VAR ] <uVar> ;
[ ID <nId> ] ;
[ <dlg: OF, WINDOW, DIALOG> <oDlg> ] ;
[ <help:HELPID, HELP ID> <nHelpId> ] ;
[ VALID <ValidFunc> ] ;
[ <pict: PICTURE, PICT> <cPict> ] ;
[ <color:COLOR,COLORS> <nClrFore> [,<nClrBack>] ] ;
[ FONT <oFont> ] ;
[ CURSOR <oCursor> ] ;
[ MESSAGE <cMsg> ] ;
[ <update: UPDATE> ] ;
[ WHEN <uWhen> ] ;
[ ON CHANGE <uChange> ] ;
[ <readonly: READONLY, NO MODIFY> ] ;
[ <spin: SPINNER> [ON UP <SpnUp>] [ON DOWN <SpnDn>] [MIN <Min>] [MAX <Max>] ] ;
[ ITEMS <aItems>] ;
=> ;
[ <oGet> := ] TAutoGet():ReDefine( <nId>, bSETGET(<uVar>), <oDlg>,;
<nHelpId>, <cPict>, <{ValidFunc}>, <nClrFore>, <nClrBack>,;
<oFont>, <oCursor>, <cMsg>, .T., <{uWhen}>,;
[ \{|nKey,nFlags,Self| <uChange> \}], <.readonly.>,;
<.spin.>, <{SpnUp}>, <{SpnDn}>, <{Min}>, <{Max}>, <aItems>)
#command @ <nRow>, <nCol> AUTOGET [ <oGet> VAR ] <uVar> ;
[ <dlg: OF, WINDOW, DIALOG> <oWnd> ] ;
[ <pict: PICTURE, PICT> <cPict> ] ;
[ VALID <ValidFunc> ] ;
[ <color:COLOR,COLORS> <nClrFore> [,<nClrBack>] ] ;
[ SIZE <nWidth>, <nHeight> ] ;
[ FONT <oFont> ] ;
[ <design: DESIGN> ] ;
[ CURSOR <oCursor> ] ;
[ <pixel: PIXEL> ] ;
[ MESSAGE <cMsg> ] ;
[ <update: UPDATE> ] ;
[ WHEN <uWhen> ] ;
[ <lCenter: CENTER, CENTERED> ] ;
[ <lRight: RIGHT> ] ;
[ ON CHANGE <uChange> ] ;
[ <readonly: READONLY, NO MODIFY> ] ;
[ <pass: PASSWORD> ] ;
[ <lNoBorder: NO BORDER, NOBORDER> ] ;
[ <help:HELPID, HELP ID> <nHelpId> ] ;
[ ITEMS <aItems>] ;
=> ;
[ <oGet> := ] TAutoGet():New( <nRow>, <nCol>, bSETGET(<uVar>),;
[<oWnd>], <nWidth>, <nHeight>, <cPict>, <{ValidFunc}>,;
<nClrFore>, <nClrBack>, <oFont>, <.design.>,;
<oCursor>, <.pixel.>, <cMsg>, .T., <{uWhen}>,;
<.lCenter.>, <.lRight.>,;
[\{|nKey, nFlags, Self| <uChange>\}], <.readonly.>,;
<.pass.>, [<.lNoBorder.>], <nHelpId>,,,,,,<aItems> )
#command @ <nRow>, <nCol> AUTOGET [ <oGet> VAR ] <uVar> ;
[ <dlg: OF, WINDOW, DIALOG> <oWnd> ] ;
[ <pict: PICTURE, PICT> <cPict> ] ;
[ VALID <ValidFunc> ] ;
[ <color:COLOR,COLORS> <nClrFore> [,<nClrBack>] ] ;
[ SIZE <nWidth>, <nHeight> ] ;
[ FONT <oFont> ] ;
[ <design: DESIGN> ] ;
[ CURSOR <oCursor> ] ;
[ <pixel: PIXEL> ] ;
[ MESSAGE <cMsg> ] ;
[ <update: UPDATE> ] ;
[ WHEN <uWhen> ] ;
[ <lCenter: CENTER, CENTERED> ] ;
[ <lRight: RIGHT> ] ;
[ ON CHANGE <uChange> ] ;
[ <readonly: READONLY, NO MODIFY> ] ;
[ <help:HELPID, HELP ID> <nHelpId> ] ;
[ <spin: SPINNER> [ON UP <SpnUp>] [ON DOWN <SpnDn>] [MIN <Min>] [MAX <Max>] ] ;
[ ITEMS <aItems>] ;
=> ;
[ <oGet> := ] TAutoGet():New( <nRow>, <nCol>, bSETGET(<uVar>),;
[<oWnd>], <nWidth>, <nHeight>, <cPict>, <{ValidFunc}>,;
<nClrFore>, <nClrBack>, <oFont>, <.design.>,;
<oCursor>, <.pixel.>, <cMsg>, .T., <{uWhen}>,;
<.lCenter.>, <.lRight.>,;
[\{|nKey, nFlags, Self| <uChange>\}], <.readonly.>,;
.f., .f., <nHelpId>,;
<.spin.>, <{SpnUp}>, <{SpnDn}>, <{Min}>, <{Max}>, <aItems> )
A fragment of code:
#include "autoget.ch"
(...)
cName := space(20)
aNames := {"Mauro", "Mauricio", "Maurilio", "Maurizio"}
redefine autoget oGet var cName id 101 of oDlg items aNames
(...)
You can update items from available text to autocomplete using:
aNames := {"Angelo", "Antonio", "Afonso"}
oGet:SetItems( aNames )
Best regards!
Maurilio[/quote:29t2q4v3] |
tBTNBMP y popup | Como puedo hacer un popup en un botón? En los data de la misma esta declarado pero no sé como utilizarlo.Es posible con fwh 2.6 y de serlo un pequeño ejemplo. GraciasLuis |
tBTNBMP y popup | Bueno yo lo había hecho asíREDEFINE BTNBMP Nbut[9] id 116 of oDlg resource "BTNSINFAC","BTNSINFAC1" ACTION SHOWPOPUP(nbut[9],olbx) NOBORDER//////static function ShowPopup(odlg,olbx )local oPopupMENU oPopup POPUP MENUITEM "Clientes" ACTION sinfac(olbx,.f.) MENUITEM "Proveedores" ACTION sinfac(olbx,.t.)ENDMENUACTIVATE MENU oPopup OF oDlgreturn nilFunciona bien saliendo el popup sobre el botón, pero he visto que sobre el botón a un costado (cuando necesito un menu en él) aparece una flechita indicando el mismo. Lo ví en harbourminigui. Pensaba que se podía hacer en fivewin.Gracias Luis |
tBTNBMP y popup | Luis:Prueba declarandolo asiREDEFINE BTNBMP Nbut[9] id 116 of oDlg resource "BTNSINFAC","BTNSINFAC1" ACTION SHOWPOPUP(nbut[9],olbx) ;MENU SHOWPOPUP(nbut[9],olbx) NOBORDERSaludosRuben Fernandez |
tBTNBMP y popup | Ruben al compilarlo me indica el siguiente error:E:\fivehme\stogen.prg(56) Error E0022 Invalid lvalue: '()'quizás sea la version fwh 2.6 que no soporta esta opción??Me gustaría saber si es esto ó cómo se haceGraciasLuis |
tBTNBMP y popup | Luis:Mirate en FW Samples el ejemplo testbtnmSaludosRuben Fernandez |
tBTNBMP y popup | En la versión que tengo de fw26, no viene el ejemplo, quizás no esté soportado en esta.Muchas gracias RubenLuis |
tBTNBMP y popup | Hoy descubrí que en la resolución 800x 600 con monitor 14" al presionar el botón (ya que el mismo está cerca del borde derecho de la pantalla, por lo tanto el popup se corre a la izquierda), se dibuja con la flechita al costado, y queda marcado así hasta que hago un click en cualquier lugar del diálogo. Antes estaba trabajando con un monitor 17" y en otra resolución. Seguramente se solucionó en versiones posterioresMuchas Gracias Luis |
tBmpGet mouseover problem | I'm using the tBmpGet class that was written back several years ago. It has been very good to display a small calendar bitmap and allow for date lookups.
With the latest release of FWH when someone mouses over the date which is shown in the field, it disappears. ( July release ). I cannot replicate this on my Vista computer, but clients using XP indicate its happening for them.
I can't find a later version of this class. Is anyone using it, and if so, have you seen this behavior ?
Suggestions would be appreciated. Thanks. |
tBmpGet mouseover problem | Tim,
Solved. Please place these lines at the bottom of Class TBmpGet Method Default:
[code:1jeabhn4]
METHOD Default() CLASS TBmpGet
...
#include "wcolors.ch"
::SetColor( GetSysColor( COLOR_WINDOWTEXT ), GetSysColor( COLOR_WINDOW ) )
RETURN NIL
[/code:1jeabhn4] |
tCalendar class error | We have discovered the following problem with the tCalendar class.
I am using it within an application. We have the system SET DATE TO AMERICAN which is the format mm/dd/yyyy. You use British dd/mm/yyyy. If we activate the calendar control ( as a resource REDEFINE ) and lookup a date on the loaded calendar, there is no problem. However, if we use the calendar control to reset to the next month, it then sets the system date format to British. Thus, all dates in our program are now displayed as British format.
There are no other functions involved in this process. To test, you could display a date in American format ( mm/dd/yyyy ), then display the calendar, use the control to advance to the next month, exit the calendar, and display the date again. You will see it in British format.
I can fix this within my application by using SET DATE TO AMERICAN after closing the calendar control, but the flaw should be fixed within the class. My fix keeps date displays correct in the program for all other functions and displays. |
tCalendar class error | This never got a response so I brought it back to the top <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Has anyone experienced this or is no one else using the calendar control ? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.