topic
stringlengths
1
63
text
stringlengths
1
577k
database object
Tim, here is a test which shows the wrong behavior. Click on the button without inserting something into the get field and method modified returns true. Best regards, Otto [code=fw:3ii58zb1]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> testTdata<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> oDlg, oGet<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> oKBuch<br /><br />&nbsp; &nbsp;oKBuch := TData<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> , &nbsp;<span style="color: #ff0000;">"clientes"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; oKBuch:<span style="color: #000000;">use</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; oKBuch:<span style="color: #000000;">blank</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"TGet from "</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">10</span>, <span style="color: #000000;">10</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">TO</span> <span style="color: #000000;">500</span>, <span style="color: #000000;">800</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">PIXEL</span><br /><br /><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; @ <span style="color: #000000;">10</span>,<span style="color: #000000;">20</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"Text..:"</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">PIXEL</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">20</span>,<span style="color: #000000;">160</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">GET</span> oGet ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">VAR</span> oKBuch:<span style="color: #000000;">nombre</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">PIXEL</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">160</span>, <span style="color: #000000;">10</span><br /><br />&nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp;@ <span style="color: #000000;">40</span>,<span style="color: #000000;">20</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Modified Yes/no"</span> ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> iif <span style="color: #000000;">&#40;</span> oKBuch:<span style="color: #000000;">Modified</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> = .T., <span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"geändert"</span> <span style="color: #000000;">&#41;</span>, <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"nicht geändert"</span> &nbsp;<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">PIXEL</span><br /><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br />&nbsp; &nbsp;<br />&nbsp; <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------------//</span></div>[/code:3ii58zb1]
database object
Otto, As James explained it to me, blank simply empties the buffers. You didn't add a record ( obj:append( ) ) so you wouldn't have a record number. tRecord may resolve your problems because it will track a record number and always make sure you write to it. Tim
database object
:append() Hello Tim, thank you for your explanation. As in the moment of opening a dialog to insert a new record you never know if a user finishes entering you can’t append a record. If he breaks off you have to delete the record in the database. To delete records in a database concerning data which is responsible for calculating taxes is prohibited from law here. Therefore you only :append a record if you really want to. There should be a DATA inside Tdatabase.prg showing that you enter data in a blank record. Best regards, Otto
database object
tRecord will do that for you. Create a new tRecord object, and issue blank( ). That gives you clear data. Because there is no record number, when you go to save it, it will do the append( ) at that time. Tim
database object
Hello Tim, thank you. I will look into the TRecord object. Best regards, Otto
database y browse
Hola estoy intrigado con el uso de la clase. Les explico, utilizó mucho esta clase y ningún problema. Uno de los usos que le doy es el de cargar los browses con esta. Bueno hasta aquí no hay problema. Pero hoy quise hacer lo mismo pero con la diferencia que la clase la database la hago en una función principal y el browse lo llamo en otra función en el mismo prg. El problema es que no me muestra nada en el browse. Ahora si abro la base de datos en la función secundaria(en este caso function provee(olbx,lnuevo,oMae)) funciona perfectamente. Alguien sabe el porque de este comportamiento?? Uso fwh 2.6 xharbour 99.61 y borland Luis Ejemplo ( no funciona ) FUNCTION Brwprove //principal del programa LOCAL oLbx LOCAL oDlg, oSplit := array(2) LOCAL oRadioButton LOCAL nOrden:=1 LOCAL onbut := array(6) LOCAL surge LOCAL oMae Local cTitulo := "Listado de proveedores locales" LOCAL aObj := array(0) LOCAL oBanpro if !pasaje("banprove");eturn nil;endif DATABASE oBanpro oBanpro:setorder(1) oBanpro:beof:={||nil} ETC ETC ETC REDEFINE BTNBMP oNbut[1] id 102 of oDlg resource "btnagregar","btnagrega1" ACTION provee( oLbx, .T.,oMae,oBanpro ) NOBORDER *//////////////////////////////////////////////////////////////////* function provee(olbx,lnuevo,oMae,obanpro) bla bla bla REDEFINE LISTBOX oBrw ; FIELDS (obanpro:calias)->banco, (obanpro:calias)->cbu FIELDSIZES 190,120; HEADERS "BANCO", "CBU" ID 102 of oFold:adialogs[3] UPDATE oBrw:bSkip = { | nRecs | obanpro:Skipper( nRecs ) } oBrw:nLineStyle := 3 oBrw:nClrBackFocus := CLR_CYAN oBrw:nClrForeFocus := CLR_WHITE //////////////////////////////////////////////////////////////////// En cambio así sí funciona FUNCTION Brwprove //principal del programa LOCAL oLbx LOCAL oDlg, oSplit := array(2) LOCAL oRadioButton LOCAL nOrden:=1 LOCAL onbut := array(6) LOCAL surge LOCAL oMae Local cTitulo := "Listado de proveedores locales" LOCAL aObj := array(0) LOCAL oBanpro ETC ETC ETC REDEFINE BTNBMP oNbut[1] id 102 of oDlg resource "btnagregar","btnagrega1" ACTION provee( oLbx, .T.,oMae) NOBORDER ETC ETC ETC *//////////////////////////////////////////////////////////////////* function provee(olbx,lnuevo,oMae) if !pasaje("banprove");eturn nil;endif DATABASE oBanpro oBanpro:setorder(1) oBanpro:beof:={||nil} bla bla bla REDEFINE LISTBOX oBrw ; FIELDS (obanpro:calias)->banco, (obanpro:calias)->cbu FIELDSIZES 190,120; HEADERS "BANCO", "CBU" ID 102 of oFold:adialogs[3] UPDATE oBrw:bSkip = { | nRecs | obanpro:Skipper( nRecs ) } oBrw:nLineStyle := 3 oBrw:nClrBackFocus := CLR_CYAN oBrw:nClrForeFocus := CLR_WHITE
database y browse
Hola amigo... Prueba poner un GoTop en la apertura de la DBF [code=fw:7xvmvbdb]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">if</span> !pasaje<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"banprove"</span><span style="color: #000000;">&#41;</span>;eturn <span style="color: #00C800;">nil</span>;endif<br />DATABASE oBanpro<br />oBanpro:<span style="color: #000000;">setorder</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><br />oBanpro:<span style="color: #000000;">beof</span>:=<span style="color: #000000;">&#123;</span>||nil<span style="color: #000000;">&#125;</span> <br />oBanpro:<span style="color: #000000;">GoTop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /> </div>[/code:7xvmvbdb] Y el LISTBOX sin el Alias. [code=fw:7xvmvbdb]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">LISTBOX</span> oBrw ; <br />         FIELDS oBanpro:<span style="color: #000000;">banco</span>, oBanpro:<span style="color: #000000;">cbu</span>;<br />         FIELDSIZES <span style="color: #000000;">190</span>,<span style="color: #000000;">120</span>;<br />         HEADERS <span style="color: #ff0000;">"BANCO"</span>, <span style="color: #ff0000;">"CBU"</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">102</span> <span style="color: #0000ff;">of</span> oFold:<span style="color: #000000;">adialogs</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">UPDATE</span><br /> </div>[/code:7xvmvbdb] Espero te sirva. Saludos,
database y browse
Sí así lo hago en otra parte ya que hago un filtro de la base para que me muestre sólo los registros del proveedor consultado. Me parece que el problema está en declarar al browse como local, voy a probar en declararlo como estático Luis
database y browse
Bueno acabo de probar y tampoco me funciona... Lo voy a dejar así como está es decir abrir cada vez que consulto un proveedor abriendo la base de datos y cerrandola cuando salgo de la rutina. No es lo correcto pero funciona. Cuando empezé a programar alguien dijo [b:1is466in]si funciona no lo toques[/b:1is466in]. No es mi gusto pero estuvedos horas con esto y no hubo caso
database y browse
he tenido ese problema antes y lo resolvi pasando el objeto database al programa que hace el browse
database y browse
Sí así lo hice yo también, lo que buscaba era saber si alguien tenía una explicación para esto Un abrazo Luis
database y browse
Una pregunta... Estas seguro que cuando declaras DATABASE oBanPro está seleccionada la dbf que quieres? Que pasa si ponemos un ? Alias() justo antes del DATABASE oBanPro? Un saludo
database y browse
Carlos así la declaro if !pasaje("banprove");return nil;endif DATABASE oBanpro oBanpro:setorder(1) oBanpro:beof:={||nil} Lo extraño que si lo declaro en el primer prg y luego lo paso como variable de la segunda función, no muestra nadaen el browse, (probé llamando un msg y sí me muestra un registro en la segunda función). Si tal cual está arriba lo declaro en la segunda función no hay problemas Luis
database y browse
Prueba con : REDEFINE BTNBMP oNbut[1] id 102 of oDlg resource "btnagregar","btnagrega1" ACTION eval({|| provee( oLbx, .T.,oMae,oBanpro )}) NOBORDER
database y browse
Angel tampoco funciona. Hice un montón de pruebas y no sigue sin funcionar pasando como variable la base. Si la base la abro en el misma función que declaro el browse funciona. Gracias Luis
database y ordscope
Como se utiliza este método que está tambien en la clase database METHOD ordScope( nScopeType, uValue ) Luis
database y ordscope
[code=fw:1a67mpih]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">/*constantes para scope en tablas*/</span><br /><span style="color: #B900B9;">//#define TOPSCOPE &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1</span><br /><span style="color: #B900B9;">//#define BOTTOMSCOPE &nbsp; &nbsp; &nbsp; &nbsp;2</span><br /><br /><span style="color: #B900B9;">/*-------------------------------------------------------------------------------------------------*/</span><br /><br />PROCEDURE SetScope<span style="color: #000000;">&#40;</span> xValorIni, xValorFin <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> xValorFin := xValorIni<br /><br />&nbsp; &nbsp;OrdScope<span style="color: #000000;">&#40;</span> TOPSCOPE, &nbsp; &nbsp;xValorIni <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;OrdScope<span style="color: #000000;">&#40;</span> BOTTOMSCOPE, xValorFin <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;DBGoTop<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span><br /><br /><span style="color: #B900B9;">/*-------------------------------------------------------------------------------------------------*/</span><br /><br />PROCEDURE ClearScope<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;OrdScope<span style="color: #000000;">&#40;</span> TOPSCOPE &nbsp; &nbsp;, <span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;OrdScope<span style="color: #000000;">&#40;</span> BOTTOMSCOPE , <span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;DBGoTop<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span><br />&nbsp;</div>[/code:1a67mpih] 
database y ordscope
Gracias Kharina pero de hecho los utilizó pero mi consulta es como hacerlo con la clase database Luis
database y ordscope
Olá, com database se usa desta maneira. <oObjetoDatabase>:OrdScope( 0, <seu_escopo_inicial> ) <oObjetoDatabase>:OrdScope( 1, <seu_escopo_final> ) por exemplo. use cliente new database oCli oCli:ordScope( 0, cCodCli ) oCli:ordScope( 1, cCodCli ) oCli:Gotop() BROWSE()
database y ordscope
Ó [code=fw:1tzp9fdp]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> NetUse<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"COTACAO"</span>, .T. <span style="color: #000000;">&#41;</span> &nbsp; <span style="color: #B900B9;">// Exclusive ‚ .F. &nbsp;Shared ‚ .T.</span><br />&nbsp; &nbsp; &nbsp; OrdListAdd<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"COTACAO"</span>, <span style="color: #ff0000;">"COTACAO"</span>, <span style="color: #ff0000;">"TIPOCLI"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; OrdDescend<span style="color: #000000;">&#40;</span> ,,.T. <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// - Decrescente</span><br />&nbsp; &nbsp; &nbsp; DATABASE DbCotacao<br />&nbsp; &nbsp; &nbsp; DbCotacao:<span style="color: #000000;">Load</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; DbCotacao:<span style="color: #000000;">SetBuffer</span><span style="color: #000000;">&#40;</span> .T. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; DbCotacao:<span style="color: #000000;">GoTop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp; &nbsp; MsgStop<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Banco de Dados das COTACOES Bloqueado"</span>, <span style="color: #ff0000;">"Cuidado!"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">SELECT</span> <span style="color: #000000;">&#40;</span> DbCotacao:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;SET ORDER <span style="color: #0000ff;">TO</span> <span style="color: #000000;">1</span><br />&nbsp; &nbsp;GO TOP<br /><br />&nbsp; &nbsp;XNUMERCOTA := <span style="color: #000000;">&#40;</span> DbCotacao:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>->COTACAO<br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// Filtro Para Um Pedido Novo</span><br />&nbsp; &nbsp;<span style="color: #000000;">&#40;</span> DbCotacao:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> OrdScope<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, XNUMERCOTA <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// Inicio</span><br />&nbsp; &nbsp;<span style="color: #000000;">&#40;</span> DbCotacao:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> OrdScope<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, XNUMERCOTA <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// Fim</span><br />&nbsp; &nbsp;GO TOP<br />&nbsp;</div>[/code:1tzp9fdp] 
database y ordscope
Gracias Kharina, muy clara la explicación. Voy a implementarlo. Ya que muchas veces lo que hacía era abrir la base de datos hacer los ordescope y luego usar la clase database [code=fw:15kijr26]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">if</span> !pasaje<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Lote"</span><span style="color: #000000;">&#41;</span>;return <span style="color: #00C800;">nil</span>;endif<br />set order <span style="color: #0000ff;">to</span> tag producto<br /><span style="color: #00C800;">if</span> !dbseek<span style="color: #000000;">&#40;</span>ncod<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;msgstop<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"No hay lotes cargados para este producto"</span>,<span style="color: #ff0000;">"Aviso del sistema"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;cierroalias<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">alias</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><span style="color: #00C800;">endif</span><br />ORDSCOPE<span style="color: #000000;">&#40;</span>TOPSCOPE, &nbsp;nCod <span style="color: #000000;">&#41;</span><br />ORDSCOPE<span style="color: #000000;">&#40;</span>BOTTOMSCOPE, nCod <span style="color: #000000;">&#41;</span><br /><br />database oLote<br />oLote:<span style="color: #000000;">beof</span> := <span style="color: #000000;">&#123;</span>|| <span style="color: #00C800;">nil</span><span style="color: #000000;">&#125;</span><br />oLote:<span style="color: #000000;">setorder</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#41;</span></div>[/code:15kijr26] Luis
database y setfilter
Utilizando el código de database original para el caso de setfilter: [code=fw:17iy11k0]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">METHOD</span> SetFilter<span style="color: #000000;">&#40;</span> cFilter <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TDataBase<br />&nbsp; <br />&nbsp; <span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span> &nbsp;? cFilter &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">//agregado para ver que envía </span><br />&nbsp; <br />&nbsp; &nbsp;<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbSetFilter<span style="color: #000000;">&#40;</span> Compile<span style="color: #000000;">&#40;</span> cFilter <span style="color: #000000;">&#41;</span>, cFilter <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//---------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> Compile<span style="color: #000000;">&#40;</span> cExp <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> &<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"{||"</span> + cExp + <span style="color: #ff0000;">"}"</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><br />&nbsp;</div>[/code:17iy11k0]
database y setfilter
Perdón quise hacer un preview... siguiendo... Cuando envío el filtro por ejemplo (oCtae:calias)->npro = 0 el mensaje que me envía es .f. ... ¿a que se debe? y da este error [code=fw:3dwvr1hb]<div class="fw" id="{CB}" style="font-family: monospace;">Application<br />===========<br />   Path and <span style="color: #0000ff;">name</span>: <span style="color: #000000;">k</span>:\fivehme\Source\fivehme.exe <span style="color: #000000;">&#40;</span><span style="color: #000000;">32</span> bits<span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">Size</span>: <span style="color: #000000;">4</span>,<span style="color: #000000;">324</span>,<span style="color: #000000;">352</span> bytes<br />   Compiler version: <span style="color: #000000;">xHarbour</span> build <span style="color: #000000;">1.2</span><span style="color: #000000;">.1</span> Intl. <span style="color: #000000;">&#40;</span>SimpLex<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#40;</span>Rev. <span style="color: #000000;">9656</span><span style="color: #000000;">&#41;</span><br />   FiveWin  Version: <span style="color: #000000;">FWHX</span> <span style="color: #000000;">12.02</span><br />   Windows version: <span style="color: #000000;">6.1</span>, Build <span style="color: #000000;">7601</span> Service Pack <span style="color: #000000;">1</span><br /><br />   Time <span style="color: #0000ff;">from</span> start: <span style="color: #000000;">0</span> hours <span style="color: #000000;">0</span> mins <span style="color: #000000;">15</span> secs <br />   Error occurred <span style="color: #00C800;">at</span>: <span style="color: #000000;">11</span>/<span style="color: #000000;">02</span>/<span style="color: #000000;">2013</span>, <span style="color: #000000;">22</span>:<span style="color: #000000;">31</span>:<span style="color: #000000;">50</span><br />   Error description: <span style="color: #000000;">Error</span> BASE/<span style="color: #000000;">1081</span>  Argument error: +<br />   Args:<br />     <span style="color: #000000;">&#91;</span>   <span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> = C   <span style="color: #000000;">&#123;</span>||<br />     <span style="color: #000000;">&#91;</span>   <span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> = U   <br /><br />Stack Calls<br />===========<br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">database</span>.prg => COMPILE<span style="color: #000000;">&#40;</span> <span style="color: #000000;">676</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">database</span>.prg => TDATABASE:<span style="color: #000000;">SETFILTER</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">804</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">funcion</span>.prg => BUSPRO<span style="color: #000000;">&#40;</span> <span style="color: #000000;">494</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">xbrwgen</span>.prg => <span style="color: #000000;">&#40;</span>b<span style="color: #000000;">&#41;</span>XBRWGEN<span style="color: #000000;">&#40;</span> <span style="color: #000000;">22</span> <span style="color: #000000;">&#41;</span></div>[/code:3dwvr1hb] si en cambio el set filter lo reescribo [code=fw:3dwvr1hb]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">METHOD</span> SetFilter<span style="color: #000000;">&#40;</span>cFilter <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TDataBase<br /><span style="color: #00C800;">local</span> cType<br />    ctype := valtype<span style="color: #000000;">&#40;</span>cFilter<span style="color: #000000;">&#41;</span><br />      ? cFilter<br />    <span style="color: #00C800;">if</span> cType == <span style="color: #ff0000;">"B"</span><br />        <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbSetFilter<span style="color: #000000;">&#40;</span>cFilter <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />    elseif cType == <span style="color: #ff0000;">"C"</span><br />        <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbSetFilter<span style="color: #000000;">&#40;</span> Compile<span style="color: #000000;">&#40;</span> cFilter <span style="color: #000000;">&#41;</span>, cFilter <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />    <span style="color: #00C800;">else</span><br />        <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbClearFilter<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />    <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:3dwvr1hb] ante la orden oCtae:setfilter({|| (oCtae:cAlias)->npro = nproa } ) funciona perfectamente.... Me podrían indicar la forma de usarlo con la database original Luis
database y setfilter
[code=fw:3grhtaav]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp;<span style="color: #000000;">&#40;</span>oCtae:<span style="color: #000000;">calias</span><span style="color: #000000;">&#41;</span>->npro = <span style="color: #000000;">0</span><br />&nbsp; ...<br />&nbsp; oCtae:<span style="color: #000000;">SetFilter</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"NPRO=0"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; ...<br />&nbsp;</div>[/code:3grhtaav]
database y setfilter
Gracias Carlos lo voy a probar y te comento
database y setfilter
Carlos si envías los datos de esta forma oPinterno:setfilter("vendedor = oApp:nlogin") no funciona de esta forma tampoco oPinterno:setfilter("vendedor = " + oApp:nlogin ) Lo voy a dejar con la modificación que hice que de todas forma no modifica el comportamiento de la clase para otras bases de datos Luis
database y setfilter
Hola vuelvo con esto ya que no le encontré la solución salvo con al modificación antes comentada. Alguien por casualidad usa el set filter en la clase database y si la usa me podría indicar como la utiliza, ya que ahora estoy tratando de resolverla sin usar la modificación que comente pero sigo tropezando con la misma piedra. Gracias
database y setfilter
En la clase database original es [code=fw:36ziwzu1]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">METHOD</span> SetFilter<span style="color: #000000;">&#40;</span> cFilter <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TDataBase<br /><br />   <span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nArea</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbSetFilter<span style="color: #000000;">&#40;</span> Compile<span style="color: #000000;">&#40;</span> cFilter <span style="color: #000000;">&#41;</span>, cFilter <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:36ziwzu1] [code=fw:36ziwzu1]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> Compile<span style="color: #000000;">&#40;</span> cExp <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> &<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"{||"</span> + cExp + <span style="color: #ff0000;">"}"</span> <span style="color: #000000;">&#41;</span>            <span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><br /> </div>[/code:36ziwzu1] llamando oCtae:SetFilter( "NPRO=0" ) El error lo da en (1) Gracias
database y setfilter
Como te dice Carlos le tienes que mandar una cadena... por lo que esto: oPinterno:setfilter("vendedor = " + oApp:nlogin ) deberías a cambiarlo a: oPinterno:setfilter("vendedor = " + str( oApp:nlogin ) ) Entiendo que usas la notación húngara correctamente y por tanto oApp:nlogin es de tipo numérico... Por otro lado esto (oCtae:calias)->npro = 0 lo que hace es comparar (oCtae:calias)->npro con 0 por lo que si (oCtae:calias)->npro es diferente de 0 dará .f. si lo que quieres es asignar un valor a una variable debería usar: (oCtae:calias)->npro := 0 // fijate que se usa := en vez de = pero si lo que quieres es comaparar deberías usar: oCtae:setfilter("npro ==" +str( nproa ) ) También decirte que esto: oCtae:setfilter({|| (oCtae:cAlias)->npro = nproa } ) funciona porque directamente le pasas un codeblock que es lo que la función dbFilter de harbour requiere. Espero haber aclarado un poco tus dudas <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
database y setfilter
Manuel seguí probando y encontré el problema parcialmente, ya que en algunos casos funcionaba y en otros no, por eso contesté que no había visto bien las soluciones que me había recomendado en su momento Carlos Vargas, que pasó? Que empezé probando con esta parte del programa que filtro por vendedores ( y parece que cuando consulte anteriormente(año 2013) hice lo mismo y ante la disparidad de resultados usaba la clase database modificada, pero en estos momento estoy tratando de usar la clase original de fivewin. IF oApp:nloguin # 10 oPinterno:setfilter( "vendedor == oApp:nloguin" ) ENDIF y oNsto:setfilter( "peligro = 'S'" ) ó Aquí, en estos dos casos, funciona muy bien y no me percaté que oApp es una variable publica desde el comienzo del sistema y en el segundo que enviaba un parámetro fijo. Ahora veamos este ejemplo con variable [color=#0000FF:1jemplde]caso 1[/color:1jemplde] Local nValor nValor := aMae[2] //Nro de proveedor oCom:setfilter( "npro = nvalor" ) [color=#FF0040:1jemplde]No funciona y da el error que envié anteriormente[/color:1jemplde] [color=#0000FF:1jemplde]caso 2[/color:1jemplde] Local nValor nValor := aMae[2] oCom:setfilter( "npro = 'nvalor'" ) Error description: Error BASE/1071 Error de argumento: = Args: [ 1] = N 809 [ 2] = C nvalor [color=#0000FF:1jemplde]caso 3[/color:1jemplde] Public nValor nValor := aMae[2] oCom:setfilter( "npro = nvalor" ) [color=#FF0040:1jemplde]Funciona como debe[/color:1jemplde] No sé como hacer para no tener que pasar la variable como referencia, hice varias pruebas pero da error de argumento Lo que no aclaré es que uso xHarbour y bcc582 Es posible evitar nombrar la variable como pública? Luis
database y setfilter
A ver Luis, el problema no es que sea o no publica o privada sino que en el sitio donde se compile esa variable sea o no visible... y es logico que no lo es <!-- s:-( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":-(" title="Sad" /><!-- s:-( --> Para que funcione deberías compilar el valor de la variable local y no el nombre de la misma... Ahora veamos este ejemplo con variable caso 1 [color=#0000FF:3b4imcy8]Le estás pasando la variable local nValor al objeto dataBase y cuando lo compila esa variable no es visible[/color:3b4imcy8] Local nValor nValor := aMae[2] //Nro de proveedor oCom:setfilter( "npro = nvalor" ) [color=#FF0000:3b4imcy8]---> oCom:setfilter( "npro = " + str( nvalor ) )[/color:3b4imcy8] No funciona y da el error que envié anteriormente caso 2 [color=#0000FF:3b4imcy8]Aquí lo empeoras ya que estás pasando la variable como un valor de tipo "C" y espera uno de de tipo "N"[/color:3b4imcy8] Local nValor nValor := aMae[2] oCom:setfilter( "npro = 'nvalor'" ) [color=#FF0000:3b4imcy8]---> oCom:setfilter( "npro = " + str( nvalor ) )[/color:3b4imcy8] Error description: Error BASE/1071 Error de argumento: = Args: [ 1] = N 809 [ 2] = C nvalor caso 3 [color=#0000FF:3b4imcy8]Aquí la variable es visible en todo tu programa por eso no da ningun error[/color:3b4imcy8] Public nValor nValor := aMae[2] oCom:setfilter( "npro = nvalor" ) Funciona como debe
database y setfilter
Luis yo lo cambiaría a: de esto Local nValor nValor := aMae[2] //Nro de proveedor oCom:setfilter( "npro = nvalor" ) a esto oCom:setfilter( "npro == " + str( aMae[2] ) ) // No hace falta usar variables <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
database y setfilter
Gracias Manuel ahora lo entendí y lo apliqué, pude dejar de usar la database modificada. Luis PD: sin comentarios de mi rapidez mental...
database y setfilter
<!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
datas en clases..
Hola foro, Pues tengo una pequeña duda a ver si alguien me puede explicar.. tengo una clase con sus data y sus method. dentro de algunos method las datas no me funcionan sino hasta que les antepongo el self.. asi esta mi ejemplo: [code=fw:bgjlwwjs]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">CLASS</span> MiPrueba<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">DATA</span> aoDatos &nbsp; &nbsp; &nbsp; AS ARRAY &nbsp; <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#123;</span> <span style="color: #00C800;">nil</span>, <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">METHOD</span> Opcion<br />ENDLASS<br /><br /><span style="color: #00C800;">METHOD</span> Opcion <span style="color: #00C800;">CLASS</span> MiPrueba<br /><span style="color: #00C800;">Local</span> oDlg, &nbsp;<span style="color: #000000;">&#91;</span><span style="color: #0000ff;">color</span>=#FF0000<span style="color: #000000;">&#93;</span>oSelf:=<span style="color: #00C800;">SELF</span><span style="color: #000000;">&#91;</span>/<span style="color: #0000ff;">color</span><span style="color: #000000;">&#93;</span><br /><span style="color: #0000ff;">Define</span> <span style="color: #0000ff;">Dialog</span> oDlg<br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> oBtn <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"prueba"</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">101</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span> ::<span style="color: #000000;">aoDatos</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp;---> &nbsp; asi no me funciona<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#91;</span><span style="color: #0000ff;">color</span>=#FF0000<span style="color: #000000;">&#93;</span>oSelf<span style="color: #000000;">&#91;</span>/<span style="color: #0000ff;">color</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">aoDatos</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp; &nbsp; ---> <span style="color: #000000;">&#91;</span><span style="color: #0000ff;">color</span>=#0040FF<span style="color: #000000;">&#93;</span>asi si me funciona<span style="color: #000000;">&#91;</span>/<span style="color: #0000ff;">color</span><span style="color: #000000;">&#93;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> ::<span style="color: #000000;">aoDatos</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> &nbsp;<span style="color: #0000ff;">VAR</span> cDatos<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">102</span> <span style="color: #0000ff;">OF</span> oDlg<br /><br /><span style="color: #0000ff;">Activate</span> <span style="color: #0000ff;">Dialog</span> oDlg<br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">SELF</span> <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:bgjlwwjs] gracias paco
datas en clases..
Hola todo empieza desde el comando xbase REDEFINE BTNBMP... ACTION, que traduce la clausula ACTION a un codeblock que sera evaluado en la clase TBTNBMP, ese codeblock recibe como primer parametro Self, pero no es el Self de tu clase sino del la Clase TBTNBMP usando [b:18ay4xxw]oSelf:=SELF[/b:18ay4xxw] forzamos a usar nuestro objeto y no el de clase TBTNBMP
datas en clases..
Bien al menos hoy aprendi algo nuevo... Gracias Daniel Saludos Paco
datas en clases..
Yo lo uso desde FW + clipper... pero nunca supe el porqué! <!-- s:oops: --><img src="{SMILIES_PATH}/icon_redface.gif" alt=":oops:" title="Embarassed" /><!-- s:oops: --> gracias Daniel!
datatables DBF server-side processing
[url:2dtibru7]https&#58;//mybergland&#46;com/fwforum/datatables&#46;mp4[/url:2dtibru7] Hello, Do any of you work with DBF files and server-side processing? I made some speed tests. In this example, we show Data tables in action. Data tables is connected to a DBF file. We have connected our server to the internet with an upload speed of around only 28 Mbps. There are thirty thousand records in the DBF file. It takes about 5 seconds to fill the grid. So if we have larger files, we need server-side processing. But as soon as the grid is filled all is very speedy. I will start working on a server-side sample. Have some done that? Best regards, Otto
datatype
when I go to create the temporary order in memory (see this topic [url:qn1pplg7]http&#58;//forums&#46;fivetechsupport&#46;com/viewtopic&#46;php?f=3&t=41377&start=0&sid=125ed95a697356ee0ca6845b50441ee5[/url:qn1pplg7]) I load the types of the database columns I am going to save the data type in an array [b:qn1pplg7] aTipos [ n ]:= oGrid:aCols[ n ]:cDataType[/b:qn1pplg7] however, it often happens that a text is displayed in a column but the field in the archive is numeric but xbrowse it returns me the type of the given character but if the field is numeric it gives me an error How can I check if the field in the archive is numeric? When I create the xbrowse I make an array with all fields aCols [code=fw:qn1pplg7]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">local</span> aCols    := <span style="color: #000000;">&#123;</span> ;<br />               <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"CODICE"</span>  ,  <span style="color: #ff0000;">"Codice"</span>             ,,   <span style="color: #000000;">40</span>, <span style="color: #000000;">&#125;</span>,;<br />               <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"DESC"</span>    ,  <span style="color: #ff0000;">"Descrizione"</span>        ,,   <span style="color: #000000;">150</span>, <span style="color: #000000;">&#125;</span>,;<br />               <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"NUM7"</span>    ,  <span style="color: #ff0000;">"Tipo Codice"</span>        ,,   <span style="color: #000000;">80</span>, <span style="color: #000000;">&#125;</span>,;   <span style="color: #B900B9;">//Num7</span><br />               <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"ALFA1"</span>   ,  <span style="color: #ff0000;">"Iva Cee"</span>            ,,   <span style="color: #000000;">80</span>,AL_CENTER <span style="color: #000000;">&#125;</span>,;    <span style="color: #B900B9;">//alfa1</span><br />               <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"ALFA1"</span>   ,  <span style="color: #ff0000;">"Partecipa Platfond"</span> ,,   <span style="color: #000000;">80</span>,AL_CENTER <span style="color: #000000;">&#125;</span>,;  <span style="color: #B900B9;">//alfa1</span><br />               <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"NUM1"</span>    ,  <span style="color: #ff0000;">"% aliquota"</span>         ,<span style="color: #ff0000;">"999.99"</span>,   <span style="color: #000000;">80</span>,AL_RIGHT <span style="color: #000000;">&#125;</span>,;<br />               <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"NUM2"</span>    ,  <span style="color: #ff0000;">"% Ventilazione"</span>     ,<span style="color: #ff0000;">"999.99"</span>,   <span style="color: #000000;">80</span>,AL_RIGHT <span style="color: #000000;">&#125;</span>,;<br />               <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"NUM5"</span>    ,  <span style="color: #ff0000;">"% Indetraibile"</span>     ,<span style="color: #ff0000;">"999.99"</span>,   <span style="color: #000000;">80</span>,AL_RIGHT <span style="color: #000000;">&#125;</span>,;<br />               <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"ALFA1"</span>   ,  <span style="color: #ff0000;">"Iva non esposta"</span>  ,,   <span style="color: #000000;">80</span>,AL_CENTER <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span>  <span style="color: #B900B9;">//alfa1</span><br /> </div>[/code:qn1pplg7] then on Xbrowse I use @ 110,10 XBROWSE oBrw SIZE -2,-10 PIXEL OF oTabDlg ; [b:qn1pplg7]DATASOURCE oDbf COLUMNS aCols[/b:qn1pplg7] ; AUTOSORT ; NOBORDER CELL LINES WITH OBJECT oBrw:aCols[3] :bEditValue :={ || TipoIva(oDbf:NUM7,oDbf) } END when I make the order it not take the type of field on archive but the current rows ( string) but if I made WITH OBJECT oBrw:aCols[3] :bStrData :={ || TipoIva(oDbf:NUM7,oDbf) } END then the order run ok without error because it take the right type of data ( numeric) But Nages sad me not use :bStrData , so how I can resolve ?
datatype
METHOD FieldType( n, c ) INLINE If( c == nil, ::aStruct[ n ][ 2 ], ::aStruct[ n ][ 2 ] := c )
date e ora in rtf
esiste una funzione che mi restituisca l'elenco dei formati della data e della ora tipo come si seleziona in word ?
date e ora in rtf
putroppo non ho trovato su msdn l'lelenco delle funzioni della rich edit ( RTF CONTROL) mi potete aiutare a trovare questo manuale per favore silvio
date e ora in rtf
[quote="Silvio":1r3a0z9h]putroppo non ho trovato su msdn l'lelenco delle funzioni della rich edit ( RTF CONTROL) mi potete aiutare a trovare questo manuale per favore silvio[/quote:1r3a0z9h] [url:1r3a0z9h]http&#58;//msdn&#46;microsoft&#46;com/library/default&#46;asp?url=/library/en-us/shellcc/platform/commctls/editcontrols/editcontrols&#46;asp[/url:1r3a0z9h] EMG
date e ora in rtf
grazie
date e ora in rtf
scusa come ho gia detto a Marco che la funzione dovrebbe se ricordo bene , cioè avere il suffisso RE come REprint ed essere REGetDateTime() o giù di li ma non riesco a trovarla dove puo' essere ...?
date e ora in rtf
No, quella è una funzione che ha scritto Antonio e non la trovi certo documentata sulla MSDN. EMG
date e ora in rtf
ok e dove la trovo ?
date e ora in rtf
Devi chiedere ad Antonio. I sorgenti non ci sono. E non è (ancora) documentata. EMG
date e ora in rtf
Non ci sono i sorgenti ? E' un'immane cavolata ...? .... e se volessi ricompilare le librerie di fw per una nuova versione di xharbour ( pcode cambiato) come farei ? Vedi che cò non è possibile c'è qualcosa ke ci sfugge....
date e ora in rtf
Sono sicuramente sorgenti scritti in C che quindi non necessitano di ricompilazione in quei casi. EMG
date e ora in rtf
ok sorgenti in c sicuramente e quindi non si puo' fare niente per adesso io aveo un ideuzza ma non so dove andare a prendere al cune funzioncine cmq ho visot che antonio piano piano sta rimettendo nella classe rtf alcune di quelle funziocine che sono nell'altra classde quell acreata con ozs tra cui page setup... esiste una dll di windows che mi restituisce i formati delle date e delle ore di windows ?
date e ora in rtf
Non lo so, mi dispiace. EMG
date format
By converting an excel file to a dbase file the date field is switching to the american style (MM/DD/YYYY) How to prevent or rectify this?
date format
How are you converting Excel to dbf? If you read excel data as a date value, you should not have any problem. You may also consider using FWH built-in function FW_ExcelToDBF()
date picker como MSGDATE()
Hola: He visto como funciona el control date picker, que saca un calendario en 32 bits y requiere usar un campo ad hoc. ¿Hay algún arreglo que permita usar dicho calendario como en la función msgdate()?. El ejemplo fwh\samples\msgdate.prg no funciona correctamente cuando se pulsa varias veces el +, se cambia de mes y volvemos a cambiar de año. Gracias y feliz 2006!!!. Salu2
date() format like ""dd/mm/yyyy""? (Solved)
Dear Antonio, James, Uwe and friends. I have a simple doubt about date functions With twice function bellow, I get the date in format "dd/mm/yy" [code:36mgfp52]? fileDate( "C&#58;\apps\myApp&#46;exe" ) ? date()[/code:36mgfp52] and my configurations is here: SET DATE BRITISH SET CENTURY ON SET( _SET_EPOCH, 1950 ) How I can get the date in this format "dd/mm/yyyy"??
date() format like ""dd/mm/yyyy""? (Solved)
Hello JC, Just add the line for the format, You need : SET DATE FORMAT TO "DD/MM/YYYY" ( SET DATE FORMAT TO "DD.MM.YYYY" ) ddate := CTOD( "29/12/2008" ) // Date() Regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
date() format like ""dd/mm/yyyy""? (Solved)
[code:32de5bmt] Set( _SET_DATEFORMAT, "dd/mm/yyyy") [/code:32de5bmt]
date() format like ""dd/mm/yyyy""? (Solved)
Uwe and Biel, Thank you! Worked very well and much more simple!
date() format like ""dd/mm/yyyy""? (Solved)
[quote="JC":e8lh4i9s]Dear Antonio, James, Uwe and friends. I have a simple doubt about date functions With twice function bellow, I get the date in format "dd/mm/yy" [code:e8lh4i9s]? fileDate( "C&#58;\apps\myApp&#46;exe" ) ? date()[/code:e8lh4i9s] and my configurations is here: SET DATE BRITISH SET CENTURY ON SET( _SET_EPOCH, 1950 ) How I can get the date in this format "dd/mm/yyyy"??[/quote:e8lh4i9s] The following sample works perfectly here: [code:e8lh4i9s]#include "Fivewin&#46;ch" FUNCTION MAIN() SET CENTURY ON SET DATE BRITISH ? DATE() RETURN NIL[/code:e8lh4i9s] EMG
date/hour Server
How does he do to verify the date and current hour of the server of files to be same in all stations? Clemerson
date/time limit (trial)
HI, someone has an sample of time/date limit of use, like trial version? thanks
date/time limit (trial)
Something like this? [code:j9mstoty]IF DATE&#40;&#41; > CTOD&#40; "XX/YY/ZZZZ" &#41; // Expired RETURN NIL ENDIF[/code:j9mstoty] EMG
date/time limit (trial)
Enrico, yes, but after expired, write in windows registry or create an file , to not execute again.
date/time limit (trial)
What is the problem? EMG
date/time limit (trial)
Enrico, after expired date, i need save it , using windows registry or an file... i need an sample, you have?
date/time limit (trial)
You can use MEMOWRIT() or FCREATE() to create files. I don't recommend to write in the registry. EMG
datepick into a ribbon folder
Any solution ?
datepick valid
I have a dialog with two datepick From and TO I know the number of room and the type I want see if I have a booking order on a dbf for this room and for this period on the file.dbf I have these fields CAMERA 6 N dal 8 Date Al 8 Date tipoattrez 1 C How I can make to control it ? i made : [code=fw:ivsqblht]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">Function</span> SE_Libera<span style="color: #000000;">&#40;</span>dDataIniziale,dDataFinale,n,cTipo<span style="color: #000000;">&#41;</span><br />&nbsp; <span style="color: #00C800;">Local</span> lOk := <span style="color: #00C800;">FALSE</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> nRec:=<span style="color: #000000;">&#40;</span>oDCot<span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>Recno<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #000000;">&#40;</span>oDCot<span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>OrdSetFocus<span style="color: #000000;">&#40;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #000000;">&#40;</span>oDCot<span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>DbGoTop<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;set filter <span style="color: #0000ff;">to</span> alltrim<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>oDCot<span style="color: #000000;">&#41;</span>->tipoattrez<span style="color: #000000;">&#41;</span> == cTipoAttrez .AND. <span style="color: #000000;">&#40;</span>oDCot<span style="color: #000000;">&#41;</span>->CAMERA == n &nbsp;;<br />&nbsp; &nbsp; &nbsp; .AND. ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#40;</span>;<br />&nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span>oDCot<span style="color: #000000;">&#41;</span>->DAL >= dDataIniziale .AND. <span style="color: #000000;">&#40;</span>oDCot<span style="color: #000000;">&#41;</span>->DAL <= dDataFinale &nbsp;<span style="color: #000000;">&#41;</span> .OR.;<br />&nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span>oDCot<span style="color: #000000;">&#41;</span>->AL >= dDataIniziale .AND. <span style="color: #000000;">&#40;</span>oDCot<span style="color: #000000;">&#41;</span>->AL <= dDataFinale &nbsp;<span style="color: #000000;">&#41;</span>;<br />&nbsp; <span style="color: #000000;">&#41;</span><br /><br /><br />&nbsp; &nbsp;<span style="color: #000000;">&#40;</span>oDCot<span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>DbSeek<span style="color: #000000;">&#40;</span>n<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">DO</span> <span style="color: #00C800;">WHILE</span> !<span style="color: #000000;">&#40;</span>oDCot<span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>EoF<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br /><br /><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lOk := <span style="color: #00C800;">TRUE</span><br /><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#40;</span>oDCot<span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>DbSKIP<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ENDDO</span><br /><br /><br />&nbsp; <span style="color: #000000;">&#40;</span>oDCot<span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span>DbGoTo<span style="color: #000000;">&#40;</span>nRec<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; <span style="color: #00C800;">Return</span> lOk </div>[/code:ivsqblht] but not run ok
datepick valid
Silvio, from Your example : [code=fw:2lherz9j]<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;">"dtpicker.ch"</span><br /><br /><span style="color: #00D7D7;">#define</span> <span style="color: #00C800;">TRUE</span>  .T.<br /><span style="color: #00D7D7;">#define</span> <span style="color: #00C800;">FALSE</span> .F.<br /><br /><span style="color: #00C800;">Function</span> test<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">Local</span> ddataini := DATE<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>   <span style="color: #B900B9;">//  CTOD("07.07.2009") // test from Database</span><br /><span style="color: #00C800;">local</span> ddatafin := DATE<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>  <span style="color: #B900B9;">// CTOD("21.07.2009") // test from Database</span><br /><span style="color: #00C800;">Local</span> oDlg, oDateStart, oDateEnd<br /><span style="color: #00C800;">Local</span> nOmbrellone :=<span style="color: #000000;">20</span><br /><span style="color: #00C800;">lOCAL</span> XTIPO:=<span style="color: #ff0000;">"O"</span><br /><br />SET DATE GERMAN<br /><br />cTipoAttrez := <span style="color: #ff0000;">"O"</span> <span style="color: #B900B9;">// from Database</span><br />n := <span style="color: #000000;">3</span> <span style="color: #B900B9;">// from Database</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">600</span>,<span style="color: #000000;">280</span> <span style="color: #0000ff;">TITLE</span><span style="color: #ff0000;">"SEARCH DATES"</span><br /><br />@ <span style="color: #000000;">1</span>,<span style="color: #000000;">2</span>  DTPICKER  oDateStart <span style="color: #0000ff;">VAR</span>  ddataini  <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>,<span style="color: #000000;">12</span>  <span style="color: #0000ff;">OF</span> oDlg <br /><span style="color: #B900B9;">// Only Test after End-date defined !!</span><br /><span style="color: #B900B9;">// ----------------------------------------------</span><br />@ <span style="color: #000000;">2</span>,<span style="color: #000000;">2</span>  DTPICKER  oDateEnd <span style="color: #0000ff;">VAR</span>  ddatafin  <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>,<span style="color: #000000;">12</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /><span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> IF_FREE<span style="color: #000000;">&#40;</span>ddataini,ddatafin,n,cTipoAttrez<span style="color: #000000;">&#41;</span><br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg  <span style="color: #0000ff;">CENTER</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">// ------------------------</span><br /><br /><span style="color: #00C800;">Function</span> IF_FREE<span style="color: #000000;">&#40;</span>ddataini,ddatafin,n,cTipoAttrez<span style="color: #000000;">&#41;</span><br />*<span style="color: #00C800;">Function</span> IF_FREE<span style="color: #000000;">&#40;</span>dDataIniziale,dDataFinale ,n,cTipoAttrez<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">Local</span> lOk := <span style="color: #00C800;">FALSE</span><br /><br />USE COTIZA  <span style="color: #0000ff;">ALIAS</span> COTIZA<br /><br /><span style="color: #B900B9;">// the index must be to cotiza-camera ordsetfocus(3) &nbsp;// Better STR on numeric-field for index</span><br /><span style="color: #B900B9;">// because I must set filter to cotiza->camera==n and cotiza->tipoattrez=ctipoattrez</span><br /><br /><span style="color: #B900B9;">// ---------------------------------</span><br /><span style="color: #B900B9;">// Better to start with a seek-value and exit after found !!!!!</span><br /><span style="color: #B900B9;">// Not  DbGoTop()</span><br /><span style="color: #B900B9;">// ---------------------------------</span><br /><br /><span style="color: #B900B9;">// COTIZA->(DbGoTop())</span><br />DBSEEK <span style="color: #000000;">&#40;</span> n <span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #B900B9;">// better index on STR( COTIZA->CAMERA )</span><br /><span style="color: #00C800;">DO</span> <span style="color: #00C800;">WHILE</span> !COTIZA-><span style="color: #000000;">&#40;</span>EoF<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> .and. COTIZA->CAMERA = n &nbsp;<span style="color: #B900B9;">// Main-Index</span><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> alltrim<span style="color: #000000;">&#40;</span>COTIZA->tipoattrez<span style="color: #000000;">&#41;</span> = cTipoAttrez ;<br />&nbsp; &nbsp; &nbsp; .AND. COTIZA->DAL >= ddataini .AND. COTIZA->DAL <= ddatafin ;<br />&nbsp; &nbsp; &nbsp; .AND. COTIZA->AL >=  ddataini .AND. COTIZA->AL <= ddatafin<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MSGINFO</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"SONOQUI"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; lOk :=<span style="color: #00C800;">TRUE</span><br />&nbsp; &nbsp; &nbsp; EXIT &nbsp;<span style="color: #B900B9;">// Exit after found one ???</span><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp;COTIZA-><span style="color: #000000;">&#40;</span>DbSkip<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">ENDDO</span><br /><br /><span style="color: #00C800;">Return</span> lOk<br /> </div>[/code:2lherz9j] Best Regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
datepick valid
I cannot add a new field on this archive I explain U... I have two date fields cotiza->dal ( initial date) and cotiza->al ( end date) the index must be to cotiza-camera ordsetfocus(3) beacuse I must set filter to cotiza->camera==n and cotiza->tipoattrez=ctipoattrez when on the dialog I insert the initial date and end date the procedure must to control if on the cotiza.dbf there are records have the fields cotoza->dal ( initial date) and cotiza->al ( end date) equal to the period I inserted. if it found records it must return .t.
datepick valid
Silvio, I tested with some small changes in Your example and it returns for 2 given dates TRUE or FALSE. Tested Record from Your Database : [color=#FF0000:sl7no7f4]Camera = 3 Tipo = O Start = 07.07.2009 End = 21.07.2009[/color:sl7no7f4] [code=fw:sl7no7f4]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"dtpicker.ch"</span><br /><br /><span style="color: #00D7D7;">#define</span> <span style="color: #00C800;">TRUE</span>  .T.<br /><span style="color: #00D7D7;">#define</span> <span style="color: #00C800;">FALSE</span> .F.<br /><br /><span style="color: #00C800;">Function</span> test<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">Local</span> ddataini := DATE<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>   <span style="color: #B900B9;">//  CTOD("07.07.2009") // from Database</span><br /><span style="color: #00C800;">local</span> ddatafin := DATE<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>  <span style="color: #B900B9;">// CTOD("21.07.2009") // from Database</span><br /><span style="color: #00C800;">Local</span> oDlg, oDateStart, oDateEnd<br /><span style="color: #00C800;">Local</span> nOmbrellone :=<span style="color: #000000;">20</span><br /><span style="color: #00C800;">lOCAL</span> XTIPO:=<span style="color: #ff0000;">"O"</span> <span style="color: #B900B9;">// from Database</span><br /><br />SET DATE GERMAN<br />REQUEST DBFCDX<br />Rddsetdefault<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"DBFCDX"</span><span style="color: #000000;">&#41;</span><br /><br />cTipoAttrez := <span style="color: #ff0000;">"O"</span> <span style="color: #B900B9;">// Test from Your Database</span><br />n := <span style="color: #000000;">3</span> <span style="color: #B900B9;">// Test from Your Database</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">600</span>,<span style="color: #000000;">280</span> <span style="color: #0000ff;">TITLE</span><span style="color: #ff0000;">"SEARCH DATES"</span><br /><br />@ <span style="color: #000000;">1</span>,<span style="color: #000000;">2</span>  DTPICKER  oDateStart <span style="color: #0000ff;">VAR</span>  ddataini  <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>,<span style="color: #000000;">12</span>  <span style="color: #0000ff;">OF</span> oDlg <span style="color: #B900B9;">// valid IF_FREE(ddataini,ddatafin ,nOmbrellone,XTIPO)</span><br /><span style="color: #B900B9;">// Only Test after End-date defined !!</span><br /><span style="color: #B900B9;">// ----------------------------------------------</span><br />@ <span style="color: #000000;">2</span>,<span style="color: #000000;">2</span>  DTPICKER  oDateEnd <span style="color: #0000ff;">VAR</span>  ddatafin  <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">80</span>,<span style="color: #000000;">12</span> <span style="color: #0000ff;">OF</span> oDlg ;<br /><span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> IIF <span style="color: #000000;">&#40;</span> IF_FREE<span style="color: #000000;">&#40;</span>ddataini,ddatafin,n,cTipoAttrez<span style="color: #000000;">&#41;</span>, ;<br />      MsgAlert<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Date found !"</span>,<span style="color: #ff0000;">"Attention"</span><span style="color: #000000;">&#41;</span>, ;<br />      MsgAlert<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Date not found !"</span>,<span style="color: #ff0000;">"Attention"</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg  <span style="color: #0000ff;">CENTER</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">// -------- Start 07.07.2009 - End 21.07.2009 ----------------</span><br /><br /><span style="color: #00C800;">Function</span> IF_FREE<span style="color: #000000;">&#40;</span>ddataini,ddatafin,n,cTipoAttrez<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">Local</span> lOk := <span style="color: #00C800;">FALSE</span><br /><br />USE COTIZA  <span style="color: #0000ff;">ALIAS</span> COTIZA<br />DBSETORDER<span style="color: #000000;">&#40;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#41;</span><br />DBSEEK<span style="color: #000000;">&#40;</span> n <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">IF</span> Found<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">DO</span> <span style="color: #00C800;">WHILE</span> !COTIZA-><span style="color: #000000;">&#40;</span>EoF<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> .and. COTIZA->CAMERA = n<br />      <span style="color: #00C800;">IF</span> alltrim<span style="color: #000000;">&#40;</span>COTIZA->tipoattrez<span style="color: #000000;">&#41;</span> = cTipoAttrez ;<br />         .AND. COTIZA->DAL >= ddataini .AND. COTIZA->DAL <= ddatafin ;<br />         .AND. COTIZA->AL >=  ddataini .AND. COTIZA->AL <= ddatafin<br />         <span style="color: #0000ff;">MSGINFO</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"SONOQUI"</span><span style="color: #000000;">&#41;</span><br />         lOk :=<span style="color: #00C800;">TRUE</span><br />         EXIT<br />      <span style="color: #00C800;">ENDIF</span><br />      COTIZA-><span style="color: #000000;">&#40;</span>DbSkip<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">ENDDO</span><br /><span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">Return</span> lOk<br /> </div>[/code:sl7no7f4] Best Regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
datepick valid
before to open the dialog I see the msginfo..... and then .... WHAT IS IT ? [img:m5de43vf]http&#58;//img200&#46;imageshack&#46;us/img200/7295/whatisit&#46;jpg[/img:m5de43vf]
datepick valid
Silvio, The message < date not found > is just a control for You, that .T. and .F. works. Any datapicker-selection will show .F. until You chose the correct values. You only need to use < found OK >, the message < Not found > You don't need and must set to NIL. With test-values Start : [color=#FF0000:15qupkhf]07.07.2009 [/color:15qupkhf]and End : [color=#FF0000:15qupkhf]21.07.2009 [/color:15qupkhf]from Your database, You will get the Message : Date found ! It is very fast ( seek on CAMERA ) , because no filter is used. [color=#FF0000:15qupkhf]Index[/color:15qupkhf] : CAMERA 6 N Start : dal 8 Date End : Al 8 Date Type : tipoattrez 1 C @ 2,2 DTPICKER oDateEnd VAR ddatafin SIZE 80,12 OF oDlg ; ON CHANGE IIF ( IF_FREE(ddataini,ddatafin,n,cTipoAttrez), ; MsgAlert( "Date found !","Attention"), [color=#FF0000:15qupkhf]NIL[/color:15qupkhf] ) [img:15qupkhf]http&#58;//www&#46;pflegeplus&#46;com/pictures/date1&#46;jpg[/img:15qupkhf] Best regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
dates of a mounth
Hi Silvio You don't say how you want returned such a complex result like that, it at least has 24 dates. May be [code=fw:1cku0rpg]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">FUNCTION</span> GimmyTheDates<span style="color: #000000;">&#40;</span> nYear <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">LOCAL</span> aDates<span style="color: #000000;">&#91;</span> <span style="color: #000000;">12</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span><br />   aEval<span style="color: #000000;">&#40;</span> aDates, <span style="color: #000000;">&#123;</span>|x, i| x<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:= StoD<span style="color: #000000;">&#40;</span> StrZero<span style="color: #000000;">&#40;</span> nYear, <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span> + StrZero<span style="color: #000000;">&#40;</span> i, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">'01'</span> <span style="color: #000000;">&#41;</span>, x<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>:= EOM<span style="color: #000000;">&#40;</span> x<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span> aDates<br /><br /><span style="color: #00C800;">FUNCTION</span> EOM<span style="color: #000000;">&#40;</span> dDate <span style="color: #000000;">&#41;</span><br />   dDate+= <span style="color: #000000;">35</span> - Day<span style="color: #000000;">&#40;</span> dDate <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">RETURN</span> dDate - Day<span style="color: #000000;">&#40;</span>dDate<span style="color: #000000;">&#41;</span><br /> </div>[/code:1cku0rpg]
dates of a mounth
We need not have our own function EOM(d) There is already a function EOM(d) in (x)Harbour.
dates of a mounth
Dear friends, I need a function return me the init date and the end date of each mounth , I passed only the Year How I can do it ? Wich function i must use to have them ? thanks
dates of a mounth
[size=200:1vw84ju6]thanks it is that I search[/size:1vw84ju6]
dates of a mounth
thanks Rao
datetime de access
como se obtiene una variable del tipo datetime de una tabla de access, usando ADO? salu2 paco
datetime de access
te la devuelve como cadena de caracteres, aunque xHarbour ya posee el tipo de dato DateTime. Tomado del manual de xHarbour: [code:1u8rko1d]PROCEDURE Main LOCAL d1, d2, nDiff SET CENTURY ON SET TIME FORMAT TO "hh&#58;mm&#58;ss&#46;ccc" ? DateTime&#40;&#41; // result&#58; &#91;today&#93; &#91;systemtime&#93; ? &#123;ˆ 2007/04/26&#125; // result&#58; 04/26/2007 ? &#123;ˆ 05&#58;30&#58;12&#46;345&#125; // result&#58; 12/30/1999 05&#58;30&#58;12&#46;345 ? &#123;ˆ 05&#58;30&#58;12&#46;345 PM&#125; // result&#58; 12/30/1999 17&#58;30&#58;12&#46;345 ** Empty value ? d1 &#58;= &#123;ˆ 0/0/0 &#125; // result&#58; / / ? Empty&#40; d &#41; // result&#58; &#46;T&#46; ** difference between DateTime and Date ? d1 &#58;= &#123;ˆ 2007/04/26 18&#58;30&#58;00 &#125; // result&#58; 04/26/2007 18&#58;30&#58;00&#46;000 ? d2 &#58;= StoD&#40;"20070426"&#41; // result&#58; 04/26/2007 ? nDiff &#58;= d1-d2, "days" // result&#58; 0&#46;77 days ? TString&#40; nDiff*86400 &#41; // result&#58; 18&#58;30&#58;00 ** Adding 2 days to DateTime ? d1 + 2 // result&#58; 04/28/2007 18&#58;30&#58;00&#46;000 ** Adding 2 hours to DateTime ? d1 + 2/24 // result&#58; 04/26/2007 20&#58;30&#58;00&#46;000 ** Adding 2 minutes to DateTime ? d1 + 2/&#40;24*60&#41; // result&#58; 04/26/2007 18&#58;32&#58;00&#46;000 ** Adding 2 seconds to DateTime ? d1 + 2/&#40;24*3600&#41; // result&#58; 04/26/2007 18&#58;30&#58;02&#46;000 RETURN [/code:1u8rko1d]
datetime de access
Gracias rene, como siempre tan oportuno (savelife), pues siempre al obtener el dato de la .mdb unicamente me regresaba el dato fecha, veo lo que comentas. gracias paco
datetime de access
Gracias rene, esta funcion esta en xharbour, pero lo que necesito es obtener el dato fecha y hora que esta almacenado en una .mdb, pero desde fwh, hice la conexion con ADO y al traer el VALUE del campo unicamente me trae la fecha, y necesito ambos fecha y hora, como veo la explicacion que haces es para yo hacerlo directamente con una variable usando la funcion datetime... aDato[2] := oRS:Fields("FECHAMOV"):Value aDato[2] se guarda unicamente la fecha... salu2 paco
datetime de access
Paco efectivamente aunque en el acces se mira el campo con fecha y hora el recorset de ADO solo te devuelve la fecha ignorando el resto, 05/09/2007 07:33:20 msginfo( oRS:Fields("FECHAMOV"):Value ) solo muestra un pezado del estring 05/09/2007 algun guro debe de saber el porque . saludos..
datetime from server
Hello friends, With mod harbour we can use much of our "CLIPPER/HARBOUR" knowledge for the web programming. Best regards, Otto [img:ul903nhd]https&#58;//mybergland&#46;com/fwforum/date&#46;jpg[/img:ul903nhd]
dati da excel di openoffice
CIao, avevo recuperato in giro una programmino con il quale riuscivo a recuperare i dati da un foglio excel di Microsoft) Ora pero' volevo recuperare i dati da un foglio excel di OpenOffice. Ma lo stesso programma non funziona. Avete qualcosa su cui "spataccare" ? Grazie Romeo/Zingoni
dati da excel di openoffice
Qualche linea di codice: [code=fw:1j02p7et]<div class="fw" id="{CB}" style="font-family: monospace;">oSrvMan &nbsp;= CREATEOBJECT<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"com.sun.star.ServiceManager"</span> <span style="color: #000000;">&#41;</span><br />oDesktop = oSrvMan:<span style="color: #000000;">CreateInstance</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"com.sun.star.frame.Desktop"</span> <span style="color: #000000;">&#41;</span><br /><br />oDoc = oDesktop:<span style="color: #000000;">LoadComponentFromURL</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"private:factory/scalc"</span>, <span style="color: #ff0000;">"_blank"</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br />oSheet = oDoc:<span style="color: #000000;">GetSheets</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">GetByIndex</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br /><br />? oSheet:<span style="color: #000000;">GetCellByPosition</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">GetString</span></div>[/code:1j02p7et] EMG
dati da excel di openoffice
Grazie, Ho provato ma canno da qualche parte. Il mio file di excel di openoffice, che si chiama pippo.ods Intanto dove fa messo nella tua procedura ? Xche' io devo prendere dei dati da un foglio excel di openoffice GIA' ESISTENTE. Romeo/Zingoni
dati da excel di openoffice
Purtroppo non ho altri esempi. Guarda anche nel sorgente xbrowse.prg oppure cerca su Internet. EMG
dati da excel di openoffice
Salve, partendo da un esempietto di EMG e manipolandolo, qualcosa ho combinato. ... ... minimizzando il problema: oSrvMan = CREATEOBJECT( "com.sun.star.ServiceManager" ) oDesktop = oSrvMan:CreateInstance( "com.sun.star.frame.Desktop" ) aProp:={} aadd(aProp,GetPropertyValue(oSrvMan,"Hidden",.t.)) oDoc = oDesktop:LoadComponentFromURL("file:///c:/pippo.ods", "_blank",0, aProp) oSheet = oDoc:GetSheets():GetByIndex( 0 ) miocampo=oSheet:GetCellByPosition( 0, 0 ):GetString . . . fine programma .... Se clicco ora su Open Office, non parte perche' e' rimasto aperto, anche se invisibile, con il file pippo.ods aperto. Come si fa a chiuderle OpenOffice e quindi liberare anche pippo.ods con fivewin/harbour ? Ho provato con quit(), end() ecc agendo su: osheet, oDoc, oDesktop, oSrvMan ma mi da sempre errore. Grazie Romeo ZIngoni
davinci.ch
Hi Where can I get davinci.ch Regards ACWoo Using harbour1304+bcc582
davinci.ch
Look <!-- m --><a class="postlink" href="https://bitbucket.org/navarro_cristobal/easypreview_n1/downloads">https://bitbucket.org/navarro_cristobal ... /downloads</a><!-- m -->
davinci.ch
Hi Thanks ACWoo Using harbour1304+bcc582
day of year
Hi, i am looking about a function which returns the numeric value of the day in the year ex function (01/01/06) return 1 function (31/12/06) reutrn 365 May be this function exist but i don't find it Any idea? Thanks
day of year
[quote="patili":22qsh4ni]Hi, i am looking about a function which returns the numeric value of the day in the year ex function (01/01/06) return 1 function (31/12/06) reutrn 365 May be this function exist but i don't find it Any idea? Thanks[/quote:22qsh4ni] If use xHarbour [code:22qsh4ni]DOY &#40;&#91;<dDate>&#93;&#41;[/code:22qsh4ni]
day of year
No i'm using Fivewin and clipper
day of year
Patili, [code:21advgw3] function Main&#40;&#41; SET DATE FRENCH MsgInfo&#40; Doy&#40; CToD&#40; "01/01/06" &#41; &#41; &#41; MsgInfo&#40; Doy&#40; CToD&#40; "31/12/06" &#41; &#41; &#41; return nil function DOY&#40; dDate &#41; local nMonth &#58;= Month&#40; dDate &#41; local nDay &#58;= 0 while nMonth > 0 nDay += Day&#40; dDate &#41; dDate -= Day&#40; dDate &#41; nMonth-- end return nDay [/code:21advgw3]
day of year
And NOW it exist Thank you Antonio
day of year
You are welcome <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->