topic
stringlengths
1
63
text
stringlengths
1
577k
Classes ... anyone?
Steve, Please link this OBJ with your application: <!-- m --><a class="postlink" href="http://rapidshare.com/files/101302540/xhb.obj.html">http://rapidshare.com/files/101302540/xhb.obj.html</a><!-- m -->
Classes ... anyone?
Many thanks Antonio ... that little OBJ worked like magic; and now I feel rather sheepish ... I think this is something that I should be able to resolve myself? ... where to start? ... the mystery remains!. I salute you guys out there ... thank you.
Classes ... anyone?
Steve, > I think this is something that I should be able to resolve myself? No. Its a low level technical issue. We solved it here <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> > ... where to start? ... the mystery remains! Here you have a brief explanation about it: The class TActiveX uses some C++ low level source code. With Borland and Microsoft C compilers there is no problem as those missing symbols are provided by Borland and Microsoft. But xHB C compiler (it is PellesC compiler just renamed) does not provide C++ support at all. In my little OBJ there is a replacement for those C++ missing symbols. Is your EXE working fine ? If yes, then simply don't care about it <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Classes documentation
I'm looking for deeper documentation about fivewin classes. I'm rookie and I don't know if it exist. Spedifically, I'm need it about TDATABASE. I have the methods and datas but I can't find the methods sintax.
Classes documentation
<!-- m --><a class="postlink" href="http://wiki.fivetechsoft.com/doku.php?id=fivewin_class_tdatabase">http://wiki.fivetechsoft.com/doku.php?i ... _tdatabase</a><!-- m -->
Classes documentation
Class TDataBase is very easy to understand.Simply review source/classes/database.prg source code and you will see the methods parameters.
Classes documentation
There are some articles about classes and database classes on my website here:[img:2f382s76]http&#58;//ourworld&#46;compuserve&#46;com/homepages/jbott/program&#46;htm[/img:2f382s76]Regards,James
Classes heredadas - Ayuda
Buenas noches, Estoy intentando crear una clase "heredada" porque estuve viendo en el foro y sería práctico no reformar directamente las clases. Copio un pequeño ejemplo con la clase TRichedit a la cual le agrego un method (METHOD Cololo) y una data (lItalica). [code=fw:1he28tsw]<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;">"Constant.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"WColors.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"RichEdit.ch"</span><br /><br /><br /><br /><span style="color: #00C800;">CLASS</span> NewRichedit <span style="color: #0000ff;">FROM</span> TRichEdit<br /><br />CLASSDATA lRegistered AS LOGICAL   <br /><br />    <span style="color: #00C800;">DATA</span>  lItalica      AS LOGICAL <span style="color: #0000ff;">INIT</span> .f.                                                                         <br />        <br />    <span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> nTop, nLeft, bSetGet, oWnd, nWidth, nHeight, oFont, ;<br />               lPixel, cMsg, lHScroll, lReadOnly, bWhen, bValid, ;<br />               bChanged, lDesign, lHighlight, cFileName, ;<br />               nRTFSize, lNoURL, lNoScroll, lNoBorder <span style="color: #000000;">&#41;</span> CONSTRUCTOR<br /> <br />    <span style="color: #00C800;">METHOD</span> Cololo<span style="color: #000000;">&#40;</span> nStart, nEnd, nColor <span style="color: #000000;">&#41;</span><br /><br />     <br />                                 <br /><span style="color: #00C800;">ENDCLASS</span><br /><br /><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">METHOD</span> <span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> nTop, nLeft, bSetGet, oWnd, nWidth, nHeight, oFont, ;<br />            lPixel, cMsg, lHScroll, lReadOnly, bWhen, bValid, ;<br />            bChanged, lDesign, lHighlight, cFileName, ;<br />            nRTFSize, lNoURL, lNoScroll, lNoBorder <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> NewRichedit<span style="color: #B900B9;">//TRichEdit</span><br /><br />   #ifdef __XPP__<br />      #undef <span style="color: #00C800;">New</span><br />   #endif<br /><br />   <span style="color: #00C800;">DEFAULT</span> nTop       := <span style="color: #000000;">0</span>, ;<br />           nLeft      := <span style="color: #000000;">0</span>, ;<br />           oWnd       := GetWndDefault<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, ;<br />           nWidth     := GetClientRect<span style="color: #000000;">&#40;</span> oWnd:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span>, ;<br />           nHeight    := GetClientRect<span style="color: #000000;">&#40;</span> oWnd:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span>, ;<br />           lPixel     := .f., ;<br />           lHScroll   := .f., ;<br />           lReadOnly  := .f., ;<br />           lDesign    := .f., ;<br />           lHighlight := .f., ;<br />           cFileName  := <span style="color: #ff0000;">""</span> , ;<br />           nRTFSize   := <span style="color: #000000;">1024</span> * <span style="color: #000000;">1024</span>, ;<br />           lNoURL     := .f., ;<br />           lNoScroll  := .f., ;<br />           lNoBorder  := .f., ;<br />           oFont      := TFont<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Arial"</span>, <span style="color: #000000;">0</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> LargeFonts<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">-11</span>, <span style="color: #000000;">-13</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">if</span> bSetGet != <span style="color: #00C800;">nil</span><br />      ::<span style="color: #000000;">cCaption</span> = cValToChar<span style="color: #000000;">&#40;</span> Eval<span style="color: #000000;">&#40;</span> bSetGet <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">else</span><br />      ::<span style="color: #000000;">cCaption</span> = <span style="color: #ff0000;">""</span><br />   <span style="color: #00C800;">endif</span><br /><br />   ::<span style="color: #000000;">nTop</span>      = <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lPixel, nTop, nTop * SAY_CHARPIX_H <span style="color: #000000;">&#41;</span><br />   ::<span style="color: #000000;">nLeft</span>     = <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lPixel, nLeft, nLeft * SAY_CHARPIX_W <span style="color: #000000;">&#41;</span><br />   ::<span style="color: #000000;">nBottom</span>   = ::<span style="color: #000000;">nTop</span> + nHeight - <span style="color: #000000;">1</span><br />   ::<span style="color: #000000;">nRight</span>    = ::<span style="color: #000000;">nLeft</span> + nWidth - <span style="color: #000000;">1</span><br />   ::<span style="color: #000000;">bSetGet</span>   = bSetGet<br />   ::<span style="color: #000000;">oWnd</span>      = oWnd<br />   ::<span style="color: #000000;">nStyle</span>    = nOR<span style="color: #000000;">&#40;</span> WS_CHILD, WS_VISIBLE, WS_TABSTOP, WS_VSCROLL, ;<br />                      <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lDesign   , WS_CLIPSIBLINGS, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>, ;<br />                      <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> !lNoBorder, WS_BORDER, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>, ;<br />                      <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lHScroll  , WS_HSCROLL, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>, ;<br />                      <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> !lHScroll , ES_WANTRETURN, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>, ;<br />                      <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> !lNoScroll, ES_DISABLENOSCROLL, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>, ;<br />                      ES_MULTILINE <span style="color: #000000;">&#41;</span><br />   ::<span style="color: #000000;">nId</span>       = ::<span style="color: #000000;">GetNewId</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   ::<span style="color: #000000;">cCaption</span>  = RTrim<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cCaption</span> <span style="color: #000000;">&#41;</span><br />   ::<span style="color: #000000;">lDrag</span>     = lDesign<br />   ::<span style="color: #000000;">lCaptured</span> = .f.<br />   ::<span style="color: #000000;">oFont</span>     = oFont<br />   ::<span style="color: #000000;">cMsg</span>      = cMsg<br />   ::<span style="color: #000000;">lReadOnly</span> = lReadOnly<br />   ::<span style="color: #000000;">bWhen</span>     = bWhen<br />   ::<span style="color: #000000;">bValid</span>    = bValid<br />   ::<span style="color: #000000;">bChange</span>   = bChanged<br />   ::<span style="color: #000000;">cFileName</span> = cFileName<br />   ::<span style="color: #000000;">nRTFSize</span>  = <span style="color: #0000ff;">Max</span><span style="color: #000000;">&#40;</span> nRTFSize, <span style="color: #000000;">32</span> * <span style="color: #000000;">1024</span> <span style="color: #000000;">&#41;</span><br />   ::<span style="color: #000000;">lURL</span>      = !lNoURL<br /><br />   ::<span style="color: #000000;">lHighlight</span>  = lHighlight<br />   ::<span style="color: #000000;">aKeywords1</span>  = <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"CLASS"</span>, <span style="color: #ff0000;">"FROM"</span>, <span style="color: #ff0000;">"ENDCLASS"</span>, <span style="color: #ff0000;">"DATA"</span>, <span style="color: #ff0000;">"AS"</span>, <span style="color: #ff0000;">"METHOD"</span>, ;<br />                     <span style="color: #ff0000;">"CONSTRUCTOR"</span>, <span style="color: #ff0000;">"function"</span>, <span style="color: #ff0000;">"return"</span>, <span style="color: #ff0000;">"OBJECT"</span>, <span style="color: #ff0000;">"ENDOBJECT"</span> <span style="color: #000000;">&#125;</span><br />   ::<span style="color: #000000;">aKeywords2</span>  = <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"#include"</span>, <span style="color: #ff0000;">"Self"</span>, <span style="color: #ff0000;">"nil"</span>, <span style="color: #ff0000;">"public"</span>, <span style="color: #ff0000;">"local"</span>, <span style="color: #ff0000;">"Super"</span> <span style="color: #000000;">&#125;</span><br />   ::<span style="color: #000000;">cSeparators</span> = <span style="color: #ff0000;">" +-()[]:*/{},="</span><br /><br />   ::<span style="color: #000000;">nClrNumber</span>    = CLR_HMAGENTA<br />   ::<span style="color: #000000;">nClrString</span>    = CLR_YELLOW<br />   ::<span style="color: #000000;">nClrComment</span>   = CLR_HBLUE<br />   ::<span style="color: #000000;">nClrSeparator</span> = CLR_WHITE<br />   ::<span style="color: #000000;">nClrText</span>      = CLR_BLACK<br />   ::<span style="color: #000000;">nClrKey1</span>      = CLR_HGREEN<br />   ::<span style="color: #000000;">nClrKey2</span>      = CLR_HCYAN<br />   <br />   <br />     ::<span style="color: #000000;">lItalica</span>         :=  .f.                    <span style="color: #B900B9;">// by rolo</span><br />     <br />    <br />    <br />   ::<span style="color: #000000;">SetOleInit</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">&#40;</span> oWnd:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span><br />      ::<span style="color: #000000;">Create</span><span style="color: #000000;">&#40;</span> CTRL_CLASS <span style="color: #000000;">&#41;</span><br />      ::<span style="color: #000000;">SendMsg</span><span style="color: #000000;">&#40;</span> WM_SETFONT, oFont:<span style="color: #000000;">hFont</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />      ::<span style="color: #00C800;">Default</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      oWnd:<span style="color: #000000;">AddControl</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">Self</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">else</span><br />      oWnd:<span style="color: #000000;">DefControl</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">Self</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endif</span><br /><br />   ::<span style="color: #000000;">SetFont2RTF</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oFont</span>:<span style="color: #000000;">nHeight</span> <span style="color: #000000;">&#41;</span>  <span style="color: #B900B9;">// to adjust point size</span><br /><br />   <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lHighlight</span><br />      ::<span style="color: #000000;">HighLightAllText</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// PostMessage( ::hWnd, FM_HIGHLIGHTALL )</span><br />   <span style="color: #00C800;">endif</span><br /><br />   <span style="color: #00C800;">if</span> lDesign<br />      ::<span style="color: #000000;">CheckDots</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">Self</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><br /><span style="color: #00C800;">METHOD</span> Cololo<span style="color: #000000;">&#40;</span> nStart, nEnd, nColor <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> NewRichedit <span style="color: #B900B9;">//TRichEdit</span><br /><br />   ::<span style="color: #000000;">SetSel</span><span style="color: #000000;">&#40;</span> nStart, nEnd <span style="color: #000000;">&#41;</span><br />   RESetCharFormat<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">hWnd</span>, ::<span style="color: #000000;">oFont</span>:<span style="color: #000000;">cFaceName</span>, ;<br />                    Size2Font<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oFont</span>:<span style="color: #000000;">nHeight</span> <span style="color: #000000;">&#41;</span> * ::<span style="color: #000000;">nTamano</span> , nColor , ;               <br />                    ::<span style="color: #000000;">oFont</span>:<span style="color: #000000;">nCharSet</span>, ;<br />                    ::<span style="color: #000000;">oFont</span>:<span style="color: #000000;">nPitchFamily</span>, ;<br />                    <span style="color: #000000;">&#40;</span><span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span>::<span style="color: #000000;">lItalica</span>,.t.,.f.<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> ,;                                                                                             <br />                     ::<span style="color: #000000;">oFont</span>:<span style="color: #000000;">lStrikeOut</span> <span style="color: #000000;">&#41;</span><br />   ::<span style="color: #000000;">HideSel</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />    <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 /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> Size2Font<span style="color: #000000;">&#40;</span> nSize <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #0000ff;">Abs</span><span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">Round</span><span style="color: #000000;">&#40;</span> nSize * <span style="color: #000000;">3</span>/<span style="color: #000000;">4</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span></div>[/code:1he28tsw] Esto lo compila bien sin ningún error pero si hago: [code=fw:1he28tsw]<div class="fw" id="{CB}" style="font-family: monospace;">oRich:<span style="color: #000000;">lItalica</span>:=.t.</div>[/code:1he28tsw] A la hora de ejecutar ese código da un error: [code=fw:1he28tsw]<div class="fw" id="{CB}" style="font-family: monospace;">Error description: <span style="color: #000000;">Warning</span> BASE/<span style="color: #000000;">1005</span>  <span style="color: #0000ff;">Message</span> not found: <span style="color: #000000;">TRICHEDIT</span>:_LITALICA<br />Stack Calls<br />===========<br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">source</span>\rtl\tobject.prg => TRICHEDIT:<span style="color: #000000;">ERROR</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">source</span>\rtl\tobject.prg => TRICHEDIT:<span style="color: #000000;">MSGNOTFOUND</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span><br />   Called <span style="color: #0000ff;">from</span>: <span style="color: #000000;">source</span>\rtl\tobject.prg => TRICHEDIT:_LITALICA<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span></div>[/code:1he28tsw] Esta pequeña reforma es solo una prueba para encontrar la forma de hacerlo bien. Si a la nueva data y al Method los coloco dentro de la clase TRichedit, funciona sin inconvenientes. ¿Alguien puede ayudarme a ver que estoy haciendo mal?. Gracias. Rolando <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Classes heredadas - Ayuda
Rolando, Si tu nueva clase se llama NewRichedit(), entonces tienes que usarla para crear tu control y no usar TRichEdit()
Classes heredadas - Ayuda
Antonio, Gracias por responder. Lo que pretendo es realizar cambios a un par de methods agregando datas y también agregar algunos methods más en el caso de la TRichedit. La idea es que no tenga que rehacer todos los cambios que le hecho a cada clase cuando actualice versión. ¿Es esta la forma correcta de hacerlo o hay otra manera?. Gracias. Rolando <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Classes heredadas - Ayuda
Rolando, La forma más correcta es crear una nueva clase derivada de la que quieres modificar, como has hecho. Lo que ocurre es que eso hace que los comandos xbase no sirvan, ya que solo se refieren a las Clases originales. Una solución es variar la Clase, sin modificar su código fuente. Esto no es "correcto", pero funciona bastante bien <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> Para añadir nuevas DATAs puedes hacer: EXTEND CLASS TRichEdit WITH DATA oMiData Para añadir nuevos Métodos o cambiar los existentes: EXTEND CLASS TRichEdit WITH MESSAGE MiMensaje METHOD MiMetodo y defines en el código la función MiMetodo la referencia a Self: local self := HB_QSelf()
Classes heredadas - Ayuda
Gracias Antonio, ahora lo tengo un poco más claro. Pero, por mi modo de programar (mezcla de clipper y POO), para crear clases heredadas, debería rehacer todos los prg's de mis aplicaciones. Seguramente lo voy a intentar con algún proyecto nuevo, pero por ahora voy a probar sobreescribiendo métodos y, si eso no me resulta, seguiré como antes cambiando las clases a la medida de mis necesidades (como tengo asentados todos los cambios, calculo que me será más fácil de realizar que si debo cambiar todos los prg's de mis aplicaciónes). Rolando <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Classes heredadas - Ayuda
Rolando, Si tus cambios en las clases son genéricos y de utilidad para otros, siempre podemos estudiar el incluirlos en FiveWin, asi no tendrías que cambiar nada en las clases estandard de FWH <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Classes heredadas - Ayuda
Antonio, He hecho pequeños cambios en distintas clases, pero en la que más trabajé es en la TRichedit (dentro de mis limitados conocimientos, le agregué algunas funcionalidades tal cual lo necesitaba). Voy a preparar con tiempo un ejemplo y te lo enviaré, junto con la clase modificada, para que lo analices y si vale la pena publicar los cambios (y quizás mejorarlos), por supuesto que me gustaría que lo hagas. Saludos. Rolando <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Classes heredadas - Ayuda
Rolando, Parece muy interesante, asi que quedo a la espera de que me lo envies cuando puedas. Muchas gracias <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Classes inheritance. How to ?
Where can I find a tutorial and/or documentation about how to create and inherit FWH classes ? Is there one around ? I am triing to inherit a class from another because I need to add a method. I am getting an error that I don´t have if I use the original class. The object seems not ot be created at all... The code is something like this: Class CL2 from CL1 METHOD PrintCl() ENDCLASS METHOD PrintCl() class CL2 alert("CL2") return NIL Questions: Al the CL1 methods are avaiable in CL2 ? Do I need a constructor/destructor method or the CL1 one is used ? [[]] Maurício Faria
Classes inheritance. How to ?
[quote="concentra":1su26fex]Where can I find a tutorial and/or documentation about how to create and inherit FWH classes ? Is there one around ? I am triing to inherit a class from another because I need to add a method. I am getting an error that I don´t have if I use the original class. The object seems not ot be created at all... The code is something like this: Class CL2 from CL1 METHOD PrintCl() ENDCLASS METHOD PrintCl() class CL2 alert("CL2") return NIL Questions: Al the CL1 methods are avaiable in CL2 ? Do I need a constructor/destructor method or the CL1 one is used ? [[]] Maurício Faria[/quote:1su26fex] Don't forget to add: CLASSDATA lRegistered AS LOGICAL
Classes inheritance. How to ?
[quote="concentra":lm3v8q3z]Where can I find a tutorial and/or documentation about how to create and inherit FWH classes ?[/quote:lm3v8q3z] Best documentation is FWH source code. [quote="concentra":lm3v8q3z]I am triing to inherit a class from another because I need to add a method. I am getting an error that I don´t have if I use the original class. The object seems not ot be created at all... The code is something like this: Class CL2 from CL1 METHOD PrintCl() ENDCLASS METHOD PrintCl() class CL2 alert("CL2") return NIL[/quote:lm3v8q3z] Can you build a little real (compilable) sample of the problem? [quote="concentra":lm3v8q3z]Questions: Al the CL1 methods are avaiable in CL2 ?[/quote:lm3v8q3z] Yes. [quote="concentra":lm3v8q3z]Do I need a constructor/destructor method or the CL1 one is used ?[/quote:lm3v8q3z] Yes, you need of a constructor. EMG
Classes inheritance. How to ?
Maurício, There are a couple of articles that I wrote on this available on my website here: <!-- m --><a class="postlink" href="http://ourworld.compuserve.com/homepages/jbott/program.htm">http://ourworld.compuserve.com/homepage ... rogram.htm</a><!-- m --> The article, "Introduction to Object-Oriented Programming Using FiveWin" is in two parts. >I am getting an error that I don´t have if I use the original class. I see nothing wrong with the code you show so the problem must be in the code you didn't show us. Can you provide us with a small REAL example. Which FW class are trying to inherit from? What is the error you are getting? What version of FW are you using? James
Classes inheritance. How to ?
[quote="Gale FORd":13cm3mck][quote="concentra":13cm3mck]Where can I find a tutorial and/or documentation about how to create and inherit FWH classes ? Is there one around ? I am triing to inherit a class from another because I need to add a method. I am getting an error that I don´t have if I use the original class. The object seems not ot be created at all... The code is something like this: Class CL2 from CL1 METHOD PrintCl() ENDCLASS METHOD PrintCl() class CL2 alert("CL2") return NIL Questions: Al the CL1 methods are avaiable in CL2 ? Do I need a constructor/destructor method or the CL1 one is used ? [[]] Maurício Faria[/quote:13cm3mck] Don't forget to add: CLASSDATA lRegistered AS LOGICAL[/quote:13cm3mck] Why ? What is "lRegistered" ? [[]] Maurício Faria
Classes inheritance. How to ?
[quote="James Bott":146i9z3b]Maurício, There are a couple of articles that I wrote on this available on my website here: <!-- m --><a class="postlink" href="http://ourworld.compuserve.com/homepages/jbott/program.htm">http://ourworld.compuserve.com/homepage ... rogram.htm</a><!-- m --> The article, "Introduction to Object-Oriented Programming Using FiveWin" is in two parts. >I am getting an error that I don´t have if I use the original class. I see nothing wrong with the code you show so the problem must be in the code you didn't show us. Can you provide us with a small REAL example. Which FW class are trying to inherit from? What is the error you are getting? What version of FW are you using? James[/quote:146i9z3b] Thanks James. I am reading it and it seems very usefull for a beginning. Can I translate to Portuguese ? [[]] Maurício Faria
Classes inheritance. How to ?
James, Your articles are very interesting, I´m studying them. I will translate them to spanish and send to your e-mail.
Classes inheritance. How to ?
[quote="EnricoMaria":2hofg2ae][quote="concentra":2hofg2ae]Where can I find a tutorial and/or documentation about how to create and inherit FWH classes ?[/quote:2hofg2ae] Best documentation is FWH source code. [/quote:2hofg2ae] I tried but could not figure out what is wrong with my code. I thought I needed to study a little if some docs are avaiable. [quote="EnricoMaria":2hofg2ae] [quote="concentra":2hofg2ae]I am triing to inherit a class from another because I need to add a method. I am getting an error that I don´t have if I use the original class. The object seems not ot be created at all... The code is something like this: Class CL2 from CL1 METHOD PrintCl() ENDCLASS METHOD PrintCl() class CL2 alert("CL2") return NIL[/quote:2hofg2ae] Can you build a little real (compilable) sample of the problem? [/quote:2hofg2ae] I am triing to add some methods to the SuperBrowse class without modifiing it, and so I tried to inherit it, creating a particular class. I will try to find what is wrong with the code with the help you gave me and if I can´t I will try to post complete code. [quote="EnricoMaria":2hofg2ae] [quote="concentra":2hofg2ae]Questions: Al the CL1 methods are avaiable in CL2 ?[/quote:2hofg2ae] Yes. [quote="concentra":2hofg2ae]Do I need a constructor/destructor method or the CL1 one is used ?[/quote:2hofg2ae] Yes, you need of a constructor. EMG[/quote:2hofg2ae] [[]] Maurício Faria
Classes inheritance. How to ?
Maurício, >Can I translate to Portuguese? Sure. Please send me a copy and I will put it up on my site. James
Classes inheritance. How to ?
José, >I will translate them to spanish and send to your e-mail. Great. I will put that version on my site too. James
Classes inheritance. How to ?
[quote="Gale FORd":3ksgky21]Don't forget to add: CLASSDATA lRegistered AS LOGICAL [/quote:3ksgky21] Bingo !!!!! Added this single line and my inherited class worked like a charm... Thanks Gale, but what the hell is "lRegistered" ? [[]] Maurício Faria
Classes inheritance. How to ?
It is a flag that allows a one-time registration of a control class. It is needed to get Windows aware of the new control. EMG
Classes inheritance. How to ?
[quote="EnricoMaria":2fjmxmot]It is a flag that allows a one-time registration of a control class. It is needed to get Windows aware of the new control. EMG[/quote:2fjmxmot] Ok, but could you tell me when I need it and when I do not ? [[]] Maurício Faria
Classes inheritance. How to ?
[quote="concentra":f321ppg5][quote="EnricoMaria":f321ppg5]It is a flag that allows a one-time registration of a control class. It is needed to get Windows aware of the new control. EMG[/quote:f321ppg5] Ok, but could you tell me when I need it and when I do not ? [[]] Maurício Faria[/quote:f321ppg5] If you are creating a temporary stand alone class from scratch and you will not inherit from it then it is not required If you plan on inheriting from your class or your class is inheriting from another, then you will need to add it.
Classes inheritance. How to ?
[quote="Gale FORd":2u6qcjwc]If you are creating a temporary stand alone class from scratch and you will not inherit from it then it is not required If you plan on inheriting from your class or your class is inheriting from another, then you will need to add it.[/quote:2u6qcjwc] No, you will only need it if you are going to make a control. Not all classes are controls. EMG
Classes inheritance. How to ?
Enrico, >No, you will only need it if you are going to make a control. And apparently you need it only sometimes when it is a control. For instance, the DBCombo class inherits from the TCombobox class but doesn't have lRegistered (and it works fine). Perhaps lRegistered should be added, but one wonders why it works without it. James
Classes inheritance. How to ?
Because you are inheriting from a standard Windows control and not creating a new custom control. EMG
Classes inheritance. How to ?
Enrico, >Because you are inheriting from a standard Windows control and not creating a new custom control. Thanks for clarifying that. James
Clausole When not run ok - Resolved!!!
I made this button on Ribbonbar because radio control is not transparent) @ 24, 400 ADD BUTTON oSay OF ::oGrPlanning BITMAP ".\bitmaps\bradio1.bmp" MOSTLEFT SIZE 65, 18 PROMPT "Filtro" ; ACTION ( oSelf:lFilter := ! oSelf:lFilter, ; oSay:SetFile( If( oSelf:lFilter, ".\bitmaps\bradio1.bmp", ".\bitmaps\bradio2.bmp" ) ) ) then I have a get @ 9,592 GET oNum1 VAR oSelf:nNumFrom SIZE 90,60 PIXEL OF ::oGrPlanning ; FONT oFontBig ; BITMAP FwDArrow() ; ACTION NIL ; [b:2k5zdwdm] WHEN oSelf:lFilter [/b:2k5zdwdm] when the oSelf_lFiler is F the get is allwasy active how I can resolve ?
Clausole When not run ok - Resolved!!!
lFilter is STATIC VARIABLE? .T. or .F.? To best assist you, always set a full example. You always put pieces of the program. Regards.
Clausole When not run ok - Resolved!!!
lfilter is a DATA of my class and init is false
Clausole When not run ok - Resolved!!!
And when you change lfilter to .T., What returns? [code=fw:3dyttsqj]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">Return</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">lFilter</span> <span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #B900B9;">// ??</span><br />&nbsp;</div>[/code:3dyttsqj] ? lFilter Regards.
Clausole When not run ok - Resolved!!!
return right only the get not respect the when clausole [img:1n03ox4i]https&#58;//i&#46;postimg&#46;cc/9XxwyYtS/NN&#46;jpg[/img:1n03ox4i] I tried with btnbmp @ 24, 400 BTNBMP oSay PROMPT { || If( oSelf:lFilter, "Filtro", "Tutti" ) } ; RESOURCE aImagesGiorno[ 1 ] ; SIZE 50,60 PIXEL OF ::oGrPlanning FLAT ; ACTION ( oSelf:lFilter := !oSelf:lFilter, ; ::SetImages( If(oSelf:lFilter, aImagesGiorno[ 1 ], aImagesGiorno[ 2 ] ) ),; msginfo(oSelf:lFilter) ) @ 9,592 GET oNum1 VAR oSelf:nNumFrom SIZE 110,40 PIXEL OF ::oGrPlanning ; FONT oFontBig ; BITMAP FwDArrow() ; ACTION nil,; oNum1:REFRESH() ) when ::lFilter //or when oself:lfilter [img:1n03ox4i]https&#58;//i&#46;postimg&#46;cc/Ghy39FMv/NN&#46;png[/img:1n03ox4i] the btnbmp run ok and change the value od lFilter then the get not respect the clausole WHEN oself:lfilter or when ::lFilter because the get must run only when lfilter is true I tried also with @ 24, 400 BTNBMP oSay PROMPT { || If( oSelf:lFilter, "Filtro", "Tutti" ) } ; RESOURCE aImagesGiorno[ 1 ] ; SIZE 50,60 PIXEL OF ::oGrPlanning FLAT ; ACTION ( oSelf:lFilter := !oSelf:lFilter, ; ::SetImages( If(oSelf:lFilter, aImagesGiorno[ 1 ], aImagesGiorno[ 2 ] ) ),; oNum1:refresh(),oNum2:refresh() ) but oNum1 and oNum2 are not disable when the lFilter is False
Clausole When not run ok - Resolved!!!
You need to use oDlg:AEvalWhen()
Clausole When not run ok - Resolved!!!
Already in the afternoon I had solved when Enrico reminded me that I had to use AEvalWhen (), anyway thanks anyway. ia another time I had the same problem but unfortunately a little for the age a little for the heat I have not recirculated myself
Clausula ""ON CHANGE"" en xbrowse
Buenas noches compañeros del foro, espero puedan ayudarme, estoy usan un xbrowse y necesito usar la clausula "ON CHANGE" (o la que sea equivalente) para mostrar algunos datos dependiendo del registro seleccionado de la base de datos. [code=fw:36pi715u]<div class="fw" id="{CB}" style="font-family: monospace;"><br />      <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">resource</span> <span style="color: #ff0000;">"dlgverdb9"</span> <span style="color: #0000ff;">of</span> oVentprinc <span style="color: #0000ff;">title</span> <span style="color: #ff0000;">"Llamadas"</span> <span style="color: #0000ff;">font</span> oFont1g<br />      <span style="color: #0000ff;">redefine</span> <span style="color: #0000ff;">say</span> <span style="color: #0000ff;">prompt</span><span style="color: #ff0000;">"Lista de llamadas realizadas, selecciona la llamada a consultar"</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">1</span> <span style="color: #0000ff;">of</span> oDlg<br />      <span style="color: #0000ff;">define</span> <span style="color: #0000ff;">font</span> oFont1  <span style="color: #0000ff;">name</span> <span style="color: #ff0000;">"TIMES NEW ROMAN"</span> <span style="color: #0000ff;">size</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-12</span> bold<br />      oBrw := TXBrowse<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> oDlg <span style="color: #000000;">&#41;</span><br />      oBrw:<span style="color: #000000;">nMarqueeStyle</span> := MARQSTYLE_HIGHLROW <span style="color: #B900B9;">//barra selectora</span><br />      oBrw:<span style="color: #000000;">nColDividerStyle</span> := LINESTYLE_INSET<br />      oBrw:<span style="color: #000000;">nRowDividerStyle</span> := LINESTYLE_INSET<br />      oBrw:<span style="color: #000000;">lColDividerComplete</span> := .t.       <span style="color: #B900B9;">//HEADERS Y FOOTERS</span><br />      oBrw:<span style="color: #000000;">nHeaderHeight</span> := <span style="color: #000000;">22</span> <span style="color: #B900B9;">//Altura cabeceras de col</span><br />      oBrw:<span style="color: #000000;">lRecordSelector</span> := .t. <span style="color: #B900B9;">//poner o no, COL de la flechita de la izq</span><br />      oBrw:<span style="color: #000000;">bClrHeader</span> := <span style="color: #000000;">&#123;</span>|| <span style="color: #000000;">&#123;</span> nRGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">152</span>, <span style="color: #000000;">251</span>, <span style="color: #000000;">152</span><span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">47</span>, <span style="color: #000000;">79</span>, <span style="color: #000000;">79</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><span style="color: #B900B9;">//{|| { nRGB(140, 0, 0), nRGB(229,0,0) } } // VERDECITO</span><br />      oBrw:<span style="color: #000000;">bClrFooter</span> := oBrw:<span style="color: #000000;">bClrHeader</span><br />      oBrw:<span style="color: #000000;">bClrStd</span> := <span style="color: #000000;">&#123;</span>|| <span style="color: #000000;">&#123;</span> nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">255</span>,<span style="color: #000000;">248</span>,<span style="color: #000000;">220</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #B900B9;">// colores para lineas normales</span><br />      oBrw:<span style="color: #000000;">bClrSel</span> := <span style="color: #000000;">&#123;</span>|| <span style="color: #000000;">&#123;</span> nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>,<span style="color: #000000;">255</span><span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">241</span>,<span style="color: #000000;">222</span>,<span style="color: #000000;">088</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #B900B9;">// para barra de linea selecc cuando el control no tiene el foco</span><br />      oBrw:<span style="color: #000000;">bClrSelFocus</span> := <span style="color: #000000;">&#123;</span>|| <span style="color: #000000;">&#123;</span> nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">248</span>,<span style="color: #000000;">195</span>, <span style="color: #000000;">34</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #B900B9;">// para barra de linea selecc cuando el control tiene el foco</span><br />      oBrw:<span style="color: #000000;">nRowHeight</span> := <span style="color: #000000;">19</span><br /><br />      oCol = oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      oCol:<span style="color: #000000;">bStrData</span> = <span style="color: #000000;">&#123;</span> || market->idmarket <span style="color: #000000;">&#125;</span><br />      oCol:<span style="color: #000000;">nDataStrAlign</span> := <span style="color: #000000;">0</span><br />      oCol:<span style="color: #000000;">cHeader</span> = <span style="color: #ff0000;">"ID de llamada"</span><br />      oCol:<span style="color: #000000;">nWidth</span> = <span style="color: #000000;">110</span><br />      oCol:<span style="color: #000000;">bLClickHeader</span>:= <span style="color: #000000;">&#123;</span>|| DbSetorder<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span>,oBrw:<span style="color: #000000;">Gotop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,letbus:=<span style="color: #ff0000;">"ID de llamada"</span>,odlg:<span style="color: #0000ff;">update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,nord:=<span style="color: #000000;">1</span><span style="color: #000000;">&#125;</span><br />      oCol:<span style="color: #000000;">oHeaderFont</span> := oFont1<br />      oCol:<span style="color: #000000;">bClrHeader</span> := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span>  <span style="color: #000000;">65535</span>, nRGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">47</span>, <span style="color: #000000;">79</span>, <span style="color: #000000;">79</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br />..... <span style="color: #000000;">&#40;</span>Ms columnas<span style="color: #000000;">&#41;</span><br /><br />      oBrw:<span style="color: #000000;">SetRDD</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />      oBrw:<span style="color: #000000;">CreatefromResource</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br /><br />      <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">say</span> oSay1 <span style="color: #0000ff;">prompt</span> <span style="color: #ff0000;">"Buscar en "</span>+letbus <span style="color: #0000ff;">ID</span> <span style="color: #000000;">5</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">UpDate</span><br />      <span style="color: #0000ff;">Redefine</span> <span style="color: #0000ff;">get</span> Oget1 <span style="color: #0000ff;">VAR</span> cBusca <span style="color: #0000ff;">ID</span> <span style="color: #000000;">4</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@!"</span><br /><br />      <span style="color: #0000ff;">redefine</span> <span style="color: #0000ff;">button</span> oBtn1 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">6</span> <span style="color: #0000ff;">of</span> oDlg <span style="color: #0000ff;">action</span> <span style="color: #000000;">&#40;</span>busyfil<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">update</span><br />      <span style="color: #0000ff;">redefine</span> <span style="color: #0000ff;">button</span> oBtn2 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">7</span> <span style="color: #0000ff;">of</span> oDlg <span style="color: #0000ff;">action</span> sinfil<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />      <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">Button</span> oBtn3 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">2</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">prompt</span> <span style="color: #ff0000;">"Revisar tareas"</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> revmar:=idmarket,revtar<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #000000;">end</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">Button</span> oBtn4 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">3</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">prompt</span> <span style="color: #ff0000;">"Registrar ventas"</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> revmar:=idmarket,regven<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oDlg:<span style="color: #000000;">end</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #0000ff;">redefine</span> <span style="color: #0000ff;">button</span> oBtn5 <span style="color: #0000ff;">ID</span> <span style="color: #000000;">4</span> <span style="color: #0000ff;">of</span> oDlg <span style="color: #0000ff;">action</span> <span style="color: #000000;">&#40;</span>oDlg:<span style="color: #000000;">end</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, ciccc:=<span style="color: #ff0000;">"N"</span><span style="color: #000000;">&#41;</span><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;">enddo</span><br />   oFont1:<span style="color: #000000;">end</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span></div>[/code:36pi715u] Como decía, necesito desplegar información en el diálogo, dependiendo del registro seleccionado, misma que cambiara a cada cambio en el No. de registro. Muchas gracias
Clausula ""ON CHANGE"" en xbrowse
Mario: No se si esto te valdrá, pero tengo un xbrowse en el que al desplazar el cursor por los registros hace que un objeto SAY me vaya mostrando la información del registro algo así [code=fw:12xbyajl]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp; <span style="color: #0000ff;">on</span> <span style="color: #0000ff;">change</span> <span style="color: #000000;">&#123;</span>osay1:<span style="color: #000000;">settext</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Dorsal: "</span>+alltrim<span style="color: #000000;">&#40;</span>carrera<span style="color: #000000;">&#91;</span>olbx:<span style="color: #000000;">narrayat</span>,<span style="color: #000000;">11</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" &nbsp;-- &nbsp;"</span>+alltrim<span style="color: #000000;">&#40;</span>carrera<span style="color: #000000;">&#91;</span>olbx:<span style="color: #000000;">narrayat</span>,<span style="color: #000000;">12</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,osay1:<span style="color: #000000;">hide</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,osay1:<span style="color: #000000;">show</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br />&nbsp;</div>[/code:12xbyajl] en este caso el xbrowse me muestra una matriz (array) llamada carrera, y objeto say que modifica es osay1, y el objeto xbrowse es olbx. Un saludo
Clausula ""ON CHANGE"" en xbrowse
Mario Por si es de tu interés, xBrowse incorpara el bloque [code=fw:203wskfm]<div class="fw" id="{CB}" style="font-family: monospace;"> oBrw:<span style="color: #000000;">bToolTip</span>:= <span style="color: #000000;">&#123;</span>|| ShowToolTip<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />...<br />...<br /><br />PROCEDURE ShowToolTip<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span><br /><br />   oBrw:<span style="color: #000000;">oCol3</span>:<span style="color: #000000;">cTooltip</span>:= <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span> !nCondicion == <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"Tu mensaje"</span>, <span style="color: #ff0000;">"mensaje alternativo"</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">// Fin</span></div>[/code:203wskfm] Saludos
Clausula ""ON CHANGE"" en xbrowse
Muchas gracias por sus respuestas, tengo estas dudas: [b:51dchlzd]Groiss[/b:51dchlzd], honestamente no se donde insertar la clausa "on chage", en mi xbrowse, podrías indicarme donde? [b:51dchlzd]Mario G.[/b:51dchlzd] Estoy usando la versión 2.6 de Fivewin y me aparece el error de que no reconoce la sentencia tooltip, seguramente es por mi versión de FWH Nuevamente muchas gracias.
Clausula ""ON CHANGE"" en xbrowse
Mario "on change" es una clausula, parte, de: #xcommand @ <nRow>, <nCol> [ COLUMN ] XBROWSE <oBrw> ; [ [ FIELDS ] <Flds,...>] ; [ <dsrc: ALIAS, ARRAY, RECSET, RECORDSET, OBJECT, DATASOURCE> <uDataSrc> ] ; [ <sizes:FIELDSIZES, SIZES, COLSIZES> <aColSizes,...> ] ; [ <head:HEAD,HEADER,HEADERS> <aHeaders,...> ] ; [ <pic: PICS, PICTURE, PICTURES> <aPics,...> ] ; [ <cols: COLS, COLUMNS> <aCols,...> ] ; [ <idx: SORT,ORDERS> <aSort,...> ] ; [ JUSTIFY <aJust,...> ] ; [ SIZE <nWidth>, <nHeigth> ] ; [ ID <nID> ] ; [ <dlg:OF,DIALOG> <oWnd> ] ; [ SELECT <cField> FOR <uValue1> [ TO <uValue2> ] ] ; [b:1r8g1nwg][ <change: ON CHANGE, ON CLICK> <uChange> ] ;[/b:1r8g1nwg] ... Vos deberías usar oBrw:bChange:= {|| ... } (porque no declaras el comando, sino que llamas directamente a la clase) En cuanto a la version. Creo que la version libre actual es superior a la que usas. La podes bajar de la pagina de Fivetech Saludos
Clausula ""ON CHANGE"" en xbrowse
Mario, mil gracias por la orientación, funcionó de maravilla. Hace un tiempo, cuando liberaron la versión 6.12 (creo) de Fivewin la bajé e instale, pero me empezó a dar mil problemas con funciones que no existían en esa versión o que habían cambiado de nombre, bajé las versiones de BCC y Harbour para esa versión, pero me seguía dando miles de problemas y decidi regresarme a usar la versión con la que originalmente había generado mis programas. Muchas, muchas gracias nuevamente.
Clausula Font en los button de recursos
Creo que sería facil implementar la clausula font en los botones de recursos ya que el btn:setfont( ofont) funciona perfectamente . Saludso.
Clausula Pixel
No se si me he perdido algo con la clausula PIXEL en los controles, pero hay algo que se me escapa, siempre he hecho mis aplicaciones con recursos. Pero ahora estoy haciendo una aplicación que necesito que el tamaño y colocación de los controles dentro de un dialogo aparezcan a una determinada distancia dependiendo de la resolución de la pantalla. Para resumir, el problema que estoy teniendo, por ejemplo, es el siguiente: [code=fw:qhvzph3k]<div class="fw" id="{CB}" style="font-family: monospace;"><br />nresv := GetDeviceCaps<span style="color: #000000;">&#40;</span> hDC, VERTRES <span style="color: #000000;">&#41;</span><br />nresh := GetDeviceCaps<span style="color: #000000;">&#40;</span> hDC, HORZRES <span style="color: #000000;">&#41;</span><br />n_ini_v_fold := <span style="color: #000000;">100</span>  <span style="color: #B900B9;">// el valor es lo de menos, en realidad es un % de la resolución de la pantalla</span><br />n_ini_h_fold := <span style="color: #000000;">20</span><br />n_fin_h_fold := <span style="color: #000000;">300</span><br />n_fin_v_fold := <span style="color: #000000;">250</span><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlgNotas <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">TO</span> nresv, nresh<br />....<br />@ n_ini_v_fold, n_ini_h_fold FOLDEREX oFolder <span style="color: #0000ff;">PROMPT</span> afolders <span style="color: #0000ff;">DIALOGS</span> aDialogs <span style="color: #0000ff;">OF</span> oDlgNotas <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">SIZE</span> n_fin_h_fold, n_fin_v_fold <span style="color: #0000ff;">FONT</span> oFontn<br />.... <br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlgNotas <br />...<br /> </div>[/code:qhvzph3k] Aqui me pone el Folder en una determinada posición, pero por motivos de que las pestañas del folder cambian al seleccionar un elemento de un combobox, tengo que destruirlo y volver a declararlo en otra función: [code=fw:qhvzph3k]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">function</span> ponfolder<span style="color: #000000;">&#40;</span>ccombo<span style="color: #000000;">&#41;</span><br />.....<br />@ n_ini_v_fold, n_ini_h_fold FOLDEREX oFolder <span style="color: #0000ff;">PROMPT</span> afolders <span style="color: #0000ff;">DIALOGS</span> aDialogs <span style="color: #0000ff;">OF</span> oDlgNotas <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">SIZE</span> n_fin_h_fold, n_fin_v_fold <span style="color: #0000ff;">FONT</span> oFontn<br />....<br /><span style="color: #00C800;">return</span><br /> </div>[/code:qhvzph3k] Y aquí está el problema, en ningún momento se cambian los valores de las variables n_ini_v_fold.... Sin embargo, me muestra el folder en otra posición totalmente distinta, es como si los valores de las variables se hubieran reducido a menos de la mitad, cuando no es así (Comprobado mostrando msgalert(str(n_ini_v_fold) justo delante de la declaración del folder. Eso mismo me pasa con todos los controles (xbrowse, btnbmp, comobobox. etc.), si están en la función donde se declara el dialogo, los muestra en la posicicón correcta, si se declaran en otra funcion, los muestra en otra posición. Incluso el tamaño de los botones y las distancias de un control a otro, varian. Me estoy volviendo loco. ¿Alguna sugerencia? Saludos
Clausula Pixel
Sebastian, añade estas clausulas y prueba [code=fw:15wo9sxy]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlgNotas <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">TO</span> nresv, nresh <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL<br />&nbsp;</div>[/code:15wo9sxy]
Clausula Pixel
Jo..r Cristobal, gracias, funciona a la perfección, no tenia ni idea de la clausula TRUEPIXEL para los dialogos, llevo cuatro días peleandome con esto. Saludos
Clausula Pixel
Buén dia. Master Navarro, no uso Código, podrias porfa, explicar que hace: [code=fw:vfa36j15]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp;<span style="color: #0000ff;">PIXEL</span> TRUEPIXEL<br />&nbsp;</div>[/code:vfa36j15] Gracias. Regards, saludos.
Clausula Pixel
Estimado Joao Fijate en el siguiente ejemplo: [code=fw:3bxxr4fi]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Fivewin.ch"</span><br /><br /><span style="color: #00C800;">Function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;Pixels<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;TruePixels<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><span style="color: #00C800;">Function</span> Pixels<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oGet<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cVar &nbsp;:= Space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">30</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oFont<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Calibri"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">-16</span> &nbsp; <br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">501</span>, <span style="color: #000000;">701</span> <span style="color: #0000ff;">PIXEL</span><br />&nbsp; &nbsp;oDlg:<span style="color: #000000;">lHelpIcon</span> := .F.<br /><br />&nbsp; &nbsp; &nbsp; @ <span style="color: #000000;">10</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">GET</span> oGet <span style="color: #0000ff;">VAR</span> cVar <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>, <span style="color: #000000;">24</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">PIXEL</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg<br />&nbsp; &nbsp;<span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">Function</span> TruePixels<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oGet<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cVar &nbsp;:= Space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">30</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oFont<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"Calibri"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">-16</span> &nbsp; <br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">501</span>, <span style="color: #000000;">701</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL<br />&nbsp; &nbsp;oDlg:<span style="color: #000000;">lHelpIcon</span> := .F.<br /><br />&nbsp; &nbsp; &nbsp; @ <span style="color: #000000;">10</span>, <span style="color: #000000;">10</span> <span style="color: #0000ff;">GET</span> oGet <span style="color: #0000ff;">VAR</span> cVar <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">200</span>, <span style="color: #000000;">24</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">PIXEL</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg<br />&nbsp; &nbsp;<span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:3bxxr4fi] Las diferencias entre programar usando un dialog o una ventana como contenedor es que las unidades por defecto que toman los dialogs respecto a las windows son el doble, aunque definas la clausula PIXEL en la definición del Dialog ( esta característica no es un tema de Fivewin, sino del propio Windows que lo tiene así establecido ). Ante esa circunstancia y para que no haya diferencias de apariencia entre utilizar windows o dialog como contenedores de nuestros controles, se implementó la claúsula TRUEPIXEL en los dialog, para que Fw internamente divida por dos las coordenadas y tamaños que definimos en los controles, y aparezcan con las mismas dimensiones que si usáramos una window. En resumen, la claúsula TRUEPIXEL se define en los dialog para ser aplicada a las coordenadas y dimensiones de nuestros controles.
Clausula Pixel
Perfecto Master. Con TRUEPIXEL, és bién mejor para trabajar. Gracias, saludos.
Clausula Valid en un GET simple
Porque no trabaja la clausula valid de un Get el código es el siguiente: local l_oGet private p_cArti :=space(14) private p_pDlg DEFINE DIALOG p_oDlg RESOURCE 'DCON_PRE1' REDEFINE GET l_oGet VAR p_cArti ID 101 OF p_oDlg PICTURE '@!@k' VALID(Chk_Pre1()) ACTIVATE DIALOG p_oDlg CENTER Close Databases Return Nil Static Function Chk_Pre1() ? '1' Return(.t.) Guillermo Guevara C. Clp5.2e FW2.3b Blk3.3
Clausula Valid en un GET simple
Guillermo, Necesitas tener un control más en el diálogo para que se produzca pérdida de foco hacia ese otro control
Clausula Valid en un GET simple
Disculpa mi ignorancia. Ok de acuerdo con tu recomendación, entonces voy a programar un diálogo definiendo controles que no ucupo, ¿es una limitante de FW ó que sucede?, en nuestro viejo Clipper no teniamos estas limitántes. Ejemplo específico de este caso, estoy tratando de construir un verificador de precios para que el usuario utilice un scanner (Lector de código de barras) lea el GET (unico control en este diálogo) y a través de la clausula VALID con otro diálogo despliegue el precio de venta por unos segundos y que regrese al GET original listo para otra lectura. Guillermo Guevara C.
Clausula Valid en un GET simple
Guillermo: No, no hay esa limitante, prueba cambiando la línea así: REDEFINE GET l_oGet VAR p_cArti ID 101 OF p_oDlg PICTURE '@!@k' VALID Chk_Pre1() Salaudos
Clausula Valid en un GET simple
Guillermo, Usa un GET y un botón "Aceptar"
Clausula Valid en un GET simple
Armando: Tu sugerencia es que quite un par de parentesis de la clausula VALID, ya lo hice, pero no funcionó, sigue igual, el programa está atascado en el GET. Antonio: Imaginate en una tienda un verificador de precios donde comunmente, el cliente solo acerca el producto al lector de código de barras y en la pantalla se muestra el precio del artículo. Con tu sugerencia de definir un botón, imaginate tendría que ponerle un ratón con un "Mousepad" o un teclado con una base (Mesa ó algo así) lo cual resultaría, totalmente inoperante. Posiblemente estoy buscando la solución al problema incorrectamente, si alguién en el foro tiene alguna idea para solucionar está cosa tan simple por favor transmitanmela. Realmente este tipo de problemas son los que me han detenido en la decisión de comprar las herramientas requeridas para cambiar definitivamente a este ambiente. Saludos Guillermo
Clausula Valid en un GET simple
Guillermo: Podrías especificar un poco más cual es el problema ?, cuando dices se queda atascado significa que no ves el resultado del código ?: ? '1' Si entiendo bien, la solución es que utilices un SAY en el mismo dialogo, despues del GET, para mostrar el precio de venta, así no tendrías que obligar al usuario a usar ningun botón. Saludos
Clausula Valid en un GET simple
Efectivamente lo que requiero es que se muestre el ? '1' Que es la prueba de que funcionó la clausula VALID en el GET Ya había comprobado que poniendo el SAY en mismo control se hace la perdida de foco que me indicaba Antonio. Sin embargo estoy intrigado porque algo que funciona tan bién en nuestro viejo Clipper no puede funcionar en FW, cuando menos hasta ahora. Agradezco tus atenciones Guillermo
Clausula Valid en un GET simple
Guillermo, > Sin embargo estoy intrigado porque algo que funciona tan bién en nuestro viejo Clipper no puede funcionar en FW, cuando menos hasta ahora. > Windows es un entorno muy distinto en su funcionamiento al antiguo MsDos. FiveWin intenta en la medida de lo posible proporcionar comportamientos muy similares, pero en ocasiones hay que seguir las reglas que impone Windows
Clausula Valid en un GET simple
Muchas Gracias por todos los consejos y tu apoyo, estoy de acuerdo hay que cambiar la forma estructurada de pensar, a pensar en función de la programación orientada a objetos. Lo consideraré para mi verificador de precios Guillermo
Clausula Valid en un GET simple
La solucion es simple pon otro Get pero que su variable sea vacio local l_oGet ,[color=red:ci9r1vu1]xClav:=''[/color:ci9r1vu1] private p_cArti :=space(14) private p_pDlg DEFINE DIALOG p_oDlg RESOURCE 'DCON_PRE1' REDEFINE GET l_oGet VAR p_cArti ID 101 OF p_oDlg PICTURE '@!@k' VALID(Chk_Pre1()) [color=red:ci9r1vu1]@ 02,08 Get xClav Size 1,1[/color:ci9r1vu1] ACTIVATE DIALOG p_oDlg CENTER Close Databases Return Nil Static Function Chk_Pre1() ? '1' Return(.t.) [code][/code]
Clausula Valid en un GET simple
YO HE HECHO ESO CON CODIGO DE BARRAS Y SOLO PONGO UN BOTON "SALIR", NO ES PARA QUE EL USUARIO LE DE CON UN MOUSE SALIR SINO COMO DICE ANTONIO PARA QUE HAYA AL MENOS 2 CONTROLES, SI TE DA PIEDRA PONERLO PONLO HIDE Y YA
Clausulas TSay
Hola, Es posible q no funcionen correctamente las clausulas box, raised y shadow en la clase TSay ? [code:2gknr8b5]#include "FiveWin&#46;ch" function Main&#40;&#41; local oDlg, oSay, oCursor DEFINE CURSOR oCursor HAND DEFINE DIALOG oDlg FROM 0,0 TO 20,40 @ 1, 2 SAY oSay PROMPT "Left" SIZE 100, 20 COLOR CLR_RED @ 2, 2 SAY oSay PROMPT "Right" RIGHT SIZE 100, 20 COLOR CLR_RED @ 3, 2 SAY oSay PROMPT "Center" CENTER SIZE 100, 20 COLOR CLR_RED @ 4, 2 SAY oSay PROMPT "Box" BOX SIZE 100, 20 COLOR CLR_RED @ 5, 2 SAY oSay PROMPT "Raised" RAISED SIZE 100, 20 COLOR CLR_RED @ 6, 2 SAY oSay PROMPT "Shadow" SHADOW SIZE 100, 20 COLOR CLR_RED ACTIVATE DIALOG oDlg CENTERED return nil[/code:2gknr8b5]
Clausulas del SAY
Hola a todos: Estoy probando cosas nuevas y me he encontrado con este problema: He puesto la clausula SHADED en un SAY en vez de BORDER y me aparece así: [img:atcrsokw]http&#58;//www&#46;colthop&#46;es/ima01&#46;jpg[/img:atcrsokw] Cuando lo pongo con BORDER sale así: [img:atcrsokw]http&#58;//www&#46;colthop&#46;es/ima02&#46;jpg[/img:atcrsokw] Alguien sabe porque y como se puede solucionar. El código es: [code=fw:atcrsokw]<div class="fw" id="{CB}" style="font-family: monospace;"><br />@ <span style="color: #000000;">10</span>*ProporV, <span style="color: #000000;">10</span>*ProporH <span style="color: #0000ff;">SAY</span> tDlg001 <span style="color: #0000ff;">VAR</span> LocaText<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span>,<span style="color: #000000;">175</span><span style="color: #000000;">&#41;</span>      <span style="color: #0000ff;">OF</span> wGestClie1 <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">COLOR</span> escri1, fondo1 <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">130</span>*ProporH,xProPorV*ProPorV<br />@ <span style="color: #000000;">10</span>*ProporV,<span style="color: #000000;">410</span>*ProporH <span style="color: #0000ff;">SAY</span> tDlg002 <span style="color: #0000ff;">VAR</span> LocaText<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">90</span><span style="color: #000000;">&#41;</span>      <span style="color: #0000ff;">OF</span> wGestClie1 <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">COLOR</span> escri1, fondo1 <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">130</span>*ProporH,xProPorV*ProPorV<br />@ <span style="color: #000000;">10</span>*ProporV,<span style="color: #000000;">110</span>*ProporH <span style="color: #0000ff;">SAY</span> vDlg001 <span style="color: #0000ff;">VAR</span> <span style="color: #ff0000;">" "</span> + codigo   <span style="color: #0000ff;">OF</span> wGestClie1 <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">COLOR</span> escri3, fondo3 <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">SIZE</span>  <span style="color: #000000;">78</span>*ProporH,xProPorV*ProPorV   SHADED<br />@ <span style="color: #000000;">10</span>*ProporV,<span style="color: #000000;">530</span>*ProporH <span style="color: #0000ff;">SAY</span> vDlg041 <span style="color: #0000ff;">VAR</span> <span style="color: #ff0000;">" "</span> + clavecif <span style="color: #0000ff;">OF</span> wGestClie1 <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">COLOR</span> escri3, fondo3 <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">SIZE</span>  <span style="color: #000000;">14</span>*ProporH,xProPorV*ProPorV   BORDER<br /> </div>[/code:atcrsokw] Gracias y un saludo Carlos
Clausulas del SAY
Carlos, En el editor de recursos prueba ambas claúsulas a ver si se ven a la vez
Clausulas del SAY
Hola Antonio: Como se cambia en el editor de recursos (ya sabes soy mu torpe). No obstante yo h probado a poner las dos a la vez SHADED BORDER y sale igual. Un saludo Carlos
Clausulas del SAY
Carlos, Es esta la apariencia que deseas conseguir ? [img:18mu6ljg]https&#58;//bitbucket&#46;org/fivetech/screenshots/downloads/saystyle&#46;JPG[/img:18mu6ljg]
Clausulas del SAY
Hola Antonio: Realmente estaba probando para ver como quedaba ya que nunca lo había probado y no se como queda al ver SHADED imagine una cosa parecida a una caja con sombra pero es lo que no he conseguido ver como queda. Si me haces el favor podrías mandarme una imagen con las tres posibilidades SHADED, RAISED y BOX. Por lo que veo en la imagen que me mandas parece mas RAISED que SHADED. Un saludo Carlos
Clausulas del SAY
Carlos, Que editor de recursos usas ? Pruébalo desde tu editor de recursos
Clausulas del SAY
Hola Antonio: No utilizo editor de recursos. Dime uno para probar. Un saludo Carlos
Clausulas del SAY
Carlos, Puedes usar PellesC. Yo suelo usar ResEdit.
Clausulas del SAY
Hola Antonio: Vi en tu post que usabas el ResEdit y me lo bajé para intentar usarlo lo instale y todo casi bien ya que cada vez que intentaba crear un dialogo para hacer las pruebas me daba un error y no me dejaba seguir. Probaré con el PellesC No obstante la instrucción que pongo es correcta o no, ya que simplemente es para ver como queda. Lo que pasa que si me gusta como queda y quiero usarla me encontraría con el problema. Un saludo Carlos
Clausulas del SAY
Carlos, Estos son los estilos que usa la Clase TSay: [code=fw:139yd18h]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; ::<span style="color: #000000;">nStyle</span> &nbsp; &nbsp;= nOR<span style="color: #000000;">&#40;</span> WS_CHILD, WS_VISIBLE,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lDesign, nOr<span style="color: #000000;">&#40;</span> WS_CLIPSIBLINGS, WS_TABSTOP <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lCentered, SS_CENTER, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lRight, SS_RIGHT, SS_LEFT <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lBorder, WS_BORDER, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lShaded, SS_BLACKRECT, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lBox, &nbsp; &nbsp;SS_GRAYRECT, &nbsp;<span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lRaised, SS_WHITERECT, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span></div>[/code:139yd18h] En mis pruebas (la imagen que te puse), los estilos son otros. Por eso no te aparece como quieres. Y de ahi que te preguntase que efecto es el que quieres, antes de ponernos a modificar la clase.
Clausulas del SAY
Hola Antonio: Anteriormente te puse dos SAY uno debajo del otro, primero con el SHADED y después sin ninguno : [img:h4d583ue]http&#58;//www&#46;colthop&#46;es/ima01&#46;jpg[/img:h4d583ue] [img:h4d583ue]http&#58;//www&#46;colthop&#46;es/ima02&#46;jpg[/img:h4d583ue] Sería hacer el SAY mas parecido al GET: [img:h4d583ue]http&#58;//www&#46;colthop&#46;es/ima03&#46;jpg[/img:h4d583ue] Y me pareció que poniendo SHADED hacia el efecto que hace el GET de una sombra. Pero cuando lo puse quitaba los colores y no ponía el dato lo dejaba todo en gris. Un saludo Carlos
Clausulas del SAY
Carlos, Podemos modificar la clase según necesitemos. Por eso te decía de que probases los diferentes estilos desde el editor de recursos, y una vez esté como tu quieras, que me indicases que estilos son los que has usado.
Clausulas del SAY
Hola Antonio: No consigo abrir el dialogo en el ResEdit podrías enviarme tu test.rc a mi email (<!-- e --><a href="mailto:carlos@colthop.es">carlos@colthop.es</a><!-- e -->) para abrirlo aquí y poder decirte lo que me pides. Un saludo Carlos
Clausulas del SAY
Carlos, test.rc [code=fw:1sl3vm92]<div class="fw" id="{CB}" style="font-family: monospace;">LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL<br />IDD_DIALOG1 <span style="color: #0000ff;">DIALOG</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">231</span>, <span style="color: #000000;">134</span><br /><span style="color: #0000ff;">STYLE</span> DS_3DLOOK | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_CAPTION | WS_VISIBLE | WS_POPUP | WS_SYSMENU<br />CAPTION <span style="color: #ff0000;">"Dialog"</span><br /><span style="color: #0000ff;">FONT</span> <span style="color: #000000;">8</span>, <span style="color: #ff0000;">"Ms Shell Dlg"</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; &nbsp; LTEXT &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"Static"</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">31</span>, <span style="color: #000000;">39</span>, <span style="color: #000000;">128</span>, <span style="color: #000000;">22</span>, WS_BORDER | SS_LEFT, WS_EX_STATICEDGE<br /><span style="color: #000000;">&#125;</span><br />&nbsp;</div>[/code:1sl3vm92] WS_BORDER | SS_LEFT, WS_EX_STATICEDGE
Clausulas del SAY
Hola Antonio: He estado mirando esto y sobre lo que tu me mandaste cree otro SAY (con el Pelles C ya que el ResEdit no me dejaba) y después de trastear sería casi como el que tu has realizado lo que cambia es que no tiene borde. [code=fw:3d6b7hnc]<div class="fw" id="{CB}" style="font-family: monospace;"><br />LANGUAGE LANG_NEUTRAL,SUBLANG_NEUTRAL<br />IDD_DIALOG1 <span style="color: #0000ff;">DIALOG</span> DISCARDABLE <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">231</span>, <span style="color: #000000;">134</span><br /><span style="color: #0000ff;">STYLE</span> WS_POPUP|DS_MODALFRAME|DS_3DLOOK|DS_CENTER|WS_CAPTION|WS_SYSMENU|WS_VISIBLE|0x00000008<br />CAPTION <span style="color: #ff0000;">"Dialog"</span><br /><span style="color: #0000ff;">FONT</span> <span style="color: #000000;">8</span>, <span style="color: #ff0000;">"Ms Shell Dlg"</span><br /><span style="color: #000000;">&#123;</span><br />&nbsp; CONTROL <span style="color: #ff0000;">"Static"</span>, <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"Static"</span>, WS_BORDER|WS_GROUP, <span style="color: #000000;">40</span>, <span style="color: #000000;">8</span>, <span style="color: #000000;">128</span>, <span style="color: #000000;">22</span>, WS_EX_STATICEDGE<br />&nbsp; CONTROL <span style="color: #ff0000;">"Static"</span>, <span style="color: #000000;">4001</span>, <span style="color: #ff0000;">"Static"</span>, WS_GROUP, <span style="color: #000000;">40</span>, <span style="color: #000000;">48</span>, <span style="color: #000000;">128</span>, <span style="color: #000000;">22</span>, WS_EX_STATICEDGE<br /><span style="color: #000000;">&#125;</span><br />&nbsp;</div>[/code:3d6b7hnc] Ahora me dirás como puedo hacer para poder poner ese estilo en todo mis SAY, que yo no se. Un saludo Carlos
Clausulas del SAY
Has probado? [code=fw:2klk7ck8]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oSay:<span style="color: #000000;">nStyle</span> := nOr<span style="color: #000000;">&#40;</span> WS_POPUP|DS_MODALFRAME|DS_3DLOOK|DS_CENTER|WS_CAPTION|WS_SYSMENU|WS_VISIBLE|0x00000008 <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:2klk7ck8]
Clausulas del SAY
Hola Cristóbal: Gracias por tu interés. No lo he probado hasta ahora, pero cuando la he puesto en unos SAY para ver que hacia me da un Syntax Error at "|" cuando pongo mas de dos parámetros y cando pongo solo uno y me compila me da el error de "No existe la variable" con "DS_3DLOOK", "DS_CENTER" y "WS_VISIBLE" y con el resto no encuentro variación con solo BORDER o CON SHADED. Me podrías indicar que hace esta instrucción para poder ver un SAY con SHADED. Gracias de nuevo Un saludo Carlos
Clausulas del SAY
Carlos, lo quieres hacer con REDEFINE por .RC o con codigo? Esas definiciones estan creo recordar en windows.h
Clausulas del SAY
Hola Cristóbal: Lo quiero realizar por código y cuando incluyo el Windows.h con: #INCLUDE "Windows.h" Me sale mas errores en la línea 30 y la 174 de este. Este archivo es del BCC582 o de otro. Un saludo Carlos
Clausulas del SAY
Carlos, Modifica asi la Clase TSay: #define WS_EX_STATICEDGE 0x00020000 [code=fw:2c8686zf]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; ::<span style="color: #000000;">nStyle</span> &nbsp; &nbsp;= nOR<span style="color: #000000;">&#40;</span> WS_CHILD, WS_VISIBLE,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lDesign, nOr<span style="color: #000000;">&#40;</span> WS_CLIPSIBLINGS, WS_TABSTOP <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lCentered, SS_CENTER, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lRight, SS_RIGHT, SS_LEFT <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lBorder, nOr<span style="color: #000000;">&#40;</span> WS_BORDER, WS_EX_STATICEDGE <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lShaded, SS_BLACKRECT, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lBox, &nbsp; &nbsp;SS_GRAYRECT, &nbsp;<span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lRaised, SS_WHITERECT, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span></div>[/code:2c8686zf] Si quieres sin borde negro: [code=fw:2c8686zf]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; ::<span style="color: #000000;">nStyle</span> &nbsp; &nbsp;= nOR<span style="color: #000000;">&#40;</span> WS_CHILD, WS_VISIBLE,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lDesign, nOr<span style="color: #000000;">&#40;</span> WS_CLIPSIBLINGS, WS_TABSTOP <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lCentered, SS_CENTER, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lRight, SS_RIGHT, SS_LEFT <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lBorder, WS_EX_STATICEDGE, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lShaded, SS_BLACKRECT, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lBox, &nbsp; &nbsp;SS_GRAYRECT, &nbsp;<span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lRaised, SS_WHITERECT, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span></div>[/code:2c8686zf] Sólo tendrás que usar la claúsula BORDER
Clausulas del SAY
Hola Antonio: Esto lo deje apartado ya que no me salio bien lo que me dijiste estoy intentando retomarlo ahora, me podrias decir donde se definen WS_BORDER, SS_BALCKRECT, SS_GRAYRECY y SS_WHITERECT. Un saludo Carlos
Clausulas del SAY
Carlos, WS_BORDER, SS_BLACKRECT y SS_WHITERECT estan en winapi.ch de FWH Aqui está el que falta: #define SS_GRAYRECT 5
Clausulas del SAY
Hola Antonio: Eso si lo he encontrado y he visto que cada uno tiene un numero y ese numero le indica lo que tiene que hacer por así decirlo, es donde se declara ese numero lo desearía saber. Un saludo Carlos
Clausulas del SAY
Carlos, Son valores definidos por Windows (aparecen en los ficheros de cabecera de Windows). Lo más sencillo es añadirlo a FWH\source\classes\say.prg
Clausulas del SAY
Hola Antonio: Si eso es lo que estoy haciendo ponerlo en el SAY.PRG y probar. Por eso de mi pregunta de donde puedo ver todas esas posibilidades y si existe una que sea SHADOW. Cuales son los Ficheros de Cabecera de Windows. Un saludo Carlos
Clausulas del SAY
Todos los estilos los puedes encontrar en c:\bcc582\include\winuser.h
Clausulas del SAY
Hola Antonio: He mirado el winuser y he encontrado: /* 3D border styles */ #define BDR_RAISEDOUTER 0x0001 #define BDR_SUNKENOUTER 0x0002 #define BDR_RAISEDINNER 0x0004 #define BDR_SUNKENINNER 0x0008 Lo he puesto en el say.prg en las primeras líneas después de los #define que hay. Después como me indicaste en el Style [code=fw:2wypywz7]<div class="fw" id="{CB}" style="font-family: monospace;"><br />::<span style="color: #000000;">nStyle</span> &nbsp; &nbsp;= nOR<span style="color: #000000;">&#40;</span> WS_CHILD, WS_VISIBLE,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lDesign, nOr<span style="color: #000000;">&#40;</span> WS_CLIPSIBLINGS, WS_TABSTOP <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lCentered, SS_CENTER, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lRight, SS_RIGHT, SS_LEFT <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lBorder, BDR_RAISEDOUTER , <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lShaded, SS_BLACKRECT, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lBox, &nbsp; &nbsp;SS_GRAYRECT, &nbsp;<span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lRaised, SS_WHITERECT, <span style="color: #000000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:2wypywz7] Pero no hace nada. ¿Hay que hacer algo más? Un saludo Carlos
Claves duplicadas al indexar ....
Hola buenos dias a todos,alguien sabe o darme una idea, de como crear una rutina para al momento de estar indexando los registros, que en mi rutina,me marque error de mensaje que tengo llaves duplicadas o registro duplicado ? un ejemplo como ese en la cabecera CVECODIGO...: CVECODIGO ----------- 0101 0102 0103 0104 0105 0105 **Aqui es donde me genera la duplicidad de la la misma clave, eso es debido a la caida de red o corte de energia electrica y mientras otro usuario, abrio el folio consecutivo... 0106 0107 0108 Gracias espero haberme explicado y sobre todo desde que punto de partida, generaria mi funcion de rutina antes mencionado. Saludos y buen dia a todos. William,que se recupere pronto tu hijo, es un alivio que ya paso lo peor, es cuestion de recuperacion, que Dios los bendiga Willi. Atte: Adriano C. C. <!-- e --><a href="mailto:acc69@hotmail.com">acc69@hotmail.com</a><!-- e -->
Claves duplicadas al indexar ....
Hola Como le propones el número al usuario? Yo lo hago de la siguiente manera.. 1. tengo en una base los correlativos [b:2fmw7xwo]parame[/b:2fmw7xwo] 2- Le propongo un numero, pero no es el definitivo 3.- Al grabar verifico que no exista el numero en la base 4.-grabo y luego le envio el numero al usuario, luego actualizo el numero en parame [code=fw:2fmw7xwo]<div class="fw" id="{CB}" style="font-family: monospace;">    <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">TIMER</span> oTmr <span style="color: #0000ff;">INTERVAL</span> <span style="color: #000000;">5000</span> <span style="color: #0000ff;">ACTION</span> ;<br />                    <span style="color: #000000;">&#40;</span> Parame-><span style="color: #000000;">&#40;</span> dbSkip<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, ;<br />                      _numdocu := Parame->GDes<span style="color: #000000;">+1</span>,;<br />                      aGet<span style="color: #000000;">&#91;</span>id_numdocu,<span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">TIMER</span> oTmr<br />    Eval<span style="color: #000000;">&#40;</span> oTmr:<span style="color: #000000;">bAction</span> <span style="color: #000000;">&#41;</span><br /> </div>[/code:2fmw7xwo] en grabar [code=fw:2fmw7xwo]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">if</span> !parame-><span style="color: #000000;">&#40;</span> NetRLock<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">return</span><span style="color: #000000;">&#40;</span> .f. <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">endif</span><br /><br />Eval<span style="color: #000000;">&#40;</span> oTmr:<span style="color: #000000;">bAction</span> <span style="color: #000000;">&#41;</span><br />oTmr:<span style="color: #000000;">DeActivate</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />nDocu := _numdocu<br /><br /><span style="color: #00C800;">if</span> Docu_BF-><span style="color: #000000;">&#40;</span> dbSeek<span style="color: #000000;">&#40;</span> upper<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">left</span><span style="color: #000000;">&#40;</span>_tipdocu,<span style="color: #000000;">3</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> + str<span style="color: #000000;">&#40;</span> nDocu,<span style="color: #000000;">10</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />    nOldFactu := nDocu<br />    <span style="color: #00C800;">while</span> Docu_BF-><span style="color: #000000;">&#40;</span> dbSeek<span style="color: #000000;">&#40;</span>upper<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">left</span><span style="color: #000000;">&#40;</span>_tipdocu,<span style="color: #000000;">3</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> + Str<span style="color: #000000;">&#40;</span>++nDocu, <span style="color: #000000;">10</span> <span style="color: #000000;">&#41;</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;">if</span> Valtype<span style="color: #000000;">&#40;</span> oTmr <span style="color: #000000;">&#41;</span> <> <span style="color: #ff0000;">"O"</span><br />        <span style="color: #00C800;">if</span> !MsgNoYes<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"La "</span>+_tipdocu +<span style="color: #ff0000;">" nº "</span>+ltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>nOldFactu<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" ya existe, desea reemplazarla"</span>+CRLF+;<br />                        <span style="color: #ff0000;">"por esta nueva "</span>+_tipdocu + <span style="color: #ff0000;">" nº "</span>+ltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>nDocu<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />            dbUnlockAll<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />            aGet<span style="color: #000000;">&#91;</span>id_numdocu<span style="color: #000000;">-20</span>,<span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />            <span style="color: #00C800;">if</span> Valtype<span style="color: #000000;">&#40;</span> oTmr <span style="color: #000000;">&#41;</span> = <span style="color: #ff0000;">"O"</span><br />                oTmr:<span style="color: #0000ff;">Activate</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />            <span style="color: #00C800;">endif</span><br />            <span style="color: #00C800;">return</span><span style="color: #000000;">&#40;</span> .f. <span style="color: #000000;">&#41;</span><br />        <span style="color: #00C800;">endif</span><br />    <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">endif</span><br /><br />..<br />..<br />aqui se graba todo la info<br /><br />parame->Num... := nDocu<br /><br />dbUnlockAll<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /> </div>[/code:2fmw7xwo]
Claves duplicadas al indexar ....
[quote="Patricio Avalos Aguirre":3clh1beh]Hola Como le propones el número al usuario? Yo lo hago de la siguiente manera.. 1. tengo en una base los correlativos [b:3clh1beh]parame[/b:3clh1beh] 2- Le propongo un numero, pero no es el definitivo 3.- Al grabar verifico que no exista el numero en la base 4.-grabo y luego le envio el numero al usuario, luego actualizo el numero en parame [code=fw:3clh1beh]<div class="fw" id="{CB}" style="font-family: monospace;">    <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">TIMER</span> oTmr <span style="color: #0000ff;">INTERVAL</span> <span style="color: #000000;">5000</span> <span style="color: #0000ff;">ACTION</span> ;<br />                    <span style="color: #000000;">&#40;</span> Parame-><span style="color: #000000;">&#40;</span> dbSkip<span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, ;<br />                      _numdocu := Parame->GDes<span style="color: #000000;">+1</span>,;<br />                      aGet<span style="color: #000000;">&#91;</span>id_numdocu,<span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">TIMER</span> oTmr<br />    Eval<span style="color: #000000;">&#40;</span> oTmr:<span style="color: #000000;">bAction</span> <span style="color: #000000;">&#41;</span><br /> </div>[/code:3clh1beh] en grabar [code=fw:3clh1beh]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">if</span> !parame-><span style="color: #000000;">&#40;</span> NetRLock<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">return</span><span style="color: #000000;">&#40;</span> .f. <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">endif</span><br /><br />Eval<span style="color: #000000;">&#40;</span> oTmr:<span style="color: #000000;">bAction</span> <span style="color: #000000;">&#41;</span><br />oTmr:<span style="color: #000000;">DeActivate</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />nDocu := _numdocu<br /><br /><span style="color: #00C800;">if</span> Docu_BF-><span style="color: #000000;">&#40;</span> dbSeek<span style="color: #000000;">&#40;</span> upper<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">left</span><span style="color: #000000;">&#40;</span>_tipdocu,<span style="color: #000000;">3</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> + str<span style="color: #000000;">&#40;</span> nDocu,<span style="color: #000000;">10</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />    nOldFactu := nDocu<br />    <span style="color: #00C800;">while</span> Docu_BF-><span style="color: #000000;">&#40;</span> dbSeek<span style="color: #000000;">&#40;</span>upper<span style="color: #000000;">&#40;</span><span style="color: #0000ff;">left</span><span style="color: #000000;">&#40;</span>_tipdocu,<span style="color: #000000;">3</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> + Str<span style="color: #000000;">&#40;</span>++nDocu, <span style="color: #000000;">10</span> <span style="color: #000000;">&#41;</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;">if</span> Valtype<span style="color: #000000;">&#40;</span> oTmr <span style="color: #000000;">&#41;</span> <> <span style="color: #ff0000;">"O"</span><br />        <span style="color: #00C800;">if</span> !MsgNoYes<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"La "</span>+_tipdocu +<span style="color: #ff0000;">" nº "</span>+ltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>nOldFactu<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" ya existe, desea reemplazarla"</span>+CRLF+;<br />                        <span style="color: #ff0000;">"por esta nueva "</span>+_tipdocu + <span style="color: #ff0000;">" nº "</span>+ltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>nDocu<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />            dbUnlockAll<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />            aGet<span style="color: #000000;">&#91;</span>id_numdocu<span style="color: #000000;">-20</span>,<span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />            <span style="color: #00C800;">if</span> Valtype<span style="color: #000000;">&#40;</span> oTmr <span style="color: #000000;">&#41;</span> = <span style="color: #ff0000;">"O"</span><br />                oTmr:<span style="color: #0000ff;">Activate</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />            <span style="color: #00C800;">endif</span><br />            <span style="color: #00C800;">return</span><span style="color: #000000;">&#40;</span> .f. <span style="color: #000000;">&#41;</span><br />        <span style="color: #00C800;">endif</span><br />    <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">endif</span><br /><br />..<br />..<br />aqui se graba todo la info<br /><br />parame->Num... := nDocu<br /><br />dbUnlockAll<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /> </div>[/code:3clh1beh][/quote:3clh1beh] Hola Patricio, gracias por responder, mas o menos asi lo hago,pero...sin el timer, ya que cada registro, se va grabando pero antes esta una rutina, de por ejemplo ocupado(), pero creo que al parecer, es el indice que se corrompio, al momento de la caida de energia electrica, del primer usuario, que al segundo usuario, reconocio como consecutivo del ultimo folio, es por eso que estoy viendo la manera de saber o crear una rutina, al momento de generar mi indice, me marque error, que existe una clave duplicada, pero no tengo ni idea, si alguien ya tiene implementado algo parecido, se los agradecere mucho. Gracias y saludos
Claves duplicadas al indexar ....
Adriano: Yo tengo unas rutinas que las llamo: [b:1nb6siqj]Control de Integridad[/b:1nb6siqj] [b:1nb6siqj] VerificaDuplicados() VerificaCabecerasDinDetalle() VerificaDetallesSinCabecera() VerificaCamposNulos() [/b:1nb6siqj] Ahí hago la revisión y emito un informe. Sin embargo no son automáticas, tiene que hacerlo el usuario. Ahora, tb, estoy trabajando sobre un proceso automático de mantenimiento, es decir que cada cierto tiempo se ejecute un proceso de mantenimiento al iniciar el programa : RecrearIndices() ReprocesarSaldos() Acá también se podría incluir la rutina de revisión de duplicados Otra tarea también seria el de ejecutar la rutina de mantenimiento cuando ocurra situaciones extrañas: Crash, etc., en entornos multiusuario. Atentamente, Rolando. Saludos desde Cochabamba, Bolivia
Claves duplicadas al indexar ....
[quote="RSalazarU":mhscckp0]Adriano: Yo tengo unas rutinas que las llamo: [b:mhscckp0]Control de Integridad[/b:mhscckp0] [b:mhscckp0] VerificaDuplicados() VerificaCabecerasDinDetalle() VerificaDetallesSinCabecera() VerificaCamposNulos() [/b:mhscckp0] Ahí hago la revisión y emito un informe. Sin embargo no son automáticas, tiene que hacerlo el usuario. Ahora, tb, estoy trabajando sobre un proceso automático de mantenimiento, es decir que cada cierto tiempo se ejecute un proceso de mantenimiento al iniciar el programa : RecrearIndices() ReprocesarSaldos() Acá también se podría incluir la rutina de revisión de duplicados Otra tarea también seria el de ejecutar la rutina de mantenimiento cuando ocurra situaciones extrañas: Crash, etc., en entornos multiusuario. Atentamente, Rolando. Saludos desde Cochabamba, Bolivia[/quote:mhscckp0] Hola Rolando gracias por contestar, el chiste es al momento de estar indexando se muestre un mensaje de error : "Codigo duplicado o ID duplicado, como se entienda...aunque no siempre se estara indexando, es de vez en cuando,dependiendo del usuario, que quiera reindexar sus archivos en forma semanal,mensual, etc etc , pero que se muestre que exista claves duplicadas, ese es el chiste,imaginate sino sabemos que dentro de la base de datos esten duplicados,todo por la caida de energia electrica o red ,que se yo,yo tengo esa funcion asi .... [code=fw:mhscckp0]<div class="fw" id="{CB}" style="font-family: monospace;">MsgMeter<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#123;</span>|oMeter,oText,oDlg,lEnd | BuildIndex<span style="color: #000000;">&#40;</span>oMeter,oText,oDlg,@lEnd ,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Dbf05,<span style="color: #ff0000;">"S05"</span>,<span style="color: #ff0000;">"STR(CVEIVA,1)"</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Dbf05,.F.,.F.<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"Generando indice ..."</span>+Dbf05,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"Espera por favor..."</span> <span style="color: #000000;">&#41;</span></div>[/code:mhscckp0] Y aqui la rutina... [code=fw:mhscckp0]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">//------------------------------------------------------------------------------</span><br /><span style="color: #00C800;">Static</span> <span style="color: #00C800;">Function</span> BuildIndex<span style="color: #000000;">&#40;</span>oMeter, oText, oDlg, lEnd, cDbf, cAlias, cCpo, cInd, lExclus, lRut<span style="color: #000000;">&#41;</span><br />&nbsp;<span style="color: #00C800;">LOCAL</span> DirEmp:= <span style="color: #ff0000;">"EMP"</span>+TSTR<span style="color: #000000;">&#40;</span>nNUMEMP<span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">"<span style="color: #000000;">\"</span><br /><br />&nbsp;CursorWait()<br /><br />&nbsp;IF lRut<br />&nbsp; &nbsp; &nbsp;cDbf := DirEmp+cDbf<br />&nbsp; &nbsp; &nbsp;cInd := cInd<br />&nbsp;ENDIF<br /><br />&nbsp;IF lExclus<br />&nbsp; &nbsp; &nbsp;Use &(cDbf) Alias &(cAlias) Exclusive<br />&nbsp; &nbsp; &nbsp;Pack<br />&nbsp;ELSE<br />&nbsp; &nbsp; &nbsp;Use &(cDbf) Alias &(cAlias)<br />&nbsp;ENDIF<br /><br />&nbsp;oMeter:nTotal := RecCount()<br /><br />&nbsp;INDEX ON &(cCpo) TAG &(cInd) FOR !DELETED() EVAL (oMeter:Set(RecNo()), SysRefresh(), !lEnd ) &nbsp; //....aqui es desde donde o como poner esa rutina de verificar claves duplicadas ...al momento de estar indexando la base de datos..espero que me entiendan, y ver desde donde poner la funcion,ando buscando y buscando y nada...pero en fin.<br /><br />&nbsp;(DbCloseArea(cDbf))<br />RETURN NIL</span></div>[/code:mhscckp0] Ah y las ultimas 3 rutinas como es la funcion que hace Rolando.... Saludos y buen dia Rolando. Atte: Adriano C. C. <!-- e --><a href="mailto:acc69@hotmail.com">acc69@hotmail.com</a><!-- e -->
Claves duplicadas al indexar ....
Adriano: Realmente es una gran idea, pero lo veo un poco difícil, se tendría que trabajar con el código HARBOUR de REINDEX/CREATE INDEX y añadir los parámetros que se pasara a EVAL <bBlock>. Bueno acerca del proceso que te comente: [b:xjaxao1u]mantenimiento()[/b:xjaxao1u] este se lo debería ejecutar al iniciar el programa bajo los siguientes criterios. - Se debe indicar con alguna variable de configuración del sistema que se puede hacer mantenimiento en esta terminal - Se debe indicar cada cuanto se va a realizar el reindexado de la Base de Datos completa. En este punto, yo tengo una función que realiza el reindexado de [b:xjaxao1u]TODAS la tablas obligadamente[/b:xjaxao1u] - Se debe indicar cada cuanto se va a realizar el Reproceso de Saldos. En algunos de mis sistemas: Almacenes, Ventas, tengo una tabla que maneja los saldos mensuales, este se actualiza automáticamente, pero puede suceder que por alguna razón no este con la información correcta, por lo que el reproceso coloca los saldos correctos nuevamente. También, se debe indicar cada cuanto se realiza el reproceso: diario, semanal o mensual. Hasta acá lo llevo implementado actualmente La parte de Control de integridad también se la debería hacer en este punto: - Verificar si existe duplicados (tu problema) - Verificar si hay datos nulos (registros sin ID) - Verificar maestro/detalle (cabeceras sin detalle y detalles sin cabecera) - Informar de esto en un reporte Es bastante trabajo, que se lo tiene que hacer poco a poco, es decir ir incorporando estas propiedades a los programas en cada nueva versión. Atentamente, Rolando. Saludos desde Cochabamba, Bolivia
Claves duplicadas al indexar ....
Adriano El problema que tienes no es tu rutina de index. El problema se te origina, estoy casi seguro, porque tu rutina de ingreso de datos no verifica la existencia previa de la clave. Verifica eso reviamente antes de intentar corregir el eval cuando generas el indice. En el clipper habia la posibilidad de generar indices unicos pero en Harbour no hay esa posibiidad asi que la unicidad la debes asegurar en tu codigo. Saludos Armando