topic stringlengths 1 63 | text stringlengths 1 577k ⌀ |
|---|---|
Code Bar PDF417 ó QR Code | Gracias João
Saludos,
Adhemar |
Code Blocks función: IF() | Estimados colegas:
¿Es conveniente, pasar a Code Blocks, todas las líneas, que se puedan de un fuente?.
¿Y sustituir, todos los IF ELSE ENDIF, por IF()?
¿Poner, todo lo que sea factible, de los IF(), a IF( condición, EVAL( bCode1 ), EVAL( bCode2 ) )
Ya que los, Code Blocks, y la función IF(), son más rapidos. Me podrías decir, que ya me he contestado yo mismo, pero nunca esta de más segundas, terceras,... opiniones. Por las experiencias de cada uno.
Por ello, pido opinión, a todos los que quieran participar.
Saludos, y ¡¡¡GRACIAS!!! anticipadas. |
Code Blocks función: IF() | JMFS-D, no se que procesos estes corriendo y son muy pesados, pero dejame decirte que según mi experiencia la verdad no afecta mucho en manera que definas tus if(). IF;ELSE;ENDIF.
Pero por calidad de codigo. Lo haria con los codebloks. |
Code Blocks función: IF() | La verdad es que a nuestro nivel no se nota mucho, a no ser que crees alguna clase que necesite rapidez de refresco o algo así.
Pero sin duda lo más importante de los Codeblocks es que se encapsulan en una variable y se ejecutan del tirón sin necesidad de tener que buscarlos por la memoria a cada llamada a función. Son como las funciones INLINE pero transportables. Adermás la variable sirve de transporte y puedes pasorlos a una función o a un método de una clase con sus variables internas y todo. No se pueden concebir las clases de FW sin ellos. ¿Como sinó llamarías al Valid de un Get o a una accion al pulsar un botón. Tendrían que inventar otra cosa o aplicar los punteros de función.
En cuanto a los IF(). Idem de los mismo. Son INLINE y se pueden anidar y utilizar dentro de una variable, una llamada a función, etc. Ahorran mucho código. Por Ejemplo:
ColorearObjeto(if(oBJ=1,CRL_RED,if(oBJ=2,CLR_BLUE,CLR_GREEN)))
A ver como lo traduces a if / else / endif. Como mínimo 6 líneas con sus ciclos de reloj correspondiente.
O mejor: bColObj := { |oBj| if(oBJ=1,CRL_RED,if(oBJ=2,clr_blue,CLR_GREEN)), MsgBeep() }
ColorearCaja(bColObj,oCaja)
Por decir algo sencillo... |
Code Blocks función: IF() | IF( oParamtros:lPresupu , ;
( oDbfPresup:Load() , ;
nSiguiente := oDatos:Current()[ 1 ] , ;
oDatos:Current()[ 1 ] := nAnterior , ;
oDbfPresup:tipo := oPresupu:nTipo , ;
oDbfPresup:estado := oPresupu:nEstado , ;
oDbfPresup:codigo := oCliente:cCodigo , ;
oDbfPresup:numpresup := oPresupu:cNumero , ;
oDbfPresup:fechapres := oPresupu:dFecha , ;
oDbfPresup:descripcio := oDatos:Current()[ 2 ] , ;
oDbfPresup:cantidad := oDatos:Current()[ 3 ] , ;
oDbfPresup:precio := oDatos:Current()[ 4 ] , ;
oDbfPresup:Save() , ;
oDbfPresup:GoTo( nSiguiente ) ) , ;
( nSiguiente := oDatos:Current()[ 1 ] , ;
oDatos:Current()[ 1 ] := nAnterior , ;
oDbfFactC:tipo := oFactura:nTipo , ;
oDbfFactC:estado := oFactura:nEstado , ;
oDbfFactC:codigo := oCliente:cCodigo , ;
oDbfFactC:numfactura := oFactura:cNumero , ;
oDbfFactC:fechafactu := oFactura:dFecha , ;
oDbfFactC:descripcio := oDatos:Current()[ 2 ] , ;
oDbfFactC:cantidad := oDatos:Current()[ 3 ] , ;
oDbfFactC:precio := oDatos:Current()[ 4 ] , ;
oDbfFactC:Save() , ;
oDbfFactC:GoTo( nSiguiente ) ) )
Poner las lineas de codigo, para cuando se cumple la condición del IF, y para cuando no se cumple, en un EVAL, ¿sería lo más conveniente?.
Saludos, José Mª |
Code Blocks función: IF() | Jose Mª,
Practicamente no habrá diferencia en la velocidad de ejecución y el código se volverá más complicado de mantener.
Piensa que tanto las líneas de código de un PRG como el contenido de un codeblock, el compilador lo convierte a pcode (una serie de bytes) que la maquina virtual procesa.
Sólo en procesos en los que se requiere la máxima velocidad, la solución es codificar ciertas partes en C para que la máquina virtual no intervenga y así ganar ciclos de reloj. |
Code Blocks función: IF() | No hay que buscarle tres pies al gato, los manuales de programación dicen que siempre hay que buscar velocidad y ahorro de memoria, o elejir uno de los dos cuando no se no se pueden cumplir ambos.
De lo que se olvidan es de nuestra comodidad y de la claridad del código, y reza por no saltarte un paréntesis.
En el caso de tu trozo de codigo, lo mas convenientes es un IF / ELSE / ENDIF sin lugar a dudas. Otras veces serán más adecuados los DO CASE. Otras veces te convendrá encapsular el código vía IF() y CodeBloks. Busca siempre lo que más cómodo te resulte y no te calientes la cabeza.
Un saludo.... |
Code char | Hi, all !How determine code char (ANSI, UNICODE, UTF etc.) at read file ? |
Code for FiveWin IFDEF ? | hi,
in my Source i have
[code=fw:251ptcri]<div class="fw" id="{CB}" style="font-family: monospace;"> #ifdef __CLIPPER__<br /> #ifdef __XPP__<br /> #ifdef __HARBOUR__ </div>[/code:251ptcri]
now while trying different IDE and Environment i like to ask if FiveWin have something like this <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
i found
[code=fw:251ptcri]<div class="fw" id="{CB}" style="font-family: monospace;"> #ifdef FWPLUS<br /> #ifdef REVD1801<br /> #ifdef REVN1807<br /> #ifdef UPTO_FWH1105</div>[/code:251ptcri]
but nothing with __FW__ <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( -->
p.s. does Fivewin Code run under __XPP__ <!-- s:? --><img src="{SMILIES_PATH}/icon_confused.gif" alt=":?" title="Confused" /><!-- s:? --> |
Code for FiveWin IFDEF ? | you can do ifdef with any define in fivewin.ch
[code=fw:1bbnolpp]<div class="fw" id="{CB}" style="font-family: monospace;">#ifdef _FIVEWIN_CH<br />#ifdef FWCOPYRIGHT<br />#ifdef FW_VersionNo<br />#ifdef FWVERSION<br />#ifdef FWDESCRIPTION</div>[/code:1bbnolpp]
in our code we had some problem when they retired WndReadPalBmpEx so in our code we have:
[code=fw:1bbnolpp]<div class="fw" id="{CB}" style="font-family: monospace;">#if FW_VersionNo >= <span style="color: #000000;">18010</span><br /> nImage := FW_ReadImage<span style="color: #000000;">(</span> <span style="color: #00C800;">Self</span>, cImage <span style="color: #000000;">)</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><br />#else<br /> nImage := WndReadPalBmpEx<span style="color: #000000;">(</span> <span style="color: #00C800;">Self</span>, cImage <span style="color: #000000;">)</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span><br />#endif</div>[/code:1bbnolpp] |
Code is executing after ACTIVATE WINDOW | Hi All,
I searched in the forum but I could not found the answer may be I could not co-relate with my problem. Basically I want to execute the code after a calling procedure execution is over. A calling procedure create and activate window ( not a dialog ) as WINDOW behavior it does not wait as dialog. I know we have VALID clause to execute the code after the WINDOW close (end) as per my need I can not use VALID clause. I am calling a procedure in the button action's block please see below. so do we have any solution apart from VALID clause ?
Thanks in advance.
[code=fw:1chnnpyg]<div class="fw" id="{CB}" style="font-family: monospace;"> aoBTN<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>:<span style="color: #000000;">bAction</span> := <||<br /><br /> <span style="color: #00C800;">IF</span> oRGSQry:<span style="color: #000000;">vt_id</span> == C_CHQ_RETURN_VT_ID<br /> trv_dbrcpt<span style="color: #000000;">(</span> oRGSQry:<span style="color: #000000;">vou_id</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">// New Window Activates </span><br /> <span style="color: #00C800;">ENDIF</span><br /> --- below code should be execute after closing previous <span style="color: #0000ff;">window</span> <br /> oRGSQry := oApp:<span style="color: #000000;">gDBServer</span>:<span style="color: #000000;">Query</span><span style="color: #000000;">(</span> C_VT_REG<span style="color: #000000;">(</span> C_VR_VT_ID, C_VR_FROM_DATE, C_VR_TO_DATE <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> oBrwRGS:<span style="color: #000000;">SetDolphin</span><span style="color: #000000;">(</span>oRGSQry<span style="color: #000000;">)</span><br /> oBrwRGS:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> --<br /> <br /> ></div>[/code:1chnnpyg]
Thanks
Shridhar |
Code is executing after ACTIVATE WINDOW | Shridhar,
I am not sure about what you want to do exactly, but maybe you could use oWnd:bStart that is executed just once, when the window is initially shown |
Code is executing after ACTIVATE WINDOW | Shirdhar,
Try the code below.
Regards,
James
[code=fw:1hiot3i7]<div class="fw" id="{CB}" style="font-family: monospace;"> aoBTN<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>:<span style="color: #000000;">bAction</span> := <span style="color: #000000;">{</span>|oBrwRGS| ;<br /> IIF<span style="color: #000000;">(</span>oRGSQry:<span style="color: #000000;">vt_id</span> == C_CHQ_RETURN_VT_ID, ;<br /> trv_dbrcpt<span style="color: #000000;">(</span> oRGSQry:<span style="color: #000000;">vou_id</span> <span style="color: #000000;">)</span><span style="color: #000000;">)</span>, ; <span style="color: #B900B9;">// New Window Activates </span><br /> oRGSQry := oApp:<span style="color: #000000;">gDBServer</span>:<span style="color: #000000;">Query</span><span style="color: #000000;">(</span> C_VT_REG<span style="color: #000000;">(</span> C_VR_VT_ID, C_VR_FROM_DATE, C_VR_TO_DATE <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>,;<br /> oBrwRGS:<span style="color: #000000;">SetDolphin</span><span style="color: #000000;">(</span>oRGSQry<span style="color: #000000;">)</span>,;<br /> oBrwRGS:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>,;<br /> <span style="color: #000000;">}</span></div>[/code:1hiot3i7] |
Code is executing after ACTIVATE WINDOW | Or you can use this:
[code=fw:25imdfu0]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd;<br /> <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">(</span> oWnd := <span style="color: #00C800;">NIL</span>, .T. <span style="color: #000000;">)</span><br /><br />STOPUNTIL<span style="color: #000000;">(</span> <span style="color: #000000;">{</span> || oWnd = <span style="color: #00C800;">NIL</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #B900B9;">// Here goes your code</span></div>[/code:25imdfu0]
EMG |
Code is executing after ACTIVATE WINDOW | Enrico,
Hey, I like that. Much easier.
Regards,
James |
Code is executing after ACTIVATE WINDOW | Hi All,
Thanks a lot..! for your great support.
Hi Antonio ,
Actually I want execute the code after a particular window operation is over. As WINDOW's behaviour the execute after ACTIVATE WINDOW that I do not need. Simply when we say ACTIVATE WINDOW oWnd it should wait till the Window is closed and continue with next code.
Hi Enrico ,
As I read in our forum the below function should not be used. Can we use this function in our code ? Please correct me if I am worng. Thanks in advance.
[code=fw:38qnadp2]<div class="fw" id="{CB}" style="font-family: monospace;"><br />STOPUNTIL<span style="color: #000000;">(</span> <span style="color: #000000;">{</span> || oWnd = <span style="color: #00C800;">NIL</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /> </div>[/code:38qnadp2]
Thanks
Shridhar |
Code is executing after ACTIVATE WINDOW | It's already used in rpreview.prg so yes, you can use it in your code.
EMG |
Code is executing after ACTIVATE WINDOW | Hi Enrico ,
I tried but its not working and also when I closed entire application still the Window's task manager shows status is running.
Thanks
Shridhar |
Code is executing after ACTIVATE WINDOW | Hi, if I understood, please look at this:
<!-- l --><a class="postlink-local" href="http://fivetechsupport.com/forums/viewtopic.php?f=3&t=18270&start=0&hilit=oWnd%3Abpostend">viewtopic.php?f=3&t=18270&start=0&hilit=oWnd%3Abpostend</a><!-- l -->
Best regards |
Code is executing after ACTIVATE WINDOW | A working sample:
[code=fw:1usjazi8]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Fivewin.ch"</span><br /><br /><br /><span style="color: #00C800;">FUNCTION</span> MAIN<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> oWnd<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd;<br /> <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">(</span> oWnd := <span style="color: #00C800;">NIL</span>, .T. <span style="color: #000000;">)</span><br /><br /> STOPUNTIL<span style="color: #000000;">(</span> <span style="color: #000000;">{</span> || oWnd = <span style="color: #00C800;">NIL</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><br /> ? <span style="color: #ff0000;">"The end!"</span><br /><br /> <span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span></div>[/code:1usjazi8]
EMG |
Code is executing after ACTIVATE WINDOW | Hi Enrico ,
Extremely sorry..! I had not added the VALID clause in the ACTIVATE WINDOW command.
[code=fw:21g6l9sk]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">(</span> oWnd := <span style="color: #00C800;">NIL</span>, .T. <span style="color: #000000;">)</span><br /> </div>[/code:21g6l9sk]
Thanks
Shridhar |
Code page - can I set it ? | Hi everebody!
I try set code page in my applicationto hungarian.
I try this code , but is not work (Browse look as english). Make I anything wrong ?
Regards Andrej.
/// settings
REQUEST DBFCDX
REQUEST DBFFPT
RDDSETDEFAULT ('DBFCDX')
REQUEST HB_LANG_HUWIN
REQUEST HB_CODEPAGE_HUWIN
HB_LangSelect('HU')
HB_SetCodePage("HUWIN")
// open dbf
DBUSEAREA(.T.,"DBFCDX",cFileName,cAliasName,.F.,.F.,"HUWIN")
// Make browse
@ 0.1, 0.1 LISTBOX oGetBr ;
FIELDS BASE->AZON,;
BASE->VEZNEV;
HEADERS 'BASE->AZON',;
'BASE->VEZNEV';
OF oFld:aDialogs[ 1 ];
SIZE ScreenX-4, ScreenY
oGetBr:aColSizes := { 60, 60,100,100 } |
Code page - can I set it ? | Try it this way:
REQUEST HB_Lang_HU
REQUEST HB_CODEPAGE_HUWIN
...
HB_LangSelect("HU")
HB_SetCodePage("HUWIN") |
Code page - can I set it ? | Linker write "unresolved external symbol HB_FUN_HB_LANG_HU"
I think REQUEST HB_LANG_HUWIN was good. (but not make nothing )
Regards
Andrej. |
Code that used to work fails | Antonio, the folowing code used to work in a previous version and isn't working anymore.
The text and the title do not change and the dialog isn't centered.
Note the NOWAIT clause.
The previous version was 09.11 using xHarbour.com's Pelles C and now I am using Harbour 11.10 + MinGw.
I was unable to test with FW 11.10 version + xHarbour.com because my xHarbour.com's isn't FW 11.10 compatible.
Could you investigate if this is a problem with MinGw, FW version or my code ?
PRG :
[code=fw:3p0vvq8c]<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: #00C800;">FUNCTION</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> oDlgTeste, oTexto, cTexto<br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlgTeste <span style="color: #0000ff;">RESOURCE</span> <span style="color: #000000;">18503</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Teste Title"</span><br /> <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">SAY</span> oTexto <span style="color: #0000ff;">VAR</span> cTexto <span style="color: #0000ff;">ID</span> <span style="color: #000000;">101</span> <span style="color: #0000ff;">OF</span> oDlgTeste<br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlgTeste <span style="color: #0000ff;">CENTER</span> <span style="color: #0000ff;">NOWAIT</span><br /><br /> cTexto := <span style="color: #ff0000;">"Another text..."</span><br /> oTexto:<span style="color: #000000;">SETTEXT</span><span style="color: #000000;">(</span> cTexto <span style="color: #000000;">)</span><br /><br /> MessageBox<span style="color: #000000;">(</span> <span style="color: #000000;">0</span>, <span style="color: #ff0000;">"Why dialog text didn't change ?"</span>, <span style="color: #ff0000;">"Why title didn't change ?"</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span></div>[/code:3p0vvq8c]
RC :
[code=fw:3p0vvq8c]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"winuser.h"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"winnt.h"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"commctrl.h"</span><br /><br /><span style="color: #000000;">18503</span> <span style="color: #0000ff;">DIALOG</span> DISCARDABLE <span style="color: #000000;">13</span>, <span style="color: #000000;">22</span>, <span style="color: #000000;">250</span>, <span style="color: #000000;">100</span><br /><span style="color: #0000ff;">STYLE</span> WS_POPUP|DS_MODALFRAME|DS_3DLOOK|WS_CAPTION|WS_VISIBLE<br />CAPTION <span style="color: #ff0000;">"Teste..."</span><br /><span style="color: #000000;">{</span><br /> CONTROL <span style="color: #ff0000;">"Text"</span>, <span style="color: #000000;">101</span>, <span style="color: #ff0000;">"Static"</span>, SS_CENTER, <span style="color: #000000;">2</span>, <span style="color: #000000;">9</span>, <span style="color: #000000;">245</span>, <span style="color: #000000;">15</span><br /><span style="color: #000000;">}</span><br /> </div>[/code:3p0vvq8c] |
Code that used to work fails | I think, that will work with any FWH-version :
[color=#0000FF:3d0u62s9]ACTIVATE DIALOG oDlgTeste CENTER NOWAIT ;[/color:3d0u62s9]
[color=#FF0000:3d0u62s9]ON INIT [/color:3d0u62s9][color=#0000FF:3d0u62s9]( oDlgTeste:cTitle := "New Text", ;
cTexto := "Another text...", oTexto:SETTEXT( cTexto ) )[/color:3d0u62s9]
You can force a Dialog-position ( ON INIT ) with :
[color=#0000FF:3d0u62s9]oDlgTeste:Move( nTop, nLeft, DlgWidth, DlgHeight , .f. )[/color:3d0u62s9]
( possible Calculation of centered Position )
Best Regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> |
Code that used to work fails | No, didn't work.
Harbour 3.1.0dev (Rev. 17102).
gcc (tdm-1) 4.5.2-dw2
FW 11.10 |
Code that used to work fails | Hello,
It is working with FWH 11.11, Borland 5.82 and Harbour 3.1 |
Code that used to work fails | Concentra,
We already know what is going on. We are working to fix it, thanks! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
It is the same reason for the bug detected by Rimantas! |
Code that used to work fails | Concentra,
This fix is required in Class TDialog for MinGW:
dialog.prg
[img:2yek0jye]http://img221.imageshack.us/img221/4415/captureapb.png[/img:2yek0jye] |
Code that used to work fails | Thanks Antonio.
But the DIALOG.PRG I have isn't the same as yours, the lines aren't the same...
Could you send me the full DIALOG.PRG ?
Maurício Faria |
Code that used to work fails | Mauricio,
New libs sent to your email <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
Code to Set and Get value for a combobox | Hi,
code to store a Datatable object to combobox.and i want to Display "Name" and work "Id" at the background.
thanks in Advance
Regards,
Sajith |
Code to Set and Get value for a combobox | Could not understand your requirement clearly. If u want to display a name and return the code assosciated with the name when the user select the item from the Combobox, then Please use DbCombo instead of Combobox.
Anser |
Code to Set and Get value for a combobox | thanks
Regards ,
Sajith |
Code128 un ejemplo... | Hola foro, hace tiempo hice una pequeña app en fw16 bits con esta fabulosa lin de Cayetano de codigo de barras, pero ahora me veo en la necesidad de usarlo a fw + xharbour pero nada, el lector no me lo reconoze, alguien podria mandarme un ejemplo de como aplicarlo...
Saludos
Rosales, Luis |
Code128 un ejemplo... | Hola Luis:
Tienes que crear la BarLib.lib para xHarbour, o en su defecto compilar y enlazar con tu aplicación los prgs que forman la BarLIb
Saludos
Manuel Mercado |
Code128 un ejemplo... | hola. hace poco tube un problema similar; fijate este tema
<!-- m --><a class="postlink" href="http://fivetechsoft.com/forums/viewtopic.php?t=9735">http://fivetechsoft.com/forums/viewtopic.php?t=9735</a><!-- m -->
CHAU...!!! |
Code7 | Hello!
<!-- m --><a class="postlink" href="http://reddevnews.com/blogs/rdn-express/2009/07/lucky-7-for-microsoft-developers.aspx">http://reddevnews.com/blogs/rdn-express ... opers.aspx</a><!-- m -->
[quote:1rviyup7]
Code7 Contest that offers up to $17,777 and a free trip to PDC09 for the finalists in seven geographical locations. Contestants submit a three-minute video explaining their application, which must take advantage of at least one of these Windows 7 technologies: Libraries, Windows Touch, Shell Integration, DirectX 11, or Sensor and Location Platform.
[/quote:1rviyup7]
Cheers, Roman
P.S. One of the rules is:
[quote:1rviyup7]
You are NOT a resident of any of the following countries/jurisdictions: Cuba; Iran; North Korea; Sudan and the [color=#0053A0:1rviyup7][b:1rviyup7]Province of Quebec[/b:1rviyup7][/color:1rviyup7], Canada;[/quote:1rviyup7] <!-- m --><a class="postlink" href="http://channel9.msdn.com/forums/Coffeehouse/478899-Windows-7-Coding-Contest/?CommentID=478961">http://channel9.msdn.com/forums/Coffeeh ... tID=478961</a><!-- m --> |
Code::Blocks - IDE de fuente abierta | Buenas,
por si alguien se quiere animar a configurar y utilizar Code::Blocks como IDE de [x]Harbour y FWH.
<!-- m --><a class="postlink" href="http://www.codeblocks.org/">http://www.codeblocks.org/</a><!-- m -->
Saludos,
Félix Pablo Grande Ramos |
Code::Blocks - Open Source IDE | Morning,
here you are an open source IDE, Code::Blocks
<!-- m --><a class="postlink" href="http://www.codeblocks.org/">http://www.codeblocks.org/</a><!-- m -->
We could use it with [x]Harbour and FWH ?
Regards,
Felix Pablo Grande Ramos |
CodeBlock | Hello friends
I need to know what has inside a codeblock: function, field name..
That's possible.
I'm trying to take the TcBrowse Object and know the contents of each column, reverse engineering. |
CodeBlock | Dear Ari,
In harbour/include/hbapi.h you find this:
[url:2sc9o95l]https://github.com/harbour/core/blob/master/include/hbapi.h[/url:2sc9o95l]
[quote:2sc9o95l]typedef struct _HB_CODEBLOCK
{
const HB_BYTE * pCode; /* codeblock pcode */
PHB_SYMB pSymbols; /* codeblocks symbols */
PHB_SYMB pDefSymb; /* symbol where the codeblock was created */
PHB_ITEM pLocals; /* table with referenced local variables */
void * pStatics; /* STATICs base frame */
HB_USHORT uiLocals; /* number of referenced local variables */
HB_SHORT dynBuffer; /* is pcode buffer allocated dynamically, SHORT used instead of HB_BOOL intentionally to force optimal alignment */
} HB_CODEBLOCK, * PHB_CODEBLOCK;
[/quote:2sc9o95l]
using #define _HB_API_INTERNAL_ before #include <hbapi.h> you can use such structure to query a codeblock retrieved as hb_param( <number_parameter>, HB_IT_BLOCK ) |
CodeBlock | Obrigado Antonio. |
CodeBlock al cerrar un Dialogo | Muy buenas, se ejecuta algún CodeBlock al Cerrar un dialogo [ oDlg:end()]
Un Saludo. |
CodeBlock al cerrar un Dialogo | El bValid, en caso de estar defindo:
[code=fw:1yxgyr8g]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg ;<br /> <span style="color: #0000ff;">VALID</span> MsgYesNo<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Quiere salir ?"</span> <span style="color: #000000;">)</span><br /> </div>[/code:1yxgyr8g]
Dicho código está en oDlg:bValid, y ese codeblock tiene que devolver un valor lógico: .T. ó .F. |
CodeBlock al cerrar un Dialogo | Muchas gracias antonio.
Un Saludo. |
CodeJock Calendar Control | Hi.
Has anybody had any luck adding multiple resources to a CodeJock Calendar control? Multiple resources is a way to have multiple schedules for multiple people. I was successful creating it, but it doesn't show appointments. It's all blank. Here is my code:
[code=fw:1yrf32i9]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> <span style="color: #00C800;">IF</span> !EMPTY<span style="color: #000000;">(</span> ::<span style="color: #000000;">aSchedules</span> <span style="color: #000000;">)</span> <br /><br /> ::<span style="color: #000000;">oSchedules</span> := ::<span style="color: #000000;">oCalex</span>:<span style="color: #000000;">DataProvider</span>:<span style="color: #000000;">Schedules</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> aEval<span style="color: #000000;">(</span> ::<span style="color: #000000;">aSchedules</span>, <span style="color: #000000;">{</span> |e, n| ;<br /> ::<span style="color: #000000;">oSchedules</span>:<span style="color: #000000;">AddNewSchedule</span><span style="color: #000000;">(</span> e <span style="color: #000000;">)</span>,;<br /> oResDesc := ::<span style="color: #000000;">CreateScheduleResource</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>,;<br /> oResDesc:<span style="color: #000000;">SetDataProvider</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">oCalex</span>:<span style="color: #000000;">DataProvider</span>, .F. <span style="color: #000000;">)</span>,;<br /> oResDesc:<span style="color: #0000ff;">Name</span><span style="color: #000000;">(</span> e <span style="color: #000000;">)</span>,;<br /> oResDesc:<span style="color: #000000;">ScheduleIDs</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">oSchedules</span>:<span style="color: #000000;">Item</span><span style="color: #000000;">(</span> n<span style="color: #000000;">-1</span> <span style="color: #000000;">)</span>:<span style="color: #0000ff;">Id</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>,;<br /> ::<span style="color: #000000;">oCalexResources</span>:<span style="color: #000000;">Add</span><span style="color: #000000;">(</span> oResDesc <span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #000000;">)</span><br /><br /><br /> ::<span style="color: #000000;">oCalex</span>:<span style="color: #000000;">SetMultipleResources</span><span style="color: #000000;">(</span> ::<span style="color: #000000;">oCalexResources</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">ENDIF</span><br /><br /> ::<span style="color: #000000;">oCalex</span>:<span style="color: #000000;">Populate</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> ::<span style="color: #000000;">oCalex</span>:<span style="color: #000000;">RedrawControl</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> </div>[/code:1yrf32i9]
[img]
http://ssfl.dynalias.com/temp_files/CJ_CalendarScreenShot.png
[/img]
Reinaldo. |
CodeJock Calendar Control | Reinaldo,
Tim Stone is a master with Codejock Calendar, surely he may be able to help you <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Or you may email him |
CodeJock calendar | Dear All,
I would like to get an example to use CodeJock Calendar. Can I use it without Visual Studio?
I try to download TCalex but it doesn't successful (compile). It has many missing library from samples. The sample (EXE file) is great but I cannot compile samples and source in TCALEX.RAR.
Thanks in advance for any help and suggestion. |
CodeJock calendar | Dutch
Yes you can use Codejock with visual studio and Harbour without problems.
You need the activex installed on your computer to make it work.
Hth
Richard |
CodeJock calendar | Dear Richard,
I have not MS-Visual Studio, Can I use it without MS.VS?
Can I use it if I have Activex in my computer?
Have you got a example?
[quote="Richard Chidiak":ljjjq143]Dutch
Yes you can use Codejock with visual studio and Harbour without problems.
You need the activex installed on your computer to make it work.
Hth
Richard[/quote:ljjjq143]
Thanks a lot for your reply. |
CodeJock calendar | Dutch
What Richard is referring to is the ActiveX CodeJock library ( .ocx ) that MUST be installed and Registered on each computer for your calendar module to run.
Rick Lipkin |
CodeJock calendar | Dutch,
I have it in 3 different builds, and it works fine:
xHarbour using xBuild and its Pelles C compiler / linker
Harbour using the makefile found in UE Studio and a Microsoft C++ ( Version 2010 - 2013 all worked )
Microsoft Visual Studio 2013 Pro.
All 3 work fine. However, you must have the .dll file from Codejock, and it must be registered to your computer. You also must include a license file they provide when you buy the product.
Tim |
CodeJock calendar | Dear All,
Could you correct me if I misunderstood.
- I cannot use without Visual Studio C++ or xHarbour.com.
- It cannot use with xHb+FWH+Borland 5.82.
- The Activex library must register to all pc that use my program.
Thanks for all kind help and appreciated all suggestion. |
CodeJock calendar | Dutch
This is the only important thing you need
- The Activex library must register to all pc that use my program.
Richard |
CodeJock calendar | Dutch,
I do not use Borland so I can't give you any response on that. However, I believe Richard would be correct. Also, the library is placed on, and registered to, each PC that will use the calendar program. It is not necessary on others. However, if you simply add it to an installer then it can go everywhere.
When you obtain the software from Codejock, you will receive a license. You add that into your code before compiling it. The same license is universal ... it is used on every application.
Tim |
CodeJock calendar | Dear All,
I have got an idea now.
Thanks a lot. |
CodePage Problem? | Hi,
I have a small sample of creating dialog using HB_SetCodePage function.
[code=fw:208kbo3a]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br />REQUEST HB_CODEPAGE_TRWIN<br /><br />Procedure Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br />HB_SetCodePage<span style="color: #000000;">(</span> <span style="color: #ff0000;">"TRWIN"</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <br /><br /> @ <span style="color: #000000;">20</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"User Name : DDDDDDDDDDDD"</span> <span style="color: #0000ff;">of</span> oDlg <span style="color: #0000ff;">PIXEL</span> <br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> ODlg <span style="color: #0000ff;">centered</span><br /><br /><br /><span style="color: #00C800;">RETURN</span> .T.</div>[/code:208kbo3a]
If I remove HB_SetCodePage("TRWIN") line compiled Exe works. But It does not work with this line.
Is there anything wrong in code?
Thanks, |
CodePage Problem? | Hi,
I have changed the below lines and there is not any problem.
[code=fw:19isck0d]<div class="fw" id="{CB}" style="font-family: monospace;"> REQUEST HB_CODEPAGE_ESWIN<br /> HB_SetCodePage<span style="color: #000000;">(</span> <span style="color: #ff0000;">"ESWIN"</span> <span style="color: #000000;">)</span></div>[/code:19isck0d]
What should I do? |
CodePage Problem? | Hakan,
> If I remove HB_SetCodePage("TRWIN") line compiled Exe works. But It does not work with this line.
What error do you get ? A link error ? A runtime error ? |
CodePage Problem? | Hi,
There is not any error reported. It just disappeared. I try to find the error. it disappeared it in DialogBoxIndirect function in activates method of dialog class. It does not return to activates method anymore. I could not found the DialogBoxIndirect function. |
CodePage Problem? | Hakan,
I can not find TRWIN in xharbour\source\lang\*.c
Have you ever used it before ? |
CodePage Problem? | Hi Antonio,
You are right. There is not. it is in xHarbour.org\Source\codepage\cptrwin.c
I do not use tr messages. I try to use only codepage.
No. I have never used before. |
CodePage Problem? | [quote="Horizon":1plw5r56]
I have a small sample of creating dialog using HB_SetCodePage function.
[code=fw:1plw5r56]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br />REQUEST HB_CODEPAGE_TRWIN<br /><br />Procedure Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br />HB_SetCodePage<span style="color: #000000;">(</span> <span style="color: #ff0000;">"TRWIN"</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <br /><br /> @ <span style="color: #000000;">20</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">SAY</span> <span style="color: #ff0000;">"User Name : DDDDDDDDDDDD"</span> <span style="color: #0000ff;">of</span> oDlg <span style="color: #0000ff;">PIXEL</span> <br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> ODlg <span style="color: #0000ff;">centered</span><br /><br /><br /><span style="color: #00C800;">RETURN</span> .T.</div>[/code:1plw5r56]
If I remove HB_SetCodePage("TRWIN") line compiled Exe works. But It does not work with this line.
Is there anything wrong in code?
Thanks,[/quote:1plw5r56]
Hi Hakan,
I have an application (xHarbour + FWH) in several languages and now I want to include Turkish. Have you got "TRWIN" for xHarbour?.
Thanks in advance. |
CodePage Problem? | Manuel,
I am sorry to say that I could't use TRWIN in xharbour. I have migrated to Harbour last year and not tried to use it.
Regards. |
CodePage Problem? | [quote="Horizon":hfqd86vm]Manuel,
I am sorry to say that I could't use TRWIN in xharbour. I have migrated to Harbour last year and not tried to use it.
Regards.[/quote:hfqd86vm]
Thanks Hakan |
CodePage UTF8 | Muy buenas foro,
tengo una duda, tengo acceso a MySQL usando Eagle y la base de datos está configurada con caracteres: utf8_general_ci, la cuestion es que desde el Administrador de MySQL puedeo insertar y leer en un campo el lenguaje en Arabe en MySQL pero accediendo desde Eagle/FWH me devuelve caracteres como ??????,
entonces creo que tengo que poner el CODEPAGE del software UTF8. ¿Alguien sabría como hacerlo para pueda leer e insertar desde FWH?
Un Saludo y Mil Gracias. |
CodePage UTF8 | Muy buenas, sigo buscando pero no encuentro nada de esto, ¿alguna sugerencia Antonio?
Un Saludo. |
CodePage UTF8 | Estimado softruz(?)
Asi debes proceder con Eagle:
[code=fw:2nv3j4gj]<div class="fw" id="{CB}" style="font-family: monospace;">oConn:= TMSEConnect<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br />... <br /><span style="color: #B900B9;">// Vars</span><br />cDatabase:= <span style="color: #ff0000;">"TuDB"</span><br />cCharSet := CRLF+<span style="color: #ff0000;">"CHARACTER SET utf8"</span> <span style="color: #B900B9;">// o la que uses</span><br />cCollate := <span style="color: #ff0000;">"COLLATE utf8_spanish_ci"</span> <span style="color: #B900B9;">// o la que uses</span><br /><br />oConn:<span style="color: #000000;">CreateDataBase</span><span style="color: #000000;">(</span> cDataBase+cCharSet+cCollate <span style="color: #000000;">)</span></div>[/code:2nv3j4gj]
En otro orden el mas indicado para quitarte las dudas es: Manuel Expósito que abrio grupos en:
[url]eagle1@yahoogroups.com[/url]
[url]eagle1_usuarios@googlegroups.com[/url]
Saludos |
CodePage UTF8 | Muchas gracias Mario,
pero lo que necesito es leer un campo en el idioma en Araba en MySQL, la base de datos ya la tengo creada y configurada para UTF8, y el problema que me encuentro es que cuando leo el valor como mi aplicación no está configurada en UTF8 no puedo leer y mostrar en un GET ese valor correctamente.
¿sabrías algo sobre esto?
Un Saludo. |
CodePage UTF8 | Estimado;
Desconozco el trabajar con otra lengua que no sea la española.
Quizás debas mirar el Manual de MySQL. Desde esta dirección, si no contas con uno, lo podes bajar:
[url:l5xh5wfi]https://www.box.com/s/sl1yf2vjn4ver4skjgud[/url:l5xh5wfi]
En el manual, que te indico, hay un punto: [b:l5xh5wfi]9.1 Valores Literales[/b:l5xh5wfi]. Alli te muestra como hacer un Select ingresando un COLLATE
Saludos |
CodePage UTF8 | Muy buenas, lo que intento es poner mi aplicacion con
request HB_CODEPAGE_UTF8
request HB_CODEPAGE_UTF16LE
pero me da error al compilar, yo tengo xHarbour 1.1.0 y FWH 9.01
¿me podeis ayudar con esto?
Un Saludo. |
CodeProject.AI Server | Hi friends !
A great link about AI [url:33ju7wg3]https://github.com/codeproject/CodeProject.AI-Server[/url:33ju7wg3]
[url:33ju7wg3]https://www.codeproject.com/Articles/5322557/CodeProject-AI-Server-AI-the-easy-way[/url:33ju7wg3]
Kind regards, |
CodeProject.AI Server | thank you very much Félix!
Great finding !!! |
Codebar + Camera | Hi Guys,
I need to read some codebars using the camera of a windows tablet. Is it possible ? Do you know how to do? |
Codebar + Camera | Vilian,
With this code you could take the screenshot:
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?p=193463#p193463">viewtopic.php?p=193463#p193463</a><!-- l -->
Next, you may use a commercial SDK or implement a GetPixel() based function |
Codebar + Camera | Antonio,
Thanks. Do you know some SDK ? |
Codebar + Camera | I googled and found some that look interesting but I have not used them |
Codeblock Using Position Out Of An Array | Hi,
untill now I had hardcoded the codeblocks for every column of a xBrowse, like
[code=fw:1skdsz0l]<div class="fw" id="{CB}" style="font-family: monospace;">oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span>:<span style="color: #000000;">bLClickHeader</span> := <span style="color: #000000;">{</span>|| Sort<span style="color: #000000;">(</span><span style="color: #000000;">1</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span><br />oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>:<span style="color: #000000;">bLClickHeader</span> := <span style="color: #000000;">{</span>|| Sort<span style="color: #000000;">(</span><span style="color: #000000;">3</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span><br />oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span>:<span style="color: #000000;">bLClickHeader</span> := <span style="color: #000000;">{</span>|| Sort<span style="color: #000000;">(</span><span style="color: #000000;">2</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span><br /> </div>[/code:1skdsz0l]
this worked fine, but now I want to assign the numbers using an array like
[code=fw:1skdsz0l]<div class="fw" id="{CB}" style="font-family: monospace;">aSort := <span style="color: #000000;">{</span> <span style="color: #000000;">3</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">}</span><br /><span style="color: #00C800;">for</span> nI := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> len<span style="color: #000000;">(</span>oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">)</span><br /> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span>nI<span style="color: #000000;">]</span>:<span style="color: #000000;">bLClickHeader</span> := <span style="color: #000000;">{</span>|| <span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">(</span>aSort<span style="color: #000000;">[</span>nI<span style="color: #000000;">]</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span><br /><span style="color: #00C800;">next</span></div>[/code:1skdsz0l]
But if I click a header, doesn't matter which one, I always get as a response "2" (the last item of the array), but I wanted by clicking at the header at the first column a "3" and on the second column a "1"
Do you have any suggestion how to solve this problem? |
Codeblock Using Position Out Of An Array | Gilbert,
You have to use a "detached local." Search the form for more info.
James |
Codeblock Using Position Out Of An Array | James,
thank you very much for your quick response.
However, I found an alternative solution and wonder, if I might encounter problems, because I use an object that is marked "used internally" in the source code of TXbrowse:
Here my working solution:
[code=fw:8cz335z8]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">FOR</span> nI := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> len<span style="color: #000000;">(</span>aSort<span style="color: #000000;">)</span><br /> oLB:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span>nI<span style="color: #000000;">]</span>:<span style="color: #000000;">Cargo</span> := nI <span style="color: #B900B9;">// first I use the "Cargo"-Information to remember, which column-number I have to deal with</span><br /> oCol := oLB:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span>nI<span style="color: #000000;">]</span><br /> <span style="color: #00C800;">IF</span> aSort<span style="color: #000000;">[</span>nI<span style="color: #000000;">]</span> > <span style="color: #000000;">0</span><br /> oCol:<span style="color: #000000;">bLClickHeader</span> := <span style="color: #000000;">{</span>|| <span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">(</span>aSort<span style="color: #000000;">[</span>oLB:<span style="color: #000000;">oCapCol</span>:<span style="color: #000000;">Cargo</span><span style="color: #000000;">]</span><span style="color: #000000;">)</span> <span style="color: #000000;">}</span> <span style="color: #B900B9;">// oLB:oCapCol is marked as "used internally"</span><br /> <span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">NEXT</span><br /> </div>[/code:8cz335z8] |
Codeblock Using Position Out Of An Array | Gilbert,
Generally, Antonio uses those comments to signify that a var should not be used outside the class. Ideally, these vars should be made "hidden" so that cannot be used or even seen outside the class. So, the answer is that you should never change those vars.
So I still think you should use a detached local.
James |
Codeblock Using Position Out Of An Array | From version 8.03 onwards, it is no more necessary to code like
[code=fw:3293wzgh]<div class="fw" id="{CB}" style="font-family: monospace;">oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>:<span style="color: #000000;">bLClickHeader</span> := <span style="color: #000000;">{</span>|| Sort<span style="color: #000000;">(</span><span style="color: #000000;">3</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span></div>[/code:3293wzgh] for sorting on columns.
Please see whatsnew.txt:
[quote:3293wzgh] b) New DATA cSortOrder. It is now not necessary to do the tedious coding of
oCol:bLclickHeader to enable sorting of data in response the Left Click on the header.
Assiging the name of index order in case of RDD, column names in case of ADO or the
column number of array to the Data cSortOrder is all that is needed.
[/quote:3293wzgh]
So the proposed code
[code=fw:3293wzgh]<div class="fw" id="{CB}" style="font-family: monospace;">aSort := <span style="color: #000000;">{</span> <span style="color: #000000;">3</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">}</span><br /><span style="color: #00C800;">for</span> nI := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> len<span style="color: #000000;">(</span>oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">)</span><br /> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span>nI<span style="color: #000000;">]</span>:<span style="color: #000000;">bLClickHeader</span> := <span style="color: #000000;">{</span>|| <span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">(</span>aSort<span style="color: #000000;">[</span>nI<span style="color: #000000;">]</span><span style="color: #000000;">)</span><span style="color: #000000;">}</span><br /><span style="color: #00C800;">next</span><br /> </div>[/code:3293wzgh]
can be written as
[code=fw:3293wzgh]<div class="fw" id="{CB}" style="font-family: monospace;">aSort := <span style="color: #000000;">{</span> <span style="color: #000000;">3</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">}</span><br /><span style="color: #00C800;">for</span> nI := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> len<span style="color: #000000;">(</span>oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">)</span><br /> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">[</span>nI<span style="color: #000000;">]</span>:<span style="color: #000000;">cSortOrder</span> := aSort<span style="color: #000000;">[</span> nI <span style="color: #000000;">]</span><br /><span style="color: #00C800;">next</span><br /> </div>[/code:3293wzgh] |
Codeblock Using Position Out Of An Array | I don't know if this helps, but you can also define the sort order using index tags.
add column to oBrw data company header "Company" order "company"
Regards,
James |
Codeblock Using Position Out Of An Array | [quote="James Bott":3fmel5ve]
add column to oBrw data company header "Company" order "company"
James[/quote:3fmel5ve]
Yes.
Similarly for arrays
[code=fw:3fmel5ve]<div class="fw" id="{CB}" style="font-family: monospace;"><br />ADD <span style="color: #0000ff;">TO</span> oBrw ARRAY ELEMENT <span style="color: #000000;">2</span> ORDER <span style="color: #000000;">3</span></div>[/code:3fmel5ve]
This is internally translated as oCol:cSortOrder := 3 |
Codeblock a string | Necesito guardar un codeblock en una variable , pero en formato string.
bblock:= {|| msginfo("hola") }
usar una function algo asi como blcktostr(bblock ) que devuelva : ' {|| msginfo("hola") } '
existe alguna funcion ?
Saludos a todos. |
Codeblock a string | Mastintin,
Creo que eso que buscas no existe... los codeblocks son codigo compilado... otra cosa es que el genial przemek haya inventado algo...
Un invento que quiza te podria ayudar; se trataria de crear un nuevo tipo K que en realidad es un array:
#Translate CBNew(<b>) => {<b>, <(b)>}
#Translate CBEval(<kCB>) => Eval(<kCB>\[1\])
#Translate CBString(<kCB>) => <kCB>\[2\]
Ejemplos
k:= CBNew({|| MsgInfo("probando...")})
? CBEval(k)
? CBString(k)
Espero te pueda servir. |
Codeblock a string | [quote="hmpaquito":1s7ol1xk]Mastintin,
Creo que eso que buscas no existe... los codeblocks son codigo compilado... otra cosa es que el genial przemek haya inventado algo...
Un invento que quiza te podria ayudar; se trataria de crear un nuevo tipo K que en realidad es un array:
#Translate CBNew(<b>) => {<b>, <(b)>}
#Translate CBEval(<kCB>) => Eval(<kCB>\[1\])
#Translate CBString(<kCB>) => <kCB>\[2\]
Ejemplos
k:= CBNew({|| MsgInfo("probando...")})
? CBEval(k)
? CBString(k)
Espero te pueda servir.[/quote:1s7ol1xk]
Pues Casi ,pero no sirve.
Se trata de por ejemplo :
oDlg:bpaint := {|| msginfo("algo") }
y en la clase tdlg en cGenprg()
if !Empty(::bpainted)
cPrg += CRLF + ' oWnd:bpainted:= " '+ blocktostr(::bpainted)+' " ' +CRLF
endif
o algo similar .... |
Codeblock a string | Entiendo que si no quieres modificar las clases originales de fwh o bien no quieres utilizar un pseudo tipo, la cosa no tiene arreglo...
Para el caso que dices, yo lo que haria seria:
#Define CBBlock(<k>) <k>\[1\]
1º A la clase dialog, crearle una nueva data: bkPainted
2º En la definicion previa del dialogo ::bkPainted:= CBNew({|| MsgInfo("algo")})
3º En el Activate del dialog asignar ::bPainted:= CBBlock(::bkPainted)
4º En el cGenPrg cPrg += CRLF + ' oWnd:bpainted:= " '+ CBString(::bkPainted)+' " ' +CRLF
Saludos |
Codeblock a string | [quote="hmpaquito":2nnbca30]Entiendo que si no quieres modificar las clases originales de fwh o bien no quieres utilizar un pseudo tipo, la cosa no tiene arreglo...
Para el caso que dices, yo lo que haria seria:
#Define CBBlock(<k>) <k>\[1\]
1º A la clase dialog, crearle una nueva data: bkPainted
2º En la definicion previa del dialogo ::bkPainted:= CBNew({|| MsgInfo("algo")})
3º En el Activate del dialog asignar ::bPainted:= CBBlock(::bkPainted)
4º En el cGenPrg cPrg += CRLF + ' oWnd:bpainted:= " '+ CBString(::bkPainted)+' " ' +CRLF
Saludos[/quote:2nnbca30]
Aun mas simple , una nueva data cbpainted en la clase twindows donde guardo "el literar " del codeblock ( CBString(::bkPainted) ) y asunto solucionado , pero saber si existia alguna fucion tipo HB_serialicer o algo asi .
Muchas gracias por la respuesta , me ha sido de utilidad, le volvere a dar otra vuelta de cabeza. |
Codeblocks y punteros a funciones (Closures?) | Los codeblock al ser un tipo de dato se pueden pasar como parámetros de funciones lo cual le da muchísima potencia a nuestros programas.
Fue una revolución el cambio de la macrocompilación por codeblocks.
En la época en que se creó el tipo de dato CodeBlock había muy pocos lenguajes que lo tuvieran... desde hace relativamente poco tiempo otros lenguajes lo han incorporado con el nombre de "Closures" o "funciones anónimas".
Pero incluso ahora con el uso de la clase Symbol se pueden hacer cosas muy chulas:
[code=fw:3gg5mhqo]<div class="fw" id="{CB}" style="font-family: monospace;"><br />PROCEDURE Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">LOCAL</span> oSym := Symbol<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"QOUT"</span> <span style="color: #000000;">)</span><br /><br /> ? <span style="color: #ff0000;">"Now test the :Exec() method"</span><br /><br /> oSym:<span style="color: #000000;">Exec</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"This string is being printed by QOUT"</span> <span style="color: #000000;">)</span><br /> oSym:<span style="color: #000000;">Exec</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"which is being invoked by the :Exec()"</span> <span style="color: #000000;">)</span><br /> oSym:<span style="color: #000000;">Exec</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"method in the Symbol class."</span> <span style="color: #000000;">)</span><br /><br /> ?<br /> ? <span style="color: #ff0000;">"symbol name: "</span>, oSym:<span style="color: #0000ff;">name</span><br /><br /> ? <span style="color: #ff0000;">"Comparing QOut symbol with xOut symbol"</span><br /> ? oSym:<span style="color: #000000;">IsEqual</span><span style="color: #000000;">(</span> Symbol<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"xOut"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> ? <span style="color: #ff0000;">"done!"</span><br /> ?<br /><br /> <span style="color: #00C800;">RETURN</span><br /> </div>[/code:3gg5mhqo]
Y el no va mássssssssssss podemos usar punteros a funciones, lo cual va un paso más allá de los codeblocks:
[code=fw:3gg5mhqo]<div class="fw" id="{CB}" style="font-family: monospace;">procedure main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> pFunc := @alert<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> <br /> pFunc:<span style="color: #000000;">exec</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"Esto es una prueba de puntero a la funcion Alert()"</span> <span style="color: #000000;">)</span><br /><br /> Alert<span style="color: #000000;">(</span> pFunc:<span style="color: #0000ff;">name</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">// Devuelve el nombre de la funcion apuntada</span><br /> <br /> pFunc := @upper<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> pruebaPuntero<span style="color: #000000;">(</span> pFunc <span style="color: #000000;">)</span> <span style="color: #B900B9;">// Llama a una funcion pasando un puntero a funcion</span><br /><br /> <span style="color: #00C800;">return</span><br /><br /> procedure pruebaPuntero<span style="color: #000000;">(</span> p <span style="color: #000000;">)</span><br /><br /> alert<span style="color: #000000;">(</span> p:<span style="color: #000000;">exec</span><span style="color: #000000;">(</span> <span style="color: #ff0000;">"esto lo veras en mayusculas"</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">return</span><br /> </div>[/code:3gg5mhqo]
Harbour tiene muchos secretos que lo convierten en un lenguaje super potente y de futuro...
Te imaginas Harbour en la web?
Pues eso es posible con Mod_Harbour!!! |
Codeblocks y punteros a funciones (Closures?) | Excelente Manu!
Esa no me la sabía, gracias! Lo pondré en practica en mis futuros códigos.
Saludos
Carlos |
Codeblocks y punteros a funciones (Closures?) | El lenguaje C es el primero (que yo sepa) que habla de "punteros" que es una forma de decir "direcciones"
Un puntero apunta a algo. Una dirección es donde hay algo. El puntero apunta a un lugar, a una dirección, donde hay algo.
un bloque de código es una variable que apunta a un código, que contiene una secuencia de pcode.
La belleza de Clipper fué el establecer un paralelismo entre un lenguaje a muy bajo nivel (asm y lenguaje C) y otro a alto nivel, equilibrando perfectamente el "interior" (puro C) con el "exterior" (puro PRG)
Y Harbour simplemente siguió el camino marcado por Clipper 5 (Five). El estandard <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
El 5 por numerología también hace referencia al conocimiento oculto, a lo que habia que aprender para construir un compilador. Algo que todos usabamos (los OBJs) pero desconociamos como se generaban. Tocaba y sigue tocando aprender... |
Codeblocks y punteros a funciones (Closures?) | Enhorabuena por las explicaciones, realmente son temas que pueden 'marcar' un desarrollo, conocer estas utilidades 'indocumentadas'
Lamentablemente, harbour en temas 'avanzados' adolece de buena documentación a nivel de 'desarrollador de PRG'
Tener el codigo fuente (en C) no es garantía de documentación ya que muchas veces no llegaremos a descubrir realmente su funcionalidad
Explicar el tema de los punteros de la forma tan simple y pedagógica es de agradecer, tengo libros que casi en su totalidad dedican espacio a este tema y al final, aún estás más confundido que al inicio de la lectura
Una búsqueda en el repositorio de harbour, para obtener información de la clase Symbol me lleva a
[code=fw:la36fpyf]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> * Harbour implementation <span style="color: #0000ff;">of</span> <span style="color: #00C800;">Class</span><span style="color: #000000;">(</span>y<span style="color: #000000;">)</span> <span style="color: #00C800;">Class</span> Symbol<br /> * Copyright <span style="color: #000000;">2003</span> Antonio Linares <alinares@fivetechsoft.com><br /> */<br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"hbclass.ch"</span><br /><br />CREATE <span style="color: #00C800;">CLASS</span> Symbol<br /> </div>[/code:la36fpyf]
Que a su vez es un envoltorio de las funciones dynsym
[code=fw:la36fpyf]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> __dynsCount<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> __dynsGetName<span style="color: #000000;">(</span> nPos <span style="color: #000000;">)</span><br /> __dynsGetIndex<span style="color: #000000;">(</span> <span style="color: #ff0000;">"MAIN"</span> <span style="color: #000000;">)</span><br /> </div>[/code:la36fpyf]
Quizá para los que no tenemos memoria, nos podríais ilustrar qué significó Class(y) para el mundo xBase y como fué su aportación a Harbour
Saludos a todos y felices fiestas ! |
Codeblocks y punteros a funciones (Closures?) | Cuando Clipper 5 apareció (algunos tuvimos la suerte de tenerlo antes, en mi caso mi buen amigo Carlos Segura me lo envió) descubrimos con sorpresa que podiamos crear y usar objetos pero Nantucket habia decidido no darnos aún la capacidad de crear y usar nuevas clases. Esto era realmente frustrante <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Dentro de las librerías de Clipper, el módulo "osend" (creo recordar) era el Santo Grial por descifrar. Anton Van Straaten desde sudAfrica vió la oportunidad de negocio y comenzó a construir Class(y). Yo le llamé por teléfono e intenté que entendiese la importancia de dar un módulo runtime gratis para todos. Todos teniamos que crear y usar nuevas clases y era la única forma que todos pudiésemos usarlas de forma general. El me ignoró rotundamente <!-- s:-D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":-D" title="Very Happy" /><!-- s:-D --> Algo que años más tarde sucedería exactamente igual con Stephen Pirsig, lider de xBase++.
En aquel entonces aun no había internet. Solo las BBSs y CompuServe. Y un buen dia, por arte de magia, en las BBSs, apareció un módulo sin nombre, ni autoria, nada... que para sorpresa de todos permitía usar el módulo indocumentado "osend" de Clipper 5. Aquello fué un antes y un después. Libertad para programar con nuevas clases y sin tener que pasar por caja obligatoriamente...
Mi buen amigo Francisco Pulpón lo estudió a fondo, obsesionado en conseguir la máxima velocidad, y asi nació la librería "objects" que se usó para construir FiveWin. Ya no hacia falta Class(y). De hecho no estabamos de acuerdo con determinadas claúsulas usadas por Class(y). Querian usar "INSTVAR" cuando lo más lógico era "DATA". Introdujimos las nuevas cláusulas INLINE (algo que venia de C++, los métodos inline), VIRTUAL, BLOCK, etc. y decidimos llevarlo a Clipper.
El código fuente inicial de "objects" fué donado para Harbour y fué completado por muchos colaboradores en el desarrollo de Harbour. Y es el que usamos todos cada dia de forma libre en nuestra grandiosa comunidad de usuarios Harbour.
Harbour nos sobrevivirá a todos los Clipperos de corazón y Harbourianos. Libertad, solidaridad, transparencia... ese es nuestro legado. Esta es la grandeza de lo que hemos construido entre todos <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> |
Codeblocks y punteros a funciones (Closures?) | [quote:uv3xokft]Y un buen dia, por arte de magia, en las BBSs, apareció un módulo sin nombre, ni autoria,[/quote:uv3xokft]
La magia existe, lo hemos visto en esta bonita historia de Navidad
Pues no se me ocurre como usar la clase Symbol o los punteros a funciones... Debo estar oxidado |
Codeblocks y punteros a funciones (Closures?) | Paco,
> Pues no se me ocurre como usar la clase Symbol o los punteros a funciones... Debo estar oxidado
Esa clase la escribí simplemente para demostrar que podiamos tenerla igual que Class(y) la tenía
pero, igual que tú, nunca le encontré una utilidad <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Pero quien sabe, cuando de repente pueda ser parte de un puzzle aun por resolver ? |
Codejock Calendar | Hello.
Anyone is using Codejock Calendar 15 with succeed?.
I tried Reinaldo sample but does not work. It gives me such type of errors
[code=fw:qini77m9]<div class="fw" id="{CB}" style="font-family: monospace;"> WINOLE/<span style="color: #000000;">1007</span> Argument error: <span style="color: #000000;">WORKDAYSTARTTIME</span></div>[/code:qini77m9]
It only works:
[code=fw:qini77m9]<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: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <br /> <span style="color: #00C800;">local</span> oWnd, oAct<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /> oAct := TActiveX<span style="color: #000000;">(</span><span style="color: #000000;">)</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">(</span> oWnd, <span style="color: #ff0000;">"Codejock.CalendarControl.15.1.2"</span>, <span style="color: #000000;">10</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">1000</span>, <span style="color: #000000;">550</span> <span style="color: #000000;">)</span> <br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /> </div>[/code:qini77m9]
I will apreciate very much your feedback.
Thanks a lot. |
Codejock Calendar | I just returned from a very much needed vacation ! Sorry for the delay.
Yes, I am using Codejock Calendar and will be very happy to share our class with you. Please email me : <!-- e --><a href="mailto:timstone@mlsdg.onmicrosoft.com">timstone@mlsdg.onmicrosoft.com</a><!-- e --> and I will send it to you.
I have used it with xHarbour ( .com, Sep 2010 ) and I'm trying to get it to work with Harbour and Visual C++ 2010, but still have a problem. However, I did take a break, and also now have been rebuilding my computer so the project is delayed. Perhaps this week I will get back to it 100%.
Tim |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.