topic
stringlengths
1
63
text
stringlengths
1
577k
nClrPane
Hola, como se dice : una imagen vale mas que mil palabras <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> A esto me refiero, no se si es lo que Manuel desea. [img:11nkv91l]http&#58;//img116&#46;imageshack&#46;us/img116/6681/brw2clrdz6&#46;jpg[/img:11nkv91l] A diferencia del color alternado por registro, este browse cambia el color por X numero de registros que contenga una poliza. Saludos a todos
nClrPane
Muchas gracias, Raymundo. Es lo que buscaba. Me pongo a ello ahora mismo. Un saludo, Manuel
nClrPane
[quote="Raymundo Islas M.":35vy2roc]Manuel Basta con que agregues un campo adicional ( normalmente uso un numerico de 1 digito ) y al momento de estar "llenando" la base a mostrar vas alternando el valor de ese campo ( normalmente uso 0-1 ) y solo cambias el codigo por esto : oLbx:nClrPane:={|| IIF(CLIENTES->TuCampo ==1,CLR_WHITE,CLR_LGRAY)} Asi lo he usado y hace exactamente lo que quieres hacer. Saludos[/quote:35vy2roc] Buenas Raymundo, Nao estou entende bem, eu teria q usar alguma funçao ? Vc poderia me passar algum exemplo ? Fico grato pela atençao. @braços Ale
nClrPane
Hola, un pequeñito ejemplo, de hecho no tiene gran ciencia hacer esto <!-- s8) --><img src="{SMILIES_PATH}/icon_cool.gif" alt="8)" title="Cool" /><!-- s8) --> REDEFINE LISTBOX lbKrdOpr ; FIELDS DETKDX->KDAT,DETKDX->KPOL, ..... ; HEAD "FECHA","POLIZA", ...... ; bla ; bla ; bla ; OF oFold:aDialogs[7] bla ; bla ; bla ; [color=red:13gionib]lbKrdOpr:nClrPane := { || IIF( DETKDX->KCLR == 0, CLR_A, CLR_B ) } <--- Aqui[/color:13gionib] Static Function XXXXXXX() // para "llenar" la base o arreglo LOCAL nQ, [color=red:13gionib]nClrFlg := 0[/color:13gionib] FOR nQ := aKrdDts[4] TO aKrdDts[5] IF MOVSYS->( DbSeek( DtoS( nQ ) ) ) WHILE MOVSYS->MFECHA == nQ .AND. MOVSYS->( !Eof() ) nKrdxPol := MOVSYS->MPOL WHILE MOVSYS->MPOL == nKrdxPol .AND. MOVSYS->( !Eof() ) DETKDX->KDAT := XXXXXX DETKDX->KPOL := YYYYYY MOVSYS->( DbSkip() ) ENDDO [color=red:13gionib]nClrFlg ++ <--- Aqui nClrFlg := IIF( nClrFlg == 2, 0, nClrFlg ) <--- Aqui[/color:13gionib] ENDDO ENDIF NEXT lbKrdOpr:REFRESH() Saludos
nClrPane
Sorry <!-- s:oops: --><img src="{SMILIES_PATH}/icon_redface.gif" alt=":oops:" title="Embarassed" /><!-- s:oops: --> Se me paso la linea donde se graba el valor que indica el color a usar : Static Function XXXXXXX() // para "llenar" la base o arreglo LOCAL nQ, [color=red:5huhd08a]nClrFlg := 0[/color:5huhd08a] FOR nQ := aKrdDts[4] TO aKrdDts[5] IF MOVSYS->( DbSeek( DtoS( nQ ) ) ) WHILE MOVSYS->MFECHA == nQ .AND. MOVSYS->( !Eof() ) nKrdxPol := MOVSYS->MPOL WHILE MOVSYS->MPOL == nKrdxPol .AND. MOVSYS->( !Eof() ) DETKDX->KDAT := XXXXXX DETKDX->KPOL := YYYYYY [color=red:5huhd08a]DETKDX->KCLR := nClrFlg[/color:5huhd08a] <--- Aqui MOVSYS->( DbSkip() ) ENDDO [color=red:5huhd08a]nClrFlg ++ [/color:5huhd08a]<--- Aqui [color=red:5huhd08a]nClrFlg := IIF( nClrFlg == 2, 0, nClrFlg )[/color:5huhd08a] <--- Aqui ENDDO ENDIF NEXT lbKrdOpr:REFRESH()
nClrPane
Raymundo, Que soberbio ejemplo, mezcla de simplicidad, practicidad y buen gusto. Gracias por compartirlo con nosotros. <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
nClrPane
Hola Jose Agradezco mucho tu comentario ! <!-- s:P --><img src="{SMILIES_PATH}/icon_razz.gif" alt=":P" title="Razz" /><!-- s:P --> Saludos
nClrText em ButtonBmp não funciona
Estou tentando trocar a cor do Texto do botão em ButtomBmp mais não funciona. To fazendo assim: oBtnCancel:nClrText := CLR_HRED Ja tentei SetColor, SetTextColor(oBtnCancel:hDC,CLR_HRED) também não funciona. Alguem tem outra solução ?
nClrText em ButtonBmp não funciona
Use BTNBMP: <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=6&t=28630&p=160415&hilit=botones#p160415">viewtopic.php?f=6&t=28630&p=160415&hilit=botones#p160415</a><!-- l --> [code=fw:3qvoc708]<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: #B900B9;">//--------------------------//BOTONES DE DIFERENTES COLORES</span><br /><span style="color: #00C800;">Function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp; <span style="color: #B900B9;">//ColorBtns()</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDlg,oBt1,oBt2<br /><br />&nbsp; &nbsp;SkinButtons<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><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;">5</span>,<span style="color: #000000;">5</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">10</span>,<span style="color: #000000;">60</span> <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"BOTONES DE COLORES"</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">3</span>,<span style="color: #000000;">2</span> &nbsp;<span style="color: #0000ff;">BTNBMP</span> oBt1 <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Un Color"</span> &nbsp; <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">60</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Nada que hacer"</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">3</span>,<span style="color: #000000;">80</span> <span style="color: #0000ff;">BTNBMP</span> oBt2 <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"Otro Color"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">60</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">ACTION</span> oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;Color_oBot<span style="color: #000000;">&#40;</span>oBt1,<span style="color: #ff0000;">"ORO"</span><span style="color: #000000;">&#41;</span> &nbsp; <span style="color: #B900B9;">// ouro</span><br /><br />&nbsp; &nbsp;Color_oBot<span style="color: #000000;">&#40;</span>oBt2,<span style="color: #ff0000;">"PLATA"</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// prata</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">Centered</span><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">nil</span><br /><span style="color: #B900B9;">//------------------------------</span><br /><span style="color: #00C800;">Function</span> Color_oBot<span style="color: #000000;">&#40;</span>oBot,cColor<span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">DEFAULT</span> cColor := <span style="color: #00C800;">NIL</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> !cColor = <span style="color: #00C800;">NIL</span><br /><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> cColor = <span style="color: #ff0000;">"ORO"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; oBot:<span style="color: #000000;">bClrGrad</span> = <span style="color: #000000;">&#123;</span> | lMouseOver | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ! lMouseOver,;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1.00</span>,<span style="color: #000000;">14481663</span>,<span style="color: #000000;">38075</span> <span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span> <span style="color: #000000;">1.00</span>,<span style="color: #000000;">38075</span>,<span style="color: #000000;">14481663</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">0.10</span>,<span style="color: #000000;">16777215</span>,<span style="color: #000000;">9363707</span> <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span> <span style="color: #000000;">0.10</span>,<span style="color: #000000;">9363707</span>,<span style="color: #000000;">16777215</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; oBot:<span style="color: #000000;">SetColor</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; elseif cColor = <span style="color: #ff0000;">"PLATA"</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; oBot:<span style="color: #000000;">bClrGrad</span> = <span style="color: #000000;">&#123;</span> | lMouseOver | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ! lMouseOver,;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">0.30</span>,<span style="color: #000000;">12961221</span>,<span style="color: #000000;">16777215</span> <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span> <span style="color: #000000;">0.30</span>,<span style="color: #000000;">16777215</span>,<span style="color: #000000;">12961221</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">0.10</span>,<span style="color: #000000;">9363707</span>,<span style="color: #000000;">16777215</span> <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span> <span style="color: #000000;">0.10</span>,<span style="color: #000000;">16777215</span>,<span style="color: #000000;">9363707</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; oBot:<span style="color: #000000;">SetColor</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:3qvoc708]
nClrText em ButtonBmp não funciona
Try with this <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=6&t=12759#p210406">viewtopic.php?f=6&t=12759#p210406</a><!-- l -->
nCounter Report not run ok RESOLVED
Dear Antonio, if I made GROUP ON CU->STATE ; FOOTER " » Total FOR STATE » "+::oReport:aGroups[1]:cValue +"("+ltrim(str(::oReport:aGroups[1]:nCounter))+")" ; FONT 1 [b:dh6domgo]oReport:nCounter is right [/b:dh6domgo] for each group and the total counter is right If I not use Groups but only easy bfor sample : ACTIVATE REPORT oReport [b:dh6domgo]FOR dInicio <= CU->HIREDATE .AND. CU->HIREDATE <= dFinal[/b:dh6domgo] ; ON END ( oReport:StartLine(), oReport:EndLine(), oReport:StartLine(), ; oReport:Say(1, 'Total customers: '+Tran(oReport:nCounter, '@E 999,999'), 1),; oReport:EndLine() ) give me bad nCounter SO IFI wish print only the hiredate from 01/01/1990 to 01/011991 execute the codeblock bfor ( FOR dInicio <= CU->HIREDATE .AND. CU->HIREDATE <= dFinal ) because it print only 57 records then print on say "total customers " [b:dh6domgo] 500[/b:dh6domgo] [img:dh6domgo]https&#58;//i&#46;postimg&#46;cc/zDMTNdF4/h&#46;jpg[/img:dh6domgo] why ? here the test (rep21.prg) [code=fw:dh6domgo]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"report.ch"</span><br /><br />request DBFCDX<br /><br /><span style="color: #00C800;">STATIC</span> oReport<br /><br /><span style="color: #00C800;">Function</span> Rep21<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />     <span style="color: #00C800;">LOCAL</span> oFont1, oFont2, oFont3, oPen1, oPen2<br /><br />     <span style="color: #00C800;">local</span> dInicio :=ctod<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"01/01/1990"</span><span style="color: #000000;">&#41;</span><br />     <span style="color: #00C800;">local</span> dFinal  :=ctod<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"01/01/1991"</span><span style="color: #000000;">&#41;</span><br /><br /><br />     <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont1 <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"ARIAL"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-10</span><br />     <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont2 <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"ARIAL"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-10</span> BOLD<br />     <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont3 <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"ARIAL"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-10</span> BOLD ITALIC<br /><br />     <span style="color: #0000ff;">DEFINE</span> PEN oPen1 WIDTH <span style="color: #000000;">3</span><br />     <span style="color: #0000ff;">DEFINE</span> PEN oPen2 WIDTH <span style="color: #000000;">1</span><br /><br />     USE CUSTOMER <span style="color: #00C800;">NEW</span> VIA <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #0000ff;">ALIAS</span> CU<br />  <span style="color: #B900B9;">//  index on cu->state tag 1 temporary</span><br />      CU-><span style="color: #000000;">&#40;</span>DbGoTop<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br />     REPORT oReport ;<br />          <span style="color: #0000ff;">TITLE</span>  <span style="color: #ff0000;">"*** FiveWin Report DEMO ***"</span>,;<br />                 <span style="color: #ff0000;">""</span>,;<br />                 OemtoAnsi<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"by FiveTech"</span><span style="color: #000000;">&#41;</span>,;<br />                 <span style="color: #ff0000;">""</span> ;<br />          <span style="color: #0000ff;">FONT</span>   oFont1,;<br />                 oFont2,;<br />                 oFont3 ;<br />          PEN    oPen1,;<br />                 oPen2 ;<br />          HEADER <span style="color: #ff0000;">"Date: "</span>+dtoc<span style="color: #000000;">&#40;</span>date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,;<br />                 <span style="color: #ff0000;">"Time:  "</span>+time<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> ;<br />                 <span style="color: #0000ff;">RIGHT</span> ;<br />          FOOTER OemtoAnsi<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Page: "</span><span style="color: #000000;">&#41;</span>+str<span style="color: #000000;">&#40;</span>oReport:<span style="color: #000000;">nPage</span>,<span style="color: #000000;">3</span><span style="color: #000000;">&#41;</span> ;<br />                 <span style="color: #0000ff;">CENTERED</span> ;<br />          PREVIEW<br /><br />    <span style="color: #B900B9;">/*  <br />                 //FOR TEST a GROUP<br /> GROUP ON CU->State ;<br />           FOOTER "Total State "+oReport:aGroups[1]:cValue+ ;<br />                  " ("+ltrim(str(oReport:aGroups[1]:nCounter))+")" ;<br />           FONT 2<br />      */</span><br />     COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"ST"</span> ;<br />          <span style="color: #00C800;">DATA</span> CU->State ;<br />          <span style="color: #0000ff;">FONT</span> <span style="color: #000000;">2</span>  ;<br />          GRID <span style="color: #000000;">2</span><br /><br />     COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"City"</span> ;<br />          <span style="color: #00C800;">DATA</span> CU->City ;<br />          GRID <span style="color: #000000;">2</span><br /><br />     COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"First Name"</span>,<span style="color: #ff0000;">"Last Name"</span> ;<br />          <span style="color: #00C800;">DATA</span> CU->First , CU->Last ;<br />          GRID <span style="color: #000000;">2</span><br /><br />     COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"   Salary"</span> ;<br />          <span style="color: #00C800;">DATA</span> CU->Salary ;<br />          <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"9,999,999"</span> ;<br />          <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">9</span> ;<br />          TOTAL ;<br />          SHADOW ;<br />          GRID<br /><br />     END REPORT<br /><br />     <span style="color: #00C800;">IF</span> oReport:<span style="color: #000000;">lCreated</span><br /><br />          <span style="color: #B900B9;">/*<br />          First line of title bold<br />          */</span><br /><br />          oReport:<span style="color: #000000;">oTitle</span>:<span style="color: #000000;">aFont</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> := <span style="color: #000000;">&#123;</span>|| <span style="color: #000000;">2</span> <span style="color: #000000;">&#125;</span><br /><br />          <span style="color: #B900B9;">/*<br />          Total descriptors<br />          */</span><br /><br />          oReport:<span style="color: #000000;">cGrandTotal</span> := <span style="color: #ff0000;">"Grand Total..."</span><br />          oReport:<span style="color: #000000;">cPageTotal</span> := <span style="color: #ff0000;">"Page Total..."</span><br /><br />          <span style="color: #B900B9;">/*<br />          Italic when salary greater than 100,000<br />          */</span><br /><br />          oReport:<span style="color: #000000;">aColumns</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bDataFont</span> := <span style="color: #000000;">&#123;</span>|| iif<span style="color: #000000;">&#40;</span>CU->Salary><span style="color: #000000;">100000</span>,<span style="color: #000000;">3</span> ,<span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br /><br />     <span style="color: #00C800;">ENDIF</span><br /><br />     <span style="color: #0000ff;">ACTIVATE</span> REPORT oReport <span style="color: #00C800;">FOR</span> dInicio <= CU->HIREDATE .AND. CU->HIREDATE <= dFinal  ;<br />       <span style="color: #0000ff;">ON</span> STARTGROUP oReport:<span style="color: #000000;">NewLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> ;<br />             <span style="color: #0000ff;">ON</span> END <span style="color: #000000;">&#40;</span> oReport:<span style="color: #000000;">StartLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oReport:<span style="color: #000000;">EndLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oReport:<span style="color: #000000;">StartLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, ;<br />                     oReport:<span style="color: #0000ff;">Say</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span>, <span style="color: #ff0000;">'Total customers: '</span>+Tran<span style="color: #000000;">&#40;</span>oReport:<span style="color: #000000;">nCounter</span>, <span style="color: #ff0000;">'@E 999,999'</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span>,;<br />                     oReport:<span style="color: #000000;">EndLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br /><br />     <span style="color: #B900B9;">/*<br />     Close and release<br />     */</span><br /><br />     oFont1:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />     oFont2:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />     oFont3:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />     oPen1:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />     oPen2:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />     CLOSE CU<br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><br /><br /> </div>[/code:dh6domgo] IF I made ( I saw a Nages topic) [code=fw:dh6domgo]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">local</span> nCounter := <span style="color: #000000;">1</span></div>[/code:dh6domgo] and then [code=fw:dh6domgo]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oReport:<span style="color: #000000;">bFor</span> := <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>dInicio <= CU->HIREDATE .AND. CU->HIREDATE <= dFinal<span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span>nCounter++, .t. <span style="color: #000000;">&#41;</span>, .f. <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br /><br />        <span style="color: #0000ff;">ACTIVATE</span> REPORT oReport   ;<br />       <span style="color: #0000ff;">ON</span> STARTGROUP oReport:<span style="color: #000000;">NewLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> ;<br />             <span style="color: #0000ff;">ON</span> END <span style="color: #000000;">&#40;</span> oReport:<span style="color: #000000;">StartLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oReport:<span style="color: #000000;">EndLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oReport:<span style="color: #000000;">StartLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, ;<br />                     oReport:<span style="color: #0000ff;">Say</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span>, <span style="color: #ff0000;">'Total customers: '</span>+Tran<span style="color: #000000;">&#40;</span>nCounter, <span style="color: #ff0000;">'@E 999,999'</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span>,;<br />                     oReport:<span style="color: #000000;">EndLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span></div>[/code:dh6domgo] we have [b:dh6domgo]58 records[/b:dh6domgo] but I have [u:dh6domgo]only 57 records[/u:dh6domgo] , How it was possible ? [img:dh6domgo]https&#58;//i&#46;postimg&#46;cc/440HjsCp/gg&#46;png[/img:dh6domgo] [b:dh6domgo]TEST WITH GROUP[/b:dh6domgo] But when I use GRoup command with the suggestion of NAges then the total id not right because the records ( with bfor) are allways 57 but the ncounter is 115 [img:dh6domgo]https&#58;//i&#46;postimg&#46;cc/rssWxwBw/hy&#46;png[/img:dh6domgo]
nCounter Report not run ok RESOLVED
We will look into this
nCounter Report not run ok RESOLVED
It seems to be an old bug. I have tested it with version 1204, and the results are the same
nCounter Report not run ok RESOLVED
This is just a guess, but it looks like it is counting report lines instead of records.
nCounter Report not run ok RESOLVED
[quote="Silvio.Falconi":3w6xpwts]Dear Antonio, IF I made ( I saw a Nages topic) [code=fw:3w6xpwts]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">local</span> nCounter := <span style="color: #000000;">1</span></div>[/code:3w6xpwts] and then [code=fw:3w6xpwts]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oReport:<span style="color: #000000;">bFor</span> := <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>dInicio <= CU->HIREDATE .AND. CU->HIREDATE <= dFinal<span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span>nCounter++, .t. <span style="color: #000000;">&#41;</span>, .f. <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTIVATE</span> REPORT oReport &nbsp; ;<br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ON</span> STARTGROUP oReport:<span style="color: #000000;">NewLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ON</span> END <span style="color: #000000;">&#40;</span> oReport:<span style="color: #000000;">StartLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oReport:<span style="color: #000000;">EndLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oReport:<span style="color: #000000;">StartLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oReport:<span style="color: #0000ff;">Say</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span>, <span style="color: #ff0000;">'Total customers: '</span>+Tran<span style="color: #000000;">&#40;</span>nCounter, <span style="color: #ff0000;">'@E 999,999'</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oReport:<span style="color: #000000;">EndLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span></div>[/code:3w6xpwts] we have [b:3w6xpwts]58 records[/b:3w6xpwts] but I have [u:3w6xpwts]only 57 records[/u:3w6xpwts] , How it was possible ? [/quote:3w6xpwts] Silvio: at the beginning, ncounter should be 0
nCounter Report not run ok RESOLVED
I have old exe app ( 16 bit) where the oReport:ncounter run ok also on groups, and I remember I used Ozlib where Report class was a class included I made a research, this problem was from before perhaps 2009 For the test, If you think to found a good solution, You must try with alone , with bfor condition, and group condition
nCounter Report not run ok RESOLVED
[quote="artu01":2r04spoq] Silvio: at the beginning, ncounter should be 0[/quote:2r04spoq] Dear artu01, I have been looking for solutions for a week, turning the forum many times and all my saves from 1992 to today, from fw14.4 to the penultimate 32-bit version of 2020, unfortunately I can't try the 16-bit exes because I have to find old 16-bit PCs and they are easy to find, but believe me I don't remember having problems with this bug on this topic [url:2r04spoq]http&#58;//forums&#46;fivetechsupport&#46;com/viewtopic&#46;php?f=3&t=20817&p=110839&hilit=ncounter#p110839[/url:2r04spoq] Mr NagesWarao explain how we must make there is also a sample , it run for bfor condition but when you try to insert a group not run I used his test sample and I insert group command [code=fw:2r04spoq]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; &nbsp;<span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">'fivewin.ch'</span><br />&nbsp; &nbsp; <span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">'report.ch'</span><br /><br />&nbsp; &nbsp; REQUEST DBFCDX<br /><br />&nbsp; &nbsp; <span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">local</span> cAlias, oWnd<br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> cAlias := OpenData<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> != <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd HIDDEN ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> Report<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, oWnd:<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 />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbCloseArea<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">function</span> Report<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">local</span> oRep, oFont,oFont2<br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">local</span> cAlias &nbsp; := <span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, nCounter := <span style="color: #000000;">0</span><br /><br />&nbsp; &nbsp; &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;">'TAHOMA'</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-9</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont2 <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">'TAHOMA'</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-10</span> bold<br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> PEN oPen1 WIDTH <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> PEN oPen2 WIDTH <span style="color: #000000;">1</span><br /><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;REPORT oRep <span style="color: #0000ff;">FONT</span> oFont,oFont2;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PEN &nbsp; &nbsp;oPen1,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oPen2 ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PREVIEW<br /><br /><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; COLUMN <span style="color: #00C800;">DATA</span> nCounter <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Number"</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">'9999'</span> &nbsp;TOTAL<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"UNIT"</span> <span style="color: #00C800;">DATA</span> <span style="color: #000000;">1</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"999"</span> TOTAL<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"First"</span> <span style="color: #00C800;">DATA</span> <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>->FIRST <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">20</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"State"</span> <span style="color: #00C800;">DATA</span> <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>->STATE <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">5</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Age"</span> <span style="color: #00C800;">DATA</span> <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>->AGE <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"9999"</span> <span style="color: #0000ff;">RIGHT</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Salary"</span> <span style="color: #00C800;">DATA</span> <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>->SALARY &nbsp;<span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"99,999,999.99"</span> <span style="color: #0000ff;">RIGHT</span> &nbsp;TOTAL<br /><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;GROUP <span style="color: #0000ff;">ON</span> <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>->STATE ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FOOTER space<span style="color: #000000;">&#40;</span><span style="color: #000000;">40</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">"Total State "</span>+oRep:<span style="color: #000000;">aGroups</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cValue</span>+ ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">" ("</span>+ltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>oRep:<span style="color: #000000;">aGroups</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nCounter</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">")"</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">FONT</span> <span style="color: #000000;">2</span><br /><br /><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;ENDREPORT<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; oRep:<span style="color: #000000;">bFor</span> := <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>->SALARY > <span style="color: #000000;">25000</span> , <span style="color: #000000;">&#40;</span>nCounter++, .t. <span style="color: #000000;">&#41;</span>, .f. <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTIVATE</span> REPORT oRep ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">ENDPAGE</span> <span style="color: #000000;">&#40;</span> oRep:<span style="color: #000000;">aColumns</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nTotal</span> := nCounter <span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ON</span> END <span style="color: #000000;">&#40;</span> oRep:<span style="color: #000000;">StartLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oRep:<span style="color: #000000;">EndLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oRep:<span style="color: #000000;">StartLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oRep:<span style="color: #0000ff;">Say</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span>, <span style="color: #ff0000;">'Total customers: '</span>+Tran<span style="color: #000000;">&#40;</span>oRep:<span style="color: #000000;">nCounter</span>, <span style="color: #ff0000;">'@E 999,999'</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oRep:<span style="color: #000000;">EndLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br />&nbsp; &nbsp; <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> OpenData<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">local</span> cAlias, lOpen := .f.<br /><br />&nbsp; &nbsp; &nbsp; &nbsp;cAlias := cGetNewAlias<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"CUST"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;USE c:\work\FWH\samples\customer.dbf ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">NEW</span> <span style="color: #0000ff;">ALIAS</span> <span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span> SHARED VIA <span style="color: #ff0000;">'DBFCDX'</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">index</span> <span style="color: #0000ff;">on</span> <span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>->state tag <span style="color: #000000;">1</span> temporary<br />&nbsp; &nbsp; &nbsp; &nbsp;lOpen := <span style="color: #0000ff;">Select</span><span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br /><br />&nbsp; &nbsp; <span style="color: #00C800;">return</span> <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lOpen, cAlias, <span style="color: #ff0000;">''</span> <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:2r04spoq] the condition [b:2r04spoq]oRep:bFor := { || If(( cAlias )->SALARY > 25000 , (nCounter++, .t. ), .f. ) }[/b:2r04spoq] [b:2r04spoq] is not execute[/b:2r04spoq] each total group is ok and also oRep:nCounter for each group at the end the oRep:nCounter is 500
nCounter Report not run ok RESOLVED
[quote="James Bott":1h86fkef]This is just a guess, but it looks like it is counting report lines instead of records.[/quote:1h86fkef] right and I think the bug is on Skip method but now with this [code=fw:1h86fkef]<div class="fw" id="{CB}" style="font-family: monospace;"> <br /><span style="color: #0000ff;">ACTIVATE</span> REPORT oRep ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">ENDPAGE</span> <span style="color: #000000;">&#40;</span> oRep:<span style="color: #000000;">aColumns</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nTotal</span> := nCounter <span style="color: #000000;">&#41;</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ON</span> END <span style="color: #000000;">&#40;</span> oRep:<span style="color: #000000;">StartLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oRep:<span style="color: #000000;">EndLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oRep:<span style="color: #000000;">StartLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oRep:<span style="color: #0000ff;">Say</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span>, <span style="color: #ff0000;">'Total customers: '</span>+Tran<span style="color: #000000;">&#40;</span>nCounter, <span style="color: #ff0000;">'@E 999,999'</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oRep:<span style="color: #000000;">EndLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:1h86fkef] could run ok
nCounter Report not run ok RESOLVED
[b:k6cmg992]OK PERHAPS WE CAN RESOLVED IT [/b:k6cmg992] for the Group command we can use the nCounter of Report class [code=fw:k6cmg992]<div class="fw" id="{CB}" style="font-family: monospace;"><br />GROUP <span style="color: #0000ff;">ON</span> <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>->STATE ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;FOOTER space<span style="color: #000000;">&#40;</span><span style="color: #000000;">40</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">"Total State "</span>+oRep:<span style="color: #000000;">aGroups</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cValue</span>+ ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">" ("</span>+ltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>oRep:<span style="color: #000000;">aGroups</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nCounter</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">")"</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">FONT</span> <span style="color: #000000;">2</span></div>[/code:k6cmg992] for the other we can add on our source nCounter local variable sample [code=fw:k6cmg992]<div class="fw" id="{CB}" style="font-family: monospace;">oRep:<span style="color: #000000;">bFor</span> := <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>dInicio <= <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>->HIREDATE .AND. <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>->HIREDATE <= dFinal<span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#40;</span>nCounter++, .t. <span style="color: #000000;">&#41;</span>, .f. <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ACTIVATE</span> REPORT oRep ; &nbsp;<span style="color: #B900B9;">// &nbsp;ON ENDPAGE ( oRep:aColumns[ 1 ]:nTotal := nCounter ) ;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">ON</span> END <span style="color: #000000;">&#40;</span> oRep:<span style="color: #000000;">StartLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oRep:<span style="color: #000000;">EndLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oRep:<span style="color: #000000;">StartLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oRep:<span style="color: #0000ff;">Say</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span>, <span style="color: #ff0000;">'Total customers: '</span>+Tran<span style="color: #000000;">&#40;</span>nCounter, <span style="color: #ff0000;">'@E 999,999'</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oRep:<span style="color: #000000;">EndLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp;</div>[/code:k6cmg992] it seems bullshit to me but I have not found solutions
nCounter Report not run ok RESOLVED
Please, use this [code=fw:3larm68y]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp; &nbsp;oReport:<span style="color: #000000;">bStartRecord</span> &nbsp;:= <span style="color: #000000;">&#123;</span> || nCounter++ <span style="color: #000000;">&#125;</span><br />&nbsp;</div>[/code:3larm68y] Remove nCounter++ of others lines or clauses
nCounter Report not run ok RESOLVED
[quote="cnavarro":364jtjvd]Please, use this [code=fw:364jtjvd]<div class="fw" id="{CB}" style="font-family: monospace;"><br />     oReport:<span style="color: #000000;">bStartRecord</span>  := <span style="color: #000000;">&#123;</span> || nCounter++ <span style="color: #000000;">&#125;</span><br /> </div>[/code:364jtjvd] Remove nCounter++ of others lines or clauses[/quote:364jtjvd] Error description: Error BASE/1005 Message not found: TREPORT:_BSTARTRECORD Args: [ 1] = O TREPORT Stack Calls =========== Called from: => __ERRRT_SBASE( 0 ) Called from: ../../../tobject.prg => TREPORT:ERROR( 0 ) Called from: ../../../tobject.prg => (b)HBOBJECT( 0 ) Called from: ../../../tobject.prg => TREPORT:MSGNOTFOUND( 0 ) Called from: ../../../tobject.prg => TREPORT:_BSTARTRECORD( 0 ) Called from: rep21.prg => REP21( 96 )
nCounter Report not run ok RESOLVED
[url:2zgir0b6]http&#58;//www&#46;fivetechsupport&#46;com/forums/viewtopic&#46;php?f=3&t=26155&start=15[/url:2zgir0b6]
nCounter Report not run ok RESOLVED
You are used [code=fw:2fg2hd40]<div class="fw" id="{CB}" style="font-family: monospace;"><br />     oRep:<span style="color: #000000;">bStartRecord</span>  := <span style="color: #000000;">&#123;</span> || nCounter++ <span style="color: #000000;">&#125;</span><br />&nbsp;</div>[/code:2fg2hd40] or oReport:bStartRecord ?
nCounter Report not run ok RESOLVED
[quote="cnavarro":39f74m01]You are used [code=fw:39f74m01]<div class="fw" id="{CB}" style="font-family: monospace;"><br />     oRep:<span style="color: #000000;">bStartRecord</span>  := <span style="color: #000000;">&#123;</span> || nCounter++ <span style="color: #000000;">&#125;</span><br /> </div>[/code:39f74m01] or oReport:bStartRecord ?[/quote:39f74m01] yes of course but my question for total customer we must use a local variable for group command we need to use oRep:nCounter Do you think about it.. is normal ?
nCounter Report not run ok RESOLVED
Silvio.. [code=fw:3k2ya768]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oReport:<span style="color: #000000;">aGroups</span><span style="color: #000000;">&#91;</span> nGroup <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nCounter</span><br />&nbsp;</div>[/code:3k2ya768]
nCounter Report not run ok RESOLVED
[quote="carlos vargas":36b4dqgl]Silvio.. [code=fw:36b4dqgl]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oReport:<span style="color: #000000;">aGroups</span><span style="color: #000000;">&#91;</span> nGroup <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nCounter</span><br /> </div>[/code:36b4dqgl][/quote:36b4dqgl] Carlos, I already knew, the problem is: 1) For the command of the groups we must use oReport: aGroups [nGroup]: nCounter 2) To get the total we can no longer use oReport: nCounter (because it makes a mistake) but we have to invent a local variable in our program to count the records, often when we have to print for a certain condition (bFor) It wasn't like that before. I don't remember right now but fw didn't have these problems
nCounter Report not run ok RESOLVED
[quote="Silvio.Falconi":1qwxrhyp][quote="artu01":1qwxrhyp] Silvio: at the beginning, ncounter should be 0[/quote:1qwxrhyp] Dear artu01, I have been looking for solutions for a week, turning the forum many times and all my saves from 1992 to today, from fw14.4 to the penultimate 32-bit version of 2020, unfortunately I can't try the 16-bit exes because I have to find old 16-bit PCs and they are easy to find, but believe me I don't remember having problems with this bug on this topic [url:1qwxrhyp]http&#58;//forums&#46;fivetechsupport&#46;com/viewtopic&#46;php?f=3&t=20817&p=110839&hilit=ncounter#p110839[/url:1qwxrhyp] Mr NagesWarao explain how we must make there is also a sample , it run for bfor condition but when you try to insert a group not run I used his test sample and I insert group command [code=fw:1qwxrhyp]<div class="fw" id="{CB}" style="font-family: monospace;">    <span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">'fivewin.ch'</span><br />    <span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">'report.ch'</span><br /><br />    REQUEST DBFCDX<br /><br />    <span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />       <span style="color: #00C800;">local</span> cAlias, oWnd<br /><br />       <span style="color: #00C800;">if</span> <span style="color: #000000;">&#40;</span> cAlias := OpenData<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> != <span style="color: #00C800;">nil</span><br />          <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br />          <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd HIDDEN ;<br />             <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> Report<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, oWnd:<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: #00C800;">endif</span><br /><br />       <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbCloseArea<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />    <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br />    <span style="color: #00C800;">function</span> Report<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />       <span style="color: #00C800;">local</span> oRep, oFont,oFont2<br />       <span style="color: #00C800;">local</span> cAlias   := <span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, nCounter := <span style="color: #000000;">0</span><br /><br />       <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">'TAHOMA'</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-9</span><br />       <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont2 <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">'TAHOMA'</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-10</span> bold<br /><br />       <span style="color: #0000ff;">DEFINE</span> PEN oPen1 WIDTH <span style="color: #000000;">1</span><br />       <span style="color: #0000ff;">DEFINE</span> PEN oPen2 WIDTH <span style="color: #000000;">1</span><br /><br /><br />       REPORT oRep <span style="color: #0000ff;">FONT</span> oFont,oFont2;<br />                 PEN    oPen1,;<br />                 oPen2 ;<br />                 PREVIEW<br /><br /><br /><br />          COLUMN <span style="color: #00C800;">DATA</span> nCounter <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Number"</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">'9999'</span>  TOTAL<br />          COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"UNIT"</span> <span style="color: #00C800;">DATA</span> <span style="color: #000000;">1</span> <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"999"</span> TOTAL<br />          COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"First"</span> <span style="color: #00C800;">DATA</span> <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>->FIRST <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">20</span><br />          COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"State"</span> <span style="color: #00C800;">DATA</span> <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>->STATE <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">5</span><br />          COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Age"</span> <span style="color: #00C800;">DATA</span> <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>->AGE <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"9999"</span> <span style="color: #0000ff;">RIGHT</span><br />          COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Salary"</span> <span style="color: #00C800;">DATA</span> <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>->SALARY  <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"99,999,999.99"</span> <span style="color: #0000ff;">RIGHT</span>  TOTAL<br /><br /><br />             GROUP <span style="color: #0000ff;">ON</span> <span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>->STATE ;<br />           FOOTER space<span style="color: #000000;">&#40;</span><span style="color: #000000;">40</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">"Total State "</span>+oRep:<span style="color: #000000;">aGroups</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cValue</span>+ ;<br />                  <span style="color: #ff0000;">" ("</span>+ltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>oRep:<span style="color: #000000;">aGroups</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nCounter</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">")"</span> ;<br />           <span style="color: #0000ff;">FONT</span> <span style="color: #000000;">2</span><br /><br /><br /><br />       ENDREPORT<br /><br />        oRep:<span style="color: #000000;">bFor</span> := <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>->SALARY > <span style="color: #000000;">25000</span> , <span style="color: #000000;">&#40;</span>nCounter++, .t. <span style="color: #000000;">&#41;</span>, .f. <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />        <span style="color: #0000ff;">ACTIVATE</span> REPORT oRep ;<br />          <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">ENDPAGE</span> <span style="color: #000000;">&#40;</span> oRep:<span style="color: #000000;">aColumns</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nTotal</span> := nCounter <span style="color: #000000;">&#41;</span> ;<br />           <span style="color: #0000ff;">ON</span> END <span style="color: #000000;">&#40;</span> oRep:<span style="color: #000000;">StartLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oRep:<span style="color: #000000;">EndLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oRep:<span style="color: #000000;">StartLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, ;<br />                     oRep:<span style="color: #0000ff;">Say</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span>, <span style="color: #ff0000;">'Total customers: '</span>+Tran<span style="color: #000000;">&#40;</span>oRep:<span style="color: #000000;">nCounter</span>, <span style="color: #ff0000;">'@E 999,999'</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span>,;<br />                     oRep:<span style="color: #000000;">EndLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />    <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;">static</span> <span style="color: #00C800;">function</span> OpenData<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />       <span style="color: #00C800;">local</span> cAlias, lOpen := .f.<br /><br />       cAlias := cGetNewAlias<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"CUST"</span> <span style="color: #000000;">&#41;</span><br />       USE c:\work\FWH\samples\customer.dbf ;<br />          <span style="color: #00C800;">NEW</span> <span style="color: #0000ff;">ALIAS</span> <span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span> SHARED VIA <span style="color: #ff0000;">'DBFCDX'</span><br />         <span style="color: #0000ff;">index</span> <span style="color: #0000ff;">on</span> <span style="color: #000000;">&#40;</span>cAlias<span style="color: #000000;">&#41;</span>->state tag <span style="color: #000000;">1</span> temporary<br />       lOpen := <span style="color: #0000ff;">Select</span><span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br /><br />    <span style="color: #00C800;">return</span> <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lOpen, cAlias, <span style="color: #ff0000;">''</span> <span style="color: #000000;">&#41;</span><br /> </div>[/code:1qwxrhyp] the condition [b:1qwxrhyp]oRep:bFor := { || If(( cAlias )->SALARY > 25000 , (nCounter++, .t. ), .f. ) }[/b:1qwxrhyp] [b:1qwxrhyp] is not execute[/b:1qwxrhyp] each total group is ok and also oRep:nCounter for each group at the end the oRep:nCounter is 500[/quote:1qwxrhyp] Try this way [code=fw:1qwxrhyp]<div class="fw" id="{CB}" style="font-family: monospace;"><br />ncounter:=<span style="color: #000000;">0</span><br /><br /><br />oRep:<span style="color: #000000;">bFor</span> := <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span> cAlias <span style="color: #000000;">&#41;</span>->SALARY > <span style="color: #000000;">25000</span> ,  .t. , .f. <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />        <span style="color: #0000ff;">ACTIVATE</span> REPORT oRep ;<br />          <span style="color: #0000ff;">ON</span> endgroup <span style="color: #000000;">&#40;</span>ncounter+=oRep:<span style="color: #000000;">aGroups</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nCounter</span><span style="color: #000000;">&#41;</span>;<br />           <span style="color: #0000ff;">ON</span> END <span style="color: #000000;">&#40;</span> oRep:<span style="color: #000000;">StartLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oRep:<span style="color: #000000;">EndLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oRep:<span style="color: #000000;">StartLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, ;<br />                     oRep:<span style="color: #0000ff;">Say</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span>, <span style="color: #ff0000;">'Total customers: '</span>+Tran<span style="color: #000000;">&#40;</span>nCounter, <span style="color: #ff0000;">'@E 999,999'</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span>,;<br />                     oRep:<span style="color: #000000;">EndLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /> </div>[/code:1qwxrhyp]
nCounter Report not run ok RESOLVED
[quote="artu01":3rydivnq] Try this way [/quote:3rydivnq] Dear artu01, we allready resolved [b:3rydivnq]For Groups[/b:3rydivnq] oReport:aGroups[ nGroup ]:nCounter [b:3rydivnq]for bfor and others [/b:3rydivnq] local nCounter:= 0 ... oReport:bStartRecord := { || nCounter++ } ... ACTIVATE REPORT oReport ; .... oReport:Say(1, 'Total customers: '+Tran(nCounter, '@E 999,999'), 1)
nCounter Report not run ok RESOLVED
Excellent!
nDbl2Flt()
Hola a todos. Sigo intentando pasar una aplicación de FW 2.4 a FW 2.7, y estoy a punto de tirar la toalla (No quiero pensar que pasará cuando intente pasarla a 32 bits <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> ). Ahora me ocurre que al mostrar unos controles char2fx me da el siguiente error: Floating Point: Stack Underflow El problema es en una línea donde tengo que pasar un valor float al control VBX: oChart1:Adm[2] := ndbl2flt(nmaximo1). A pesar de haber mirado las modificaciones hechas en FW desde la versión 2.4, no aparece nada relativo a ningún cambio en la función ndbl2flt(), sin embargo si hay un "ligerisímo" cambio, en la versión FW 2.7 hay una línea que pone: if ( d == 0 ) return 0; Línea que no figura en la versión 2.4 Creo que el problema puede ser ese, aunque no controlo C, entiendo que con esa línea añadida el tipo que devuelve no es float cuando el valor es 0, con lo cual el control VBX me da un error, cuando con la versión 2.4 no sucedía. Me imagino que la solución es compilar el fichero dbl2flt.c de FW 2.4 e incluir el OBJ en mi fichero LNK. Si esa es la solución, la pregunta del millón, que hace tiempo conocía y ya se me ha olvidado: ¿ Como compilo ese fichero ? Saludos
nDbl2Flt()
Sebastián, Incluimos ese pequeño cambio por recomendación de Enrico y supusimos que no daría ningún problema. Aqui puedes descargar el OBJ corregido: <!-- m --><a class="postlink" href="http://hyperupload.com/download/d5c74022/DBL2FLT.OBJ.html">http://hyperupload.com/download/d5c7402 ... T.OBJ.html</a><!-- m -->
nDbl2Flt()
Antonio, just try this: ? NDBL2FLT( 0 ) With if ( d == 0 ) return 0; you will get, correctly, 0 while without the above if you will get 1073741824 that is clearly a wrong result (and caused wrong results in one of my programs, that is why I made that change). EMG
nDbl2Flt()
And speaking of nDbl2Flt(), I just noticed that it is not in the libraries but only in source code. Why? EMG
nDbl2Flt()
Sebastian, Funciona bien ahora ? Enrico, Lets see Sebastian's results. Anyhow I am going to review it. Thanks my friend.
nDbl2Flt()
[quote="EnricoMaria":2rizrlko]And speaking of nDbl2Flt(), I just noticed that it is not in the libraries but only in source code. Why? EMG[/quote:2rizrlko] I ask myself, how could have Sebastian tried nDbl2Flt() if it is not in the libraries? Did you compile the source code? EMG
nDbl2Flt()
Hola Antonio. No, la versión de dbl2flt.obj que he descargado de ese sitio tampoco funciona, me da el mismo error. Lo he solucionado sacando DBL2FLT.OBJ de la librería FIVEC.LIB de la versión 2.4 y añadiendolo a mi LNK. Saludos
nDbl2Flt()
Sebastián, Cierto, ese módulo hay que compilarlo con Microsoft en 16 bits, no con Borland. De ahí el error. Disculpa.
nDbl2Flt()
Enrico, My mistake, that module needs to be compiled with Microsoft 16 bits for FW Clipper.
nDbl2Flt()
[quote="Antonio Linares":dobwtzzc]Enrico, My mistake, that module needs to be compiled with Microsoft 16 bits for FW Clipper.[/quote:dobwtzzc] No! I compiled mine with Borland and worked fine. This is my DBL2FLT.C: [code:dobwtzzc]/*************************************************************************** * * Copyright 1995 Feh‚r Attila alias White Wolf&#46; All rights reserved&#46; * * This is original work of Feh‚r Attila &#40;alias White Wolf&#41;&#46; * * This code allowed to use for Mr&#46; Antonio Linares for his FiveWin * project&#46; Any other use must be discussed with the author &#40;for the moment&#41;&#46; * * MUST BE COMPILED WITH MSC!! * BC can't handle the double correctly in MSC environment like Clipper&#46; * * * Final version will be done in assembly w/o Clipper callable part&#46; * ***************************************************************************/ #include <HbApi&#46;h> long dbl2flt&#40; double x &#41;; HB_FUNC&#40; NDBL2FLT &#41; &#123; hb_retnl&#40; dbl2flt&#40; hb_parnd&#40; 1 &#41; &#41; &#41;; &#125; long dbl2flt&#40; double d &#41; &#123; long f = 0; int ui; char sig; if &#40; d == 0 &#41; return 0; sig = &#40; char &#41;&#40; &#40; &#40; char * &#41;&#40; &d &#41; &#41;&#91;7&#93; & 0x80 &#41;; // Store signum &#40; char &#41;&#40; &#40; &#40; char * &#41;&#40; &d &#41; &#41;&#91;7&#93;&#41; &= 0x7f; // Get rid of signum ui = &#40; &#40; short * &#41;&#40; &d &#41; &#41;&#91;3&#93; & 0xfff0; // Get exponent ui = ui / 16 - 1023 + 127; &#40; &#40; char * &#41;&#40; &f &#41; &#41;&#91;3&#93; = &#40; char &#41; ui; // Put exponent &#40; &#40; char * &#41;&#40; &f &#41; &#41;&#91;2&#93; |= &#40; char &#41;&#40; &#40; &#40; &#40; char * &#41;&#40; &d &#41; &#41;&#91;6&#93; &#41; << 4 &#41;; // Mantissa 1 &#40; &#40; char * &#41;&#40; &f &#41; &#41;&#91;2&#93; |= &#40; char &#41;&#40; &#40; &#40; &#40; &#40; char * &#41;&#40; &d &#41; &#41;&#91;5&#93; &#41; >> 4 &#41; & 0x0f &#41;; // Mantissa 2 &#40; &#40; char * &#41;&#40; &f &#41; &#41;&#91;1&#93; |= &#40; char &#41;&#40; &#40; &#40; &#40; char * &#41;&#40; &d &#41; &#41;&#91;5&#93; &#41; << 4 &#41;; // Mantissa 3 &#40; &#40; char * &#41;&#40; &f &#41; &#41;&#91;1&#93; |= &#40; char &#41;&#40; &#40; &#40; &#40; &#40; char * &#41;&#40; &d &#41; &#41;&#91;4&#93; &#41; >> 4 &#41; & 0x0f &#41;; // Mantissa 4 &#40; &#40; char * &#41;&#40; &f &#41; &#41;&#91;0&#93; |= &#40; char &#41;&#40; &#40; &#40; &#40; char * &#41;&#40; &d &#41; &#41;&#91;4&#93; &#41; << 4 &#41;; // Mantissa 5 &#40; &#40; char * &#41;&#40; &f &#41; &#41;&#91;0&#93; |= &#40; char &#41;&#40; &#40; &#40; &#40; &#40; char * &#41;&#40; &d &#41; &#41;&#91;3&#93; &#41; >> 4 &#41; & 0x0f &#41;; // Mantissa 6 f >>= 1; &#40; &#40; char * &#41;&#40; &f &#41; &#41;&#91;3&#93; &= 0x7f; // Clear signum "C error!!!" &#40; &#40; char * &#41;&#40; &f &#41; &#41;&#91;3&#93; |= sig; // Add signum return f; &#125;[/code:dobwtzzc] EMG
nDbl2Flt()
Ops, sorry. I suddenly understand that this is a FW for Clipper forum. <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> EMG
nDbl2Flt()
Enrico, No problem <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> Yes, its 16 bits code.
nExtMem() and Os()
nExtMem() isn't returning the correct amount of memory and the OS() function doensn't work in windows 8 or above, returning windows NT instead Is this related to my FWH / xHarbour version? Compiler version: xHarbour build 1.2.1 Intl. (SimpLex) (Rev. 6715) FiveWin Version: FWHX 10.6
nExtMem() and Os()
[code=fw:3gnakddy]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// GETSYSIN.PRG</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #00D7D7;">#define</span> HORZRES &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">8</span><br /><span style="color: #00D7D7;">#define</span> VERTRES &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">10</span><br /><span style="color: #00D7D7;">#Define</span> BITSPIXEL &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">12</span><br /><span style="color: #00D7D7;">#define</span> PLANES &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">14</span><br /><span style="color: #00D7D7;">#define</span> LOGPIXELSX &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">88</span><br /><span style="color: #00D7D7;">#define</span> LOGPIXELSY &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">90</span> &nbsp; &nbsp;<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">Function</span> LargeFonts<span style="color: #000000;">&#40;</span> nPixelX, nPixelY <span style="color: #000000;">&#41;</span><br /><br />&nbsp; <span style="color: #00C800;">Local</span> hDC<br /><br />&nbsp; hDC &nbsp; &nbsp; := CreateDC<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"DISPLAY"</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span><br />&nbsp; nPixelX := GetDeviceCaps<span style="color: #000000;">&#40;</span> hDC, LOGPIXELSX <span style="color: #000000;">&#41;</span><br />&nbsp; nPixelY := GetDeviceCaps<span style="color: #000000;">&#40;</span> hDC, LOGPIXELSY <span style="color: #000000;">&#41;</span><br /><br />&nbsp; DeleteDC<span style="color: #000000;">&#40;</span> hDC <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #000000;">&#40;</span> nPixelX >= <span style="color: #000000;">120</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> DispFontPerSize<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> hDC, nPixelX<br /><br />&nbsp; &nbsp;hDC &nbsp; &nbsp; = CreateDC<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"DISPLAY"</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;nPixelX = GetDeviceCaps<span style="color: #000000;">&#40;</span> hDC, LOGPIXELSX <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;DeleteDC<span style="color: #000000;">&#40;</span> hDC <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #000000;">&#40;</span> nPixelX / <span style="color: #000000;">96</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> ColorsQty<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> hDC, nPlanes, nBitsPixel<br /><br />&nbsp; &nbsp;hDC &nbsp; &nbsp; &nbsp; &nbsp;= CreateDC<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"DISPLAY"</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;nPlanes &nbsp; &nbsp;= GetDeviceCaps<span style="color: #000000;">&#40;</span> hDC, PLANES <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;nBitsPixel = GetDeviceCaps<span style="color: #000000;">&#40;</span> hDC, BITSPIXEL <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;DeleteDC<span style="color: #000000;">&#40;</span> hDC <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> Int<span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> ^ <span style="color: #000000;">&#40;</span> nPlanes * nBitsPixel <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> ScrResolution<span style="color: #000000;">&#40;</span> nWidth, nHeight <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> hDC<br /><br />&nbsp; &nbsp;hDC &nbsp; &nbsp; = CreateDC<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"DISPLAY"</span>, <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;nWidth &nbsp;= GetDeviceCaps<span style="color: #000000;">&#40;</span> hDC, HORZRES <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;nHeight = GetDeviceCaps<span style="color: #000000;">&#40;</span> hDC, VERTRES <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;DeleteDC<span style="color: #000000;">&#40;</span> hDC <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #000000;">&#123;</span> nWidth, nHeight <span style="color: #000000;">&#125;</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br />#ifdef __CLIPPER__<br /><br /><span style="color: #00C800;">function</span> cWinVersion<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cVersion := <span style="color: #ff0000;">""</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">If</span> IsWin95<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; cVersion = <span style="color: #ff0000;">"95"</span><br /><br />&nbsp; &nbsp;elseif IsWinNT<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> GetWinVer<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> == <span style="color: #000000;">95</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cVersion = <span style="color: #ff0000;">"2000"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cVersion = <span style="color: #ff0000;">"NT"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> cVersion<br /><br />#else<br /><br /><span style="color: #00D7D7;">#define</span> VER_PLATFORM_WIN32s &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">0</span><br /><span style="color: #00D7D7;">#define</span> VER_PLATFORM_WIN32_WINDOWS &nbsp;<span style="color: #000000;">1</span><br /><span style="color: #00D7D7;">#define</span> VER_PLATFORM_WIN32_NT &nbsp; &nbsp; &nbsp; <span style="color: #000000;">2</span><br /><br /><span style="color: #00C800;">function</span> cWinVersion<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aVersion := GetVersion<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cVersion := <span style="color: #ff0000;">""</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">do</span> <span style="color: #00C800;">case</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> aVersion<span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> == VER_PLATFORM_WIN32_NT<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> aVersion<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> == <span style="color: #000000;">6</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> aVersion<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cVersion = <span style="color: #ff0000;">"Vista"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;elseif aVersion<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> == <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cVersion = <span style="color: #ff0000;">"7"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;elseif aVersion<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> == <span style="color: #000000;">2</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> IsWindows10<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cVersion = <span style="color: #ff0000;">"10"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span> &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cVersion = <span style="color: #ff0000;">"8"</span> &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span> &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> aVersion<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> == <span style="color: #000000;">5</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> aVersion<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> == <span style="color: #000000;">2</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cVersion = <span style="color: #ff0000;">"Server 2003"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; elseif aVersion<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> == <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cVersion = <span style="color: #ff0000;">"XP"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; elseif aVersion<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cVersion = <span style="color: #ff0000;">"2000"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> aVersion<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> <= <span style="color: #000000;">4</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cVersion = <span style="color: #ff0000;">"NT"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> aVersion<span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> == VER_PLATFORM_WIN32_WINDOWS<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> aVersion<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> == <span style="color: #000000;">4</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> aVersion<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> == <span style="color: #000000;">90</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cVersion = <span style="color: #ff0000;">"ME"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; elseif aVersion<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> == <span style="color: #000000;">10</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cVersion = <span style="color: #ff0000;">"98"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; elseif aVersion<span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cVersion = <span style="color: #ff0000;">"95"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endcase</span><br /><br />&nbsp; &nbsp;cVersion += <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> IsWin64<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">" de 64 "</span>, <span style="color: #ff0000;">" de 32 "</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"Bits"</span><br /><br /><span style="color: #00C800;">return</span> cVersion<br /><br />#endif<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> IsWinVista<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Vista"</span> $ cWinVersion<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> IsWinXP<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"XP"</span> $ cWinVersion<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> IsWin2000<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"2000"</span> $ cWinVersion<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> IsWin7<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #ff0000;">"7"</span> $ cWinVersion<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> IsWin8<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #ff0000;">"8"</span> == cWinVersion<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00D7D7;">#define</span> &nbsp;HKEY_LOCAL_MACHINE &nbsp;<span style="color: #000000;">2147483650</span> &nbsp;<span style="color: #B900B9;">// 0x80000002</span><br /><br /><span style="color: #00C800;">function</span> IsWindows10<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oReg := TReg32<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> HKEY_LOCAL_MACHINE,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"SOFTWARE<span style="color: #000000;">\M</span>icrosoft<span style="color: #000000;">\W</span>indows NT<span style="color: #000000;">\C</span>urrentVersion"</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;.f. <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cProductName := oReg:<span style="color: #0000ff;">Get</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ProductName"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;oReg:<span style="color: #000000;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #ff0000;">"Windows 10"</span> $ cProductName<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> GetSysFont<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">do</span> <span style="color: #00C800;">case</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">case</span> ! IsWinNt<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> .and. ! IsWin95<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #B900B9;">// Win 3.1</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">return</span> <span style="color: #ff0000;">"System"</span><br /><br />&nbsp; &nbsp; &nbsp; #ifdef __CLIPPER__ &nbsp; <span style="color: #B900B9;">// A.L. 28/04/03, It fails with FWH/FW++</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">case</span> IsWin2000<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #B900B9;">// Win2000</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> <span style="color: #ff0000;">"Ms Sans Serif"</span> <span style="color: #B900B9;">// "SysTahoma"</span><br />&nbsp; &nbsp; &nbsp; #endif<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">endcase</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #ff0000;">"Ms Sans Serif"</span> &nbsp;<span style="color: #B900B9;">// Win NT, 9x</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> BorlandVersion<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;#ifdef __XHARBOUR__<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">local</span> cHexVer := NumToHex<span style="color: #000000;">&#40;</span> BorlandC<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;#else &nbsp; <br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">local</span> cHexVer := hb_NumToHex<span style="color: #000000;">&#40;</span> BorlandC<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;#endif<br /><br /><span style="color: #00C800;">return</span> <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> cHexVer, <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"."</span> + <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> cHexVer, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> SaveDesktop<span style="color: #000000;">&#40;</span> cPngFileName <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> o := TWindow<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;DestroyWindow<span style="color: #000000;">&#40;</span> o:<span style="color: #000000;">hWnd</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;o:<span style="color: #000000;">hWnd</span> = GetDesktopWindow<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;o:<span style="color: #000000;">SaveToPng</span><span style="color: #000000;">&#40;</span> cPngFileName <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------// &nbsp;</span><br /><br /><span style="color: #00D7D7;">#define</span> SM_CXFULLSCREEN &nbsp;<span style="color: #000000;">16</span><br /><span style="color: #00D7D7;">#define</span> SM_CYFULLSCREEN &nbsp;<span style="color: #000000;">17</span><br /><br /><span style="color: #00C800;">function</span> ScreenWidth<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> GetSysMetrics<span style="color: #000000;">&#40;</span> SM_CXFULLSCREEN <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">function</span> ScreenHeight<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> GetSysMetrics<span style="color: #000000;">&#40;</span> SM_CYFULLSCREEN <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------// &nbsp; </span><br /><br /><span style="color: #00C800;">function</span> IsWin64<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> ! Empty<span style="color: #000000;">&#40;</span> GetEnv<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ProgramFiles(x86)"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br />&nbsp;</div>[/code:3gnakddy] 
nExtMem() and Os()
Gostaria de utilizar a função OS pois ela já retorna o modelo do SO também pois alguns modelos geram incompatibilidade, como o windows 7 starter... ? "Versão windows: " + OS() //Versão windows: Windows 7 Professional 6.01.7601 Service Pack 1
nExtMem() and Os()
[quote="sambomb":3eqq6ljv]Gostaria de utilizar a função OS pois ela já retorna o modelo do SO também pois alguns modelos geram incompatibilidade, como o windows 7 starter... ? "Versão windows: " + OS() //Versão windows: Windows 7 Professional 6.01.7601 Service Pack 1[/quote:3eqq6ljv] look, mira, olha: [url:3eqq6ljv]http&#58;//forums&#46;fivetechsupport&#46;com/viewtopic&#46;php?f=6&t=31789&p=185657&hilit=tsystem#p185657[/url:3eqq6ljv] [url:3eqq6ljv]http&#58;//fivewin&#46;com&#46;br/index&#46;php?/topic/24424-classe-tsysteminfo/?hl=getsysin#entry272884[/url:3eqq6ljv] [url:3eqq6ljv]http&#58;//fivewin&#46;com&#46;br/index&#46;php?/topic/23851-verificar-memoria-do-computador/?hl=nextmem[/url:3eqq6ljv] Regards, saludos.
nExtMem() and Os()
a nExtMem está retornando valores inválidos, minha máquina é um Windows 7 que tem 4 GB ( utilizável 3,24 ) sendo que reconhece apenas 2 GB em uma máquina com Windows 8.1, reconhece como negativo! E a função Os() é nativa do xHarbour, mas parece que não foi atualizada, ela retorna todas as informações que eu preciso, queria saber não apenas a versão do Windows, mas também o tipo de licença dele como disse acima, mas muito obrigado, estou desenvolvendo uma rotina que poderei aproveitar trechos dessa TSystem
nExtMem() and Os()
Windows 8.1, reconhece como negativo? Você incorporou o GETSYSIN.PRG modificado por mim, logo acima? Você tem a função Os() do xHarbour? Talvez o Marcelo Lombardo tenha uma mais recente. Seria algo assim? [url:2i3exugo]http&#58;//www&#46;pctoledo&#46;com&#46;br/forum/viewtopic&#46;php?f=4&t=16163[/url:2i3exugo] Abs.
nExtMem() and Os()
Não só no Windows 8.1 --> DadosSO Versão windows: Windows 7 Professional 6.01.7601 Service Pack 1 Processador: AMD Athlon(tm) II X2 250 Processor 3017 Mhz Data: 23/02/2016 Hora: 14:30:07 Nome de rede: LAZZO-PC Usuário de rede: Lazzo Acesso de gravação no 'C:\': True Driver's ( 1 ) C: Serial: 4873455 Tamanho total: 465.662 GB Utilizado: 61.306 GB Restante: 404.356 GB Cache HD: Cache não habilitado Arquivos off-line: Desabilitado [code=fw:23t85qiz]<div class="fw" id="{CB}" style="font-family: monospace;">aAdd<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">aTexto</span>,<span style="color: #ff0000;">"Memória: "</span> + cValToChar<span style="color: #000000;">&#40;</span> Int<span style="color: #000000;">&#40;</span> nExtMem<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> / <span style="color: #000000;">&#40;</span> <span style="color: #000000;">1024</span> * <span style="color: #000000;">1024</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" MBs"</span> <span style="color: #000000;">&#41;</span></div>[/code:23t85qiz] [b:23t85qiz][color=#FF0000:23t85qiz]Memória: -255 MBs[/color:23t85qiz] Memória livre - Sistema: 90 % Memória livre - GDI: 90 % Memória livre - User: 90 %[/b:23t85qiz]
nExtMem() and Os()
Don't know about xHarbour, but probably this is sth related to the numeric type used by nExtMem() an xHabour's integers. Using a 4 byte UNSIGNED LONG we can represent integers from 0 to 256^4-1, or 4,294,967,295, or SIGNED, ranging from -2,147,483,647 TO 2,147,483,648. I think the function is working fine, but returning an UNSIGNED LONG that xHarbour is handling as signed, so that's why you ar getting negative results. A quick temporary patch can be that, in case of a negative result, it should be substracted from 256^4-1, wich will result in your case to 3840 Mb, that is your claimd free mem. Obvously, this patch will fail in PC with more than 4 GB, as probably will do anything in 32 bits with results expresing byte counts that a 4 byte LONG won't be able to represent.
nExtMem() and Os()
[code=fw:1sbfhgq0]<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;<span style="color: #00C800;">LOCAL</span> cMemoria, nBytes, nKBytes, nMBytes, nGBytes<br /><br />&nbsp; &nbsp;nBytes &nbsp;:= nExtMem<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp;<br />&nbsp; &nbsp;nKBytes := nBytes / <span style="color: #000000;">1014</span><br />&nbsp;<br />&nbsp; &nbsp;nMBytes := nKBytes / <span style="color: #000000;">1024</span><br />&nbsp;<br />&nbsp; &nbsp;nGBytes := nMBytes / <span style="color: #000000;">1014</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// Com erro - With Error</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">// &nbsp;aAdd( ::aTexto,"Memória: " + cValToChar( Int( nExtMem() / ( 1024 * 1024 ) ) + 1 ) + " MBs" )</span><br />&nbsp; &nbsp;? <span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Memóry Error: "</span> + cValToChar<span style="color: #000000;">&#40;</span> Int<span style="color: #000000;">&#40;</span> nExtMem<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> / <span style="color: #000000;">&#40;</span> <span style="color: #000000;">1024</span> * <span style="color: #000000;">1024</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">" MBs"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;? cMemoria := Trans<span style="color: #000000;">&#40;</span> nExtMem<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">"@E 9,999,999,999 Bytes free"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;? cMemoria := Trans<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> nExtMem<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> / <span style="color: #000000;">&#40;</span> <span style="color: #000000;">1024</span> * <span style="color: #000000;">1024</span> * <span style="color: #000000;">1014</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">"@E 999.99 GB Free"</span> <span style="color: #000000;">&#41;</span><br /><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; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// or .97 = 4 Gbs.</span><br />&nbsp; &nbsp;? cMemoria := Trans<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> nExtMem<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> / <span style="color: #000000;">&#40;</span> <span style="color: #000000;">1024</span> * <span style="color: #000000;">1024</span> * <span style="color: #000000;">1014</span> <span style="color: #000000;">&#41;</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">"@E 999.99 GB Total"</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">// END OF PROGRAM</span><br />&nbsp;</div>[/code:1sbfhgq0] 
nExtMem() difference
Hi all, My PC has Windows 7 32bit with 4 Gb/RAM In my old version of FWH (8.10) the function nExtMem() gives 2147483647 (2GB) In my new version of FWH (16.01 build 2) the same function nExtMem() gives 3219574784 (2,998... gb) Is there any logic relation between them ? I need to know it because i implemented a protection of my sw on hardware customer pc (memory,HD,CPU,...) and when i upgrade my the software on customer pc, i must be sure that is the same PC. Any help ? Tks Romeo
nExtMem() difference
Romeo, We migrated to Windows API GlobalMemoryStatusEx() as it provides a better result than GlobalMemoryStatus(), thats why it changed. [url:qow1m7jl]https&#58;//msdn&#46;microsoft&#46;com/es-es/library/windows/desktop/aa366589(v=vs&#46;85)&#46;aspx[/url:qow1m7jl] And we are going to keep using it.
nExtMem() difference
If you need your old values you could call GlobalMemoryStatus() but beware of this: [url:3ivl4cyb]https&#58;//msdn&#46;microsoft&#46;com/es-es/library/windows/desktop/aa366586(v=vs&#46;85)&#46;aspx[/url:3ivl4cyb] [quote:3ivl4cyb]On computers with more than 4 GB of memory, the GlobalMemoryStatus function can return incorrect information, reporting a value of –1 to indicate an overflow. For this reason, applications should use the GlobalMemoryStatusEx function instead.[/quote:3ivl4cyb]
nExtMem() difference
[code=fw:zoxaih1n]<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;<span style="color: #00C800;">LOCAL</span> cMemoria, nBytes, nKBytes, nMBytes, nGBytes<br /><br />&nbsp; &nbsp;nBytes &nbsp;:= nExtMem<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp;<br />&nbsp; &nbsp;nKBytes := nBytes / <span style="color: #000000;">1014</span><br />&nbsp;<br />&nbsp; &nbsp;nMBytes := nKBytes / <span style="color: #000000;">1024</span><br />&nbsp;<br />&nbsp; &nbsp;nGBytes := nMBytes / <span style="color: #000000;">1014</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// Com erro - With Error</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">// &nbsp;aAdd( ::aTexto,"Memória: " + cValToChar( Int( nExtMem() / ( 1024 * 1024 ) ) + 1 ) + " MBs" )</span><br />&nbsp; &nbsp;<span style="color: #B900B9;">// ? ( "Memóry Error: " + cValToChar( Int( nExtMem() / ( 1024 * 1024 ) ) + 1 ) + " MBs" )</span><br /><br />&nbsp; &nbsp;? cMemoria := Trans<span style="color: #000000;">&#40;</span> nExtMem<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">"@E 9,999,999,999 Bytes free"</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;? cMemoria := Trans<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> nExtMem<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> / <span style="color: #000000;">&#40;</span> <span style="color: #000000;">1024</span> * <span style="color: #000000;">1024</span> * <span style="color: #000000;">1014</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">"@E 999.99 GB Free"</span> <span style="color: #000000;">&#41;</span><br /><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; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// or .97 = 4 Gbs.</span><br />&nbsp; &nbsp;? cMemoria := Trans<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> nExtMem<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> / <span style="color: #000000;">&#40;</span> <span style="color: #000000;">1024</span> * <span style="color: #000000;">1024</span> * <span style="color: #000000;">1014</span> <span style="color: #000000;">&#41;</span> + <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">"@E 999.99 GB Total"</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">// END OF PROGRAM</span><br />&nbsp;</div>[/code:zoxaih1n] 
nExtMem() difference
Understood the new function works well, BUT this not resolved my problem ! <!-- s:-( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":-(" title="Sad" /><!-- s:-( --> I will be not not able to detect the old RAM detected. And i cannot sum 1 gb, as suggested, to the total RAM, because if a custmer has just 2 GB of real RAM i will get more than 2 GB of calculate RAM. Thanks any
nExtMem() difference
You can implement a function nExtMemOld() that will return the old value: [code=fw:2njok4qq]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">&#40;</span> NEXTMEMOLD <span style="color: #000000;">&#41;</span><br /><span style="color: #000000;">&#123;</span><br />   MEMORYSTATUS mst;<br /><br />   memset<span style="color: #000000;">&#40;</span> &mst, <span style="color: #000000;">0</span>, sizeof<span style="color: #000000;">&#40;</span> MEMORYSTATUS <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<br />   mst.dwLength = sizeof<span style="color: #000000;">&#40;</span> MEMORYSTATUS <span style="color: #000000;">&#41;</span>;<br /><br />   GlobalMemoryStatus<span style="color: #000000;">&#40;</span> &mst <span style="color: #000000;">&#41;</span>;<br /><br />   hb_retnl<span style="color: #000000;">&#40;</span> mst.dwTotalPhys <span style="color: #000000;">&#41;</span>;<br /><span style="color: #000000;">&#125;</span></div>[/code:2njok4qq]
nExtMem() difference
This can resolve my problem. I'll try Tks R
nExtMem() provocando GPF con xhb.com
Antonio, la funcion nExtMem() esta provocando gpf con xhb.com, esta funcion es usada en errsysw.prg por lo que cuando una app compilada con xhb.com genera un error, el cuadro de dialogo del error no aparece, si no que la aplicacion simplemnte colapsa y se cierra. con xharbour y harbour funciona bien, ahora en los fuentes de fwh aparece la definicion de una funcion nExtMem pero esta encerrada en un ifdef __CLIPPER__ por lo que no es la que se esta compilando con las app de 32 bits [code=fw:1r7af2sw]<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: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <br />   <span style="color: #0000ff;">xbrowse</span><span style="color: #000000;">&#40;</span>GetVersion<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">xbrowse</span><span style="color: #000000;">&#40;</span>GetTasks<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />   ?<span style="color: #ff0000;">"IsWinNT():"</span>,IsWinNT<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   ?<span style="color: #ff0000;">"IsExe64():"</span>,IsExe64<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   ?<span style="color: #ff0000;">"ProcName( 7 ):"</span>,ProcName<span style="color: #000000;">&#40;</span> <span style="color: #000000;">7</span> <span style="color: #000000;">&#41;</span><br />   ?<span style="color: #ff0000;">"GetCPU():"</span>,GetCPU<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   ?<span style="color: #ff0000;">" GetCPUSpeed():"</span>, GetCPUSpeed<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   ?<span style="color: #ff0000;">"nExtMem():"</span>,nExtMem<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />   <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Hello world from Harbour and FWH!"</span> <span style="color: #000000;">&#41;</span><br />   <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /> </div>[/code:1r7af2sw] memstat.prg [code=fw:1r7af2sw]<div class="fw" id="{CB}" style="font-family: monospace;"><br />#ifdef __CLIPPER__<br /><br /><span style="color: #00C800;">function</span> nExtMem<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oMemoryStatus<br /><br />&nbsp; &nbsp;STRUCT oMemoryStatus<br />&nbsp; &nbsp; &nbsp; MEMBER nSize &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AS LONG<br />&nbsp; &nbsp; &nbsp; MEMBER nMemoryLoad &nbsp; &nbsp;AS LONG<br />&nbsp; &nbsp; &nbsp; MEMBER nTotalPhys &nbsp; &nbsp; AS LONG<br />&nbsp; &nbsp; &nbsp; MEMBER nAvailPhys &nbsp; &nbsp; AS LONG<br />&nbsp; &nbsp; &nbsp; MEMBER nTotalPageFile AS LONG<br />&nbsp; &nbsp; &nbsp; MEMBER nAvailPageFile AS LONG<br />&nbsp; &nbsp; &nbsp; MEMBER nTotalVirtual &nbsp;AS LONG<br />&nbsp; &nbsp; &nbsp; MEMBER nAvailVirtual &nbsp;AS LONG<br />&nbsp; &nbsp;ENDSTRUCT<br /><br />&nbsp; &nbsp;oMemoryStatus:<span style="color: #000000;">nSize</span> = oMemoryStatus:<span style="color: #000000;">SizeOf</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;GblMemStat<span style="color: #000000;">&#40;</span> oMemoryStatus:<span style="color: #000000;">cBuffer</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> oMemoryStatus:<span style="color: #000000;">nTotalPhys</span><br /><br />DLL32 <span style="color: #00C800;">FUNCTION</span> GblMemStat<span style="color: #000000;">&#40;</span> pMEMORYSTATUS AS LPSTR <span style="color: #000000;">&#41;</span> AS VOID PASCAL ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">FROM</span> <span style="color: #ff0000;">"GlobalMemoryStatus"</span> LIB <span style="color: #ff0000;">"kernel32.dll"</span><br /><br />#endif</div>[/code:1r7af2sw]
nExtMem() provocando GPF con xhb.com
Antonio, he quitado la compilacion condicional y ya funciona. [code=fw:2wf9trk7]<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;">"dll.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"struct.ch"</span><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <br />   <span style="color: #0000ff;">xbrowse</span><span style="color: #000000;">&#40;</span>GetVersion<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">xbrowse</span><span style="color: #000000;">&#40;</span>GetTasks<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />   ?<span style="color: #ff0000;">"IsWinNT():"</span>,IsWinNT<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   ?<span style="color: #ff0000;">"IsExe64():"</span>,IsExe64<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   ?<span style="color: #ff0000;">"ProcName( 7 ):"</span>,ProcName<span style="color: #000000;">&#40;</span> <span style="color: #000000;">7</span> <span style="color: #000000;">&#41;</span><br />   ?<span style="color: #ff0000;">"GetCPU():"</span>,GetCPU<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   ?<span style="color: #ff0000;">" GetCPUSpeed():"</span>, GetCPUSpeed<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   ?<span style="color: #ff0000;">"nExtMem():"</span>,nExtMem<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <br />?a<span style="color: #000000;">+1</span>      <span style="color: #B900B9;">//--------------------------->provocamos un error</span><br />   <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Hello world from Harbour and FWH!"</span> <span style="color: #000000;">&#41;</span><br />   <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><br /><span style="color: #00C800;">function</span> nExtMem<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oMemoryStatus<br /><br />   STRUCT oMemoryStatus<br />      MEMBER nSize          AS LONG<br />      MEMBER nMemoryLoad    AS LONG<br />      MEMBER nTotalPhys     AS LONG<br />      MEMBER nAvailPhys     AS LONG<br />      MEMBER nTotalPageFile AS LONG<br />      MEMBER nAvailPageFile AS LONG<br />      MEMBER nTotalVirtual  AS LONG<br />      MEMBER nAvailVirtual  AS LONG<br />   ENDSTRUCT<br /><br />   oMemoryStatus:<span style="color: #000000;">nSize</span> = oMemoryStatus:<span style="color: #000000;">SizeOf</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   GblMemStat<span style="color: #000000;">&#40;</span> oMemoryStatus:<span style="color: #000000;">cBuffer</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> oMemoryStatus:<span style="color: #000000;">nTotalPhys</span><br /><br />DLL32 <span style="color: #00C800;">FUNCTION</span> GblMemStat<span style="color: #000000;">&#40;</span> pMEMORYSTATUS AS LPSTR <span style="color: #000000;">&#41;</span> AS VOID PASCAL ;<br />                           <span style="color: #0000ff;">FROM</span> <span style="color: #ff0000;">"GlobalMemoryStatus"</span> LIB <span style="color: #ff0000;">"kernel32.dll"</span></div>[/code:2wf9trk7]
nExtMem() provocando GPF con xhb.com
Carlos, Incluido para la próxima versión, gracias!
nHeight of Xbrowse
If I 'm using superGoupHeader which is the variable to change the height of Group header ?
nItemPos()
Muy interesante este aporte. Muchisimas gracias por compartirlo. Saludos
nItemPos()
Hola Foreros. Recientemente, implementando una función he dado con un algoritmo muy sencillo que a lo mejor puede ser de utilidad para alguno de vosotros. Se trata del siguiente: [code=fw:1m3cishh]<div class="fw" id="{CB}" style="font-family: monospace;">nPos := Int<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> nItem + nTama - <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> / nTama <span style="color: #000000;">&#41;</span></div>[/code:1m3cishh] Al que he llamado nItemPos(), y que se puede implementar, en su forma preprocesada: [code=fw:1m3cishh]<div class="fw" id="{CB}" style="font-family: monospace;">#translate nItemPos<span style="color: #000000;">&#40;</span> <nVar1>, <nVar2> <span style="color: #000000;">&#41;</span>  =>  Int<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> <nVar1> + <nVar2> - <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> / <nVar2> <span style="color: #000000;">&#41;</span><br /> </div>[/code:1m3cishh] ¿Para qué sirve? Tiene 2 posibles aplicaciones: [color=#0000BF:1m3cishh]1º - Dado un conjunto de elementos, numerados correlativamente, y agrupados en subconjuntos de igual tamaño, permite determinar en qué subconjunto se haya un elemento determinado.[/color:1m3cishh] [code=fw:1m3cishh]<div class="fw" id="{CB}" style="font-family: monospace;">Ejemplo <span style="color: #000000;">1</span>: <span style="color: #000000;">dado</span> el conjunto de los meses, numerados del <span style="color: #000000;">1</span> al <span style="color: #000000;">12</span>, si los agrupamos por trimestres, podemos saber a qué trimestre pertence un mes determinado.<br /><br />Agosto = <span style="color: #000000;">8</span><br />Trimestre = nItemPos<span style="color: #000000;">&#40;</span>Agosto,<span style="color: #000000;">3</span><span style="color: #000000;">&#41;</span>  <span style="color: #B900B9;">// RESULTADO: 3º trimestre.</span><br /><br />Si los agrupamos en cuatrimestres:<br /><br /><span style="color: #000000;">Cuatrimestre</span> = nItemPos<span style="color: #000000;">&#40;</span>Agosto,<span style="color: #000000;">4</span><span style="color: #000000;">&#41;</span>  <span style="color: #B900B9;">// RESULTADO: 2º cuatrimestre.</span></div>[/code:1m3cishh] [code=fw:1m3cishh]<div class="fw" id="{CB}" style="font-family: monospace;">Ejemplo <span style="color: #000000;">2</span>: <span style="color: #000000;">Si</span> tenemos un conjunto de <span style="color: #000000;">96</span> elementos que representamos en pantalla agrupados en <span style="color: #000000;">8</span> columnas de <span style="color: #000000;">12</span> elementos.<br /><br />Numerados por columnas, podemos saber en que columna estará el elmento nº <span style="color: #000000;">57</span>:<br /><br /><span style="color: #000000;">01</span>   <span style="color: #000000;">13</span>   <span style="color: #000000;">25</span>   <span style="color: #000000;">37</span>   ..  <span style="color: #000000;">85</span><br /><span style="color: #000000;">02</span>   <span style="color: #000000;">14</span>   <span style="color: #000000;">26</span>   <span style="color: #000000;">38</span>   ..  <span style="color: #000000;">86</span><br /><span style="color: #000000;">03</span>   <span style="color: #000000;">15</span>   <span style="color: #000000;">27</span>   <span style="color: #000000;">39</span>   ..  <span style="color: #000000;">87</span><br /><span style="color: #000000;">04</span>   <span style="color: #000000;">16</span>   <span style="color: #000000;">28</span>   <span style="color: #000000;">40</span>   ..  <span style="color: #000000;">88</span><br />..   ..   ..   ..   ..  ..<br /><br />nCol = nItemPos<span style="color: #000000;">&#40;</span><span style="color: #000000;">57</span>,<span style="color: #000000;">12</span><span style="color: #000000;">&#41;</span>  <span style="color: #B900B9;">// RESULTADO: 5ª columna.</span><br /><br /><br />Numerados por filas, podremos saber en que fila estará el elmento nº <span style="color: #000000;">57</span>:<br /><br /><span style="color: #000000;">01</span>   <span style="color: #000000;">02</span>   <span style="color: #000000;">03</span>   <span style="color: #000000;">04</span>   ..   <span style="color: #000000;">08</span><br /><span style="color: #000000;">09</span>   <span style="color: #000000;">10</span>   <span style="color: #000000;">11</span>   <span style="color: #000000;">12</span>   ..   <span style="color: #000000;">16</span><br /><span style="color: #000000;">17</span>   <span style="color: #000000;">18</span>   <span style="color: #000000;">19</span>   <span style="color: #000000;">20</span>   ..   <span style="color: #000000;">24</span><br /><span style="color: #000000;">25</span>   <span style="color: #000000;">26</span>   <span style="color: #000000;">27</span>   <span style="color: #000000;">28</span>   ..   <span style="color: #000000;">32</span><br />..   ..   ..   ..   ..   ..<br /><br />nFila = nItemPos<span style="color: #000000;">&#40;</span><span style="color: #000000;">57</span>,<span style="color: #000000;">8</span><span style="color: #000000;">&#41;</span>  <span style="color: #B900B9;">// RESULTADO: 8ª fila.</span></div>[/code:1m3cishh] [code=fw:1m3cishh]<div class="fw" id="{CB}" style="font-family: monospace;">Ejemplo <span style="color: #000000;">3</span>: <span style="color: #000000;">Si</span> tenemos un <span style="color: #0000ff;">Listbox</span> cuyo panel mide <span style="color: #000000;">667</span> pixels de alto y cada linea mide <span style="color: #000000;">23</span> pixels de grosor <span style="color: #000000;">&#40;</span>incluyendo margenes, contenido y grid<span style="color: #000000;">&#41;</span>, podemos saber, cuando pinchamos con el ratón sobre el <span style="color: #0000ff;">pixel</span> nRow = <span style="color: #000000;">133</span>, sobre qué línea del <span style="color: #0000ff;">Listbox</span> hemos pinchado.<br /><br />nLinea = nItemPos<span style="color: #000000;">&#40;</span><span style="color: #000000;">133</span>,<span style="color: #000000;">23</span><span style="color: #000000;">&#41;</span>  <span style="color: #B900B9;">// RESULTADO: 6ª línea</span></div>[/code:1m3cishh] Aquí tengo que tener que hacer un pequeño inciso: se supone que el listbox tiene un contorno (por ejpmlo 1 pixel) y una cabecera (por ejmplo 37 pixel), esos pixels hay que restarlos a nRow porque el primer pixel de la primera línea empieza en el pixel número 38, no en el 0. Por lo que en realidad la línea sobre la que hemos pinchado con el ratón sería la: [code=fw:1m3cishh]<div class="fw" id="{CB}" style="font-family: monospace;">nLinea = nItemPos<span style="color: #000000;">&#40;</span><span style="color: #000000;">133</span><span style="color: #000000;">-38</span>,<span style="color: #000000;">23</span><span style="color: #000000;">&#41;</span>  <span style="color: #B900B9;">// RESULTADO: 5ª línea</span></div>[/code:1m3cishh] Sólo hay que tener en cuanta que todos los subconjuntos deben tener la misma cantidad de elementos, salvo el último que puede ser inferior (no superior) [code=fw:1m3cishh]<div class="fw" id="{CB}" style="font-family: monospace;">Ejemplo <span style="color: #000000;">4</span>: <span style="color: #000000;">Tenemos</span> <span style="color: #000000;">28</span> personas montadas en <span style="color: #000000;">6</span> vehículos con capacidad para <span style="color: #000000;">5</span> personas cada uno. Habrá <span style="color: #000000;">5</span> autos con <span style="color: #000000;">5</span> personas cada uno, más un <span style="color: #000000;">6</span>º vehículo con sólo <span style="color: #000000;">3</span> viajeros. Si le asignamos un número a cada persona <span style="color: #000000;">&#40;</span>ordanada y correlativamente<span style="color: #000000;">&#41;</span>, podremos saber en qué vehículo viaja el <span style="color: #000000;">11</span>º pasajero:<br /><br /><span style="color: #000000;">nAuto</span> = nItemPos<span style="color: #000000;">&#40;</span><span style="color: #000000;">11</span>,<span style="color: #000000;">5</span><span style="color: #000000;">&#41;</span>  <span style="color: #B900B9;">// RESULTADO: 3º vehículo</span></div>[/code:1m3cishh] Lógicamente no tenemos necesidad de saber en que vehículo estará el pasajero número 30, porque sólo hay 28 personas, pero si me dirá que el 28º pasajero esta el coche número 6 (que no está completo). Luego, puedo ubicar todos y cada uno de los elementos existentes aunque el último subconjubto no esté lleno. Esto me lleva a la segunda posible utilidad de nItemPos(). [color=#000080:1m3cishh]2º - Dado un número de elementos cualquiera, me permite determinar cuantos subconjuntos de x elementos se pueden formar con ellos. Puede que el último de esos subconjuntos no esté completo, pero a efectos prácticos, se trata del ultimo subconjunto necesario para ubicar a todos y cada uno de los items sin que se quede ninguno fuera del sistema.[/color:1m3cishh] [code=fw:1m3cishh]<div class="fw" id="{CB}" style="font-family: monospace;">Ejemplo <span style="color: #000000;">5</span>: <span style="color: #000000;">Siguiendo</span> con el ejemplo de los vehículos. Si tengo <span style="color: #000000;">37</span> pasajeros y tengo que transportarlos en vehículos con capacidad para <span style="color: #000000;">5</span> personas cada uno. ¿Cúantos autos necesitaré?<br /><br />nAutos = nItemPos<span style="color: #000000;">&#40;</span><span style="color: #000000;">37</span>,<span style="color: #000000;">5</span><span style="color: #000000;">&#41;</span>  <span style="color: #B900B9;">// RESULTADO: 8 vehículos. (7 llenos y uno con 2 personas)</span></div>[/code:1m3cishh] [code=fw:1m3cishh]<div class="fw" id="{CB}" style="font-family: monospace;">Ejemplo <span style="color: #000000;">6</span>: <span style="color: #000000;">Retomando</span> nuestro <span style="color: #0000ff;">Listbox</span>. Hemos dicho que el panel mide <span style="color: #000000;">667</span> pixels de alto, <span style="color: #000000;">628</span> <span style="color: #0000ff;">sin</span> cabecera ni bordes superior e inferior, y que cada línea ocupa <span style="color: #000000;">23</span> pixels. ¿Cúantas líneas van a caber?<br /><br />nLineas = nItemPos<span style="color: #000000;">&#40;</span><span style="color: #000000;">628</span>,<span style="color: #000000;">23</span><span style="color: #000000;">&#41;</span>  <span style="color: #B900B9;">// REULTADO: 28 líneas (27 completas más otra parcialmente escondida)</span><br /><br />Si sólo vamos a pintar las líneas completas bastaría con hacer: <span style="color: #000000;">Int</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">622</span>/<span style="color: #000000;">23</span><span style="color: #000000;">&#41;</span><br />Podemos saber el espacio sobrante:<br /><br /><span style="color: #000000;">nPixels</span> = <span style="color: #000000;">&#40;</span>nItemPos<span style="color: #000000;">&#40;</span><span style="color: #000000;">628</span>,<span style="color: #000000;">23</span><span style="color: #000000;">&#41;</span>*<span style="color: #000000;">23</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">-628</span>  <span style="color: #B900B9;">// RESULTADO: 16 pixels se quedan fuera</span><br />nPixels = <span style="color: #000000;">628</span>-<span style="color: #000000;">&#40;</span>Int<span style="color: #000000;">&#40;</span><span style="color: #000000;">628</span>/<span style="color: #000000;">23</span><span style="color: #000000;">&#41;</span>*<span style="color: #000000;">23</span><span style="color: #000000;">&#41;</span>       <span style="color: #B900B9;">// RESULTADO:  7 pixels se quedan dentro</span></div>[/code:1m3cishh] [code=fw:1m3cishh]<div class="fw" id="{CB}" style="font-family: monospace;">Ejemplo <span style="color: #000000;">7</span>: <span style="color: #000000;">Si</span> el panel del <span style="color: #0000ff;">Listbox</span> mide <span style="color: #000000;">937</span> pixels de ancho <span style="color: #000000;">&#40;</span><span style="color: #0000ff;">sin</span> bordes<span style="color: #000000;">&#41;</span>, podemos saber cuantos columnas de <span style="color: #000000;">173</span> pixels me van a caber:<br /><br /><span style="color: #000000;">nCols</span> = nItemPos<span style="color: #000000;">&#40;</span><span style="color: #000000;">967</span>,<span style="color: #000000;">173</span><span style="color: #000000;">&#41;</span>  <span style="color: #B900B9;">// RESULTADO: 6  (5 de 173 pixel más la última de sólo 102 pixels)</span></div>[/code:1m3cishh] Como verán es una formula muy sencilla que puede dar mucho de sí. Espero que os guste Un saludo.
nKey return Value
Hi All ! How to get nKey return value of Alt+F1, Ctrl+F1 and Shift+F1 Thanks Best Regard Areang
nKey return Value
This is a sample for Ctrl+F1 and Shift+F1: [code:3ibbwbcf]#include "Fivewin&#46;ch" FUNCTION MAIN&#40;&#41; LOCAL oDlg LOCAL cVar &#58;= SPACE&#40; 30 &#41; SETKEY&#40; VK_F1, &#123; || Keys&#40;&#41; &#125; &#41; DEFINE DIALOG oDlg @ 1, 1 GET cVar OF oDlg @ 3, 1 BUTTON "&Close" OF oDlg ACTION oDlg&#58;End&#40;&#41; ACTIVATE DIALOG oDlg; CENTER RETURN NIL STATIC FUNCTION KEYS&#40;&#41; IF GETKEYSTATE&#40; VK_CONTROL &#41; ? "CTRL-F1" ENDIF IF GETKEYSTATE&#40; VK_SHIFT &#41; ? "SHIFT-F1" ENDIF RETURN NIL[/code:3ibbwbcf] EMG
nKey return Value
Areang, I believe the Alt keys are reserved for Windows (menus and hot-keys). James
nRandom
Amigos: Necesito conseguir un número entre 1 y 42 incluyendo el 1 y el 42. Como se hace con nRandom? Saludos y gracias. Ruben Fernandez
nRandom
[quote="RuFer":1ke8c533]Amigos: Necesito conseguir un número entre 1 y 42 incluyendo el 1 y el 42. Como se hace con nRandom? Saludos y gracias. Ruben Fernandez[/quote:1ke8c533] nAleatorio := nRandom( 1,42) saludos
nRandom
Wmormar: Muchas gracias. Saludos Ruben Fernandez
nRandom Numbers no duplicates
I have to calculate a random number up to 1 10 I have to extract 1 at a time for 10 times and I don't have to extract a number that has already been extracted, what should I do? num:=nRandom(10) [img:3pde4mnv]https&#58;//i&#46;postimg&#46;cc/fThGchsX/kk&#46;png[/img:3pde4mnv] I tried but I get duplicates what should I do?
nRandom Numbers no duplicates
Mira se ayuda: [code=fw:3jy0qxsz]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// \samples\RANDOM1.PRG</span><br /><br /><span style="color: #00D7D7;">#Include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #00C800;">FUNCTION</span> RandomList<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> aList := ARRAY<span style="color: #000000;">&#40;</span> <span style="color: #000000;">100</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// 999999</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> nAt, aRandom := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;AEval<span style="color: #000000;">&#40;</span> aList, <span style="color: #000000;">&#123;</span> | u, i | aList<span style="color: #000000;">&#91;</span> i <span style="color: #000000;">&#93;</span> := i <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">WHILE</span> LEN<span style="color: #000000;">&#40;</span> aList <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br /><br />&nbsp; &nbsp; &nbsp; SYSREFRESH<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; nAt := HB_RandomInt<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, LEN<span style="color: #000000;">&#40;</span> aList <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; AADD<span style="color: #000000;">&#40;</span> aRandom, aList<span style="color: #000000;">&#91;</span> nAt <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; ADEL<span style="color: #000000;">&#40;</span> aList, nAt, .T. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDDO</span><br /><br />&nbsp; &nbsp;XBROWSER aRandom SHOW RECID<br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">// FIN / END</span><br />&nbsp;</div>[/code:3jy0qxsz]
nRandom Numbers no duplicates
[code=fw:2z2mw3aw]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// \samples\RANDOM2.PRG</span><br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #00C800;">STATIC</span> aNumeros<br /><br /><span style="color: #00C800;">FUNCTION</span> RandomList<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> cTexto := <span style="color: #ff0000;">""</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> cFile &nbsp;:= &nbsp;<span style="color: #ff0000;">"numeros.txt"</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> nSort<br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// aqui inicia o sorteio considerando o range de 1 até 100</span><br />&nbsp; &nbsp;MySorteio<span style="color: #000000;">&#40;</span> .T., <span style="color: #000000;">10</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">WHILE</span><span style="color: #000000;">&#40;</span> nSort := MySorteio<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <> <span style="color: #000000;">0</span><br /><br />&nbsp; &nbsp; &nbsp; SYSREFRESH<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; cTexto += AllTrim<span style="color: #000000;">&#40;</span> Str<span style="color: #000000;">&#40;</span> nSort <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + Chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">13</span> <span style="color: #000000;">&#41;</span> + Chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">10</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDDO</span><br /><br />&nbsp; &nbsp;MemoWrit<span style="color: #000000;">&#40;</span> cFile, cTexto <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;WinExec<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"notepad "</span> + cFile <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #00C800;">FUNCTION</span> MySorteio<span style="color: #000000;">&#40;</span> lInit, nTotal <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> nI<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> nRet := <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> nNum<br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> nSort := <span style="color: #000000;">0</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> lInit == <span style="color: #00C800;">nil</span><br /><br />&nbsp; &nbsp; &nbsp; lInit := .F.<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> lInit &nbsp; <span style="color: #B900B9;">// inicia array com numeros a serem sorteados</span><br /><br />&nbsp; &nbsp; &nbsp; aNumeros := Array<span style="color: #000000;">&#40;</span> nTotal <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">FOR</span> nI := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> Len<span style="color: #000000;">&#40;</span> aNumeros <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;aNumeros<span style="color: #000000;">&#91;</span> nI <span style="color: #000000;">&#93;</span> := nI<br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">NEXT</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">ELSE</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> ValType<span style="color: #000000;">&#40;</span> aNumeros <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"A"</span> .AND. Len<span style="color: #000000;">&#40;</span> aNumeros <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nNum &nbsp;:= hb_RandomInt<span style="color: #000000;">&#40;</span> Len<span style="color: #000000;">&#40;</span> aNumeros <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nSort := aNumeros<span style="color: #000000;">&#91;</span> nNum <span style="color: #000000;">&#93;</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ADel<span style="color: #000000;">&#40;</span> aNumeros, nNum, .T. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> nSort <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">// FIN / END</span><br />&nbsp;</div>[/code:2z2mw3aw]
nRandom Numbers no duplicates
[code=fw:3w1mjs0h]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">FUNCTION</span> RandomList<span style="color: #000000;">&#40;</span> nNum <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">LOCAL</span> aList := ARRAY<span style="color: #000000;">&#40;</span> nNum <span style="color: #000000;">&#41;</span> <br />   <span style="color: #00C800;">LOCAL</span> nAt, aRandom := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><br />   AEval<span style="color: #000000;">&#40;</span> aList, <span style="color: #000000;">&#123;</span> | u, i | aList<span style="color: #000000;">&#91;</span> i <span style="color: #000000;">&#93;</span> := <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">DO</span> <span style="color: #00C800;">WHILE</span> LEN<span style="color: #000000;">&#40;</span> aRandom <span style="color: #000000;">&#41;</span> < nNum<br /><br />      nAt := HB_RandomInt<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, nNum <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">DO</span> <span style="color: #00C800;">WHILE</span> aList<span style="color: #000000;">&#91;</span> nAt <span style="color: #000000;">&#93;</span> != <span style="color: #000000;">0</span><br />           nAt := HB_RandomInt<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span>, nNum <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">ENDDO</span><br />      <br />      aList<span style="color: #000000;">&#91;</span> nAt <span style="color: #000000;">&#93;</span> := <span style="color: #000000;">1</span><br />      AADD<span style="color: #000000;">&#40;</span> aRandom, nAt <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">ENDDO</span><br /><br />   XBROWSER aRandom SHOW RECID<br /><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:3w1mjs0h]
nRandom Numbers no duplicates
[code=fw:2k70hm8r]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">//------------------------------------------------//</span><br /><span style="color: #B900B9;">// EXTRAER NUMEROS RANDOM SIN DUPLICADOS</span><br /><span style="color: #B900B9;">//------------------------------------------------//</span><br /><span style="color: #00C800;">Function</span> NumRandomNoDuplic<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; <span style="color: #00C800;">local</span> n := <span style="color: #000000;">0</span>, nLen := <span style="color: #000000;">10</span>, nRandom, aRandom := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><br />&nbsp; <span style="color: #00C800;">While</span> n < nLen<br />&nbsp; &nbsp; &nbsp;nRandom := HB_RandomInt<span style="color: #000000;">&#40;</span>nLen<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> AScan<span style="color: #000000;">&#40;</span> aRandom, nRandom <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; n += <span style="color: #000000;">1</span><br />&nbsp; &nbsp; &nbsp; &nbsp; aadd<span style="color: #000000;">&#40;</span> aRandom, nRandom <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; <span style="color: #00C800;">Enddo</span><br />&nbsp;<br />&nbsp; XBROWSER aRandom <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"NUMEROS RANDOM SIN DUPLICADOS"</span> ;<br />&nbsp; &nbsp; &nbsp; SHOW SLNUM ; <br />&nbsp; &nbsp; &nbsp;SETUP <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cHeaders</span> := <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"RANDOM"</span><span style="color: #000000;">&#125;</span>, oBrw:<span style="color: #000000;">nHeadStrAligns</span> := AL_CENTER, oBrw:<span style="color: #000000;">nDataStrAligns</span> := AL_CENTER <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:2k70hm8r]
nRecCount no me anda como quisiera.
Hola. Hago una consulta antes de hacer un insert, pero cuando hago la consulta y me fijo si nReccount() me devuelve valor me dice siempre que es 0 y se que existen valores. porque? gracias. [code=fw:9c83ta2d]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp; oQuery:= tDolphinQry<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;">"SELECT * FROM tbtemporal where "</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"tbtemporal.ficha='"</span> + aDatos<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> + <span style="color: #ff0000;">"' and "</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"tbtemporal.fecha='"</span> + aDatos<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> + <span style="color: #ff0000;">"' and "</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"tbtemporal.hora='"</span> + aDatos<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span> + <span style="color: #ff0000;">"' and "</span> + ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"tbtemporal.codigo='"</span> + aDatos<span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span> + <span style="color: #ff0000;">"'"</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">oServidor</span><span style="color: #000000;">&#41;</span><br /><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> oQuery:<span style="color: #000000;">nRecCount</span> != <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; ? <span style="color: #ff0000;">"existen valores"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span></div>[/code:9c83ta2d]
nRecCount no me anda como quisiera.
Intenta con esto oQry:LastRec() > 0, si te sigue diciendo que esta vacia entonce revisate la tabla o has una revision a las sentencias por parte, seguro no se esta cumpliendo alguna sentencia, prueba que los campos tengan valores, estas aramando el query diciendole que debe cumplir TODAS las sentencias, si falla alguna, ya no se arma, saludos... <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: -->
nRecCount no me anda como quisiera.
[quote="goosfancito":2lgnhli2]Hola. Hago una consulta antes de hacer un insert, pero cuando hago la consulta y me fijo si nReccount() me devuelve valor me dice siempre que es 0 y se que existen valores. porque?[/quote:2lgnhli2] si estas seguro que hay datos en la tabla, entonces te devuelve 0 es porque no hay registros que cumpla con la consulta que estas enviando (100% seguro), para revisar los datos que envias, coloca una "traza" que te muestre la consulta y la ejecutas en la consola de mysql (creo que asi lo hacemos todos que trabajamos con mysql)
nRecCount no me anda como quisiera.
lastkey no me devuelve nada. y si Daniel, estoy verificando que la SELECT sea la correcta, es mas, si lo cargo en un array y busco en ese array estan los datos. sigo.
nRecCount no me anda como quisiera.
Daniel,. El problema lo tengo cuando incluyo en mi WHERE un campo con fecha. si quito ese campo me devuelve valores. asi creo mi tabla: [code=fw:32iw0dyk]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; ::<span style="color: #000000;">oServidor</span>:<span style="color: #000000;">deletetables</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"tbtemporal"</span><span style="color: #000000;">&#125;</span>, .t. <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;adatos:= <span style="color: #000000;">&#123;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"id"</span>, <span style="color: #ff0000;">"n"</span>, <span style="color: #000000;">5</span>, <span style="color: #000000;">0</span>, .t., <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"ficha"</span>, <span style="color: #ff0000;">"C"</span>, <span style="color: #000000;">5</span>, <span style="color: #000000;">0</span>, .t., <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"fecha"</span>, <span style="color: #ff0000;">"d"</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, .t., <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"hora"</span>, <span style="color: #ff0000;">"c"</span>, <span style="color: #000000;">5</span>, <span style="color: #000000;">0</span>, .t., <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"reloj"</span>, <span style="color: #ff0000;">"c"</span>, <span style="color: #000000;">2</span>, <span style="color: #000000;">0</span>, .t., <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"codigo"</span>, <span style="color: #ff0000;">"c"</span>, <span style="color: #000000;">2</span>, <span style="color: #000000;">0</span>, .t., <span style="color: #00C800;">nil</span> <span style="color: #000000;">&#125;</span>;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;::<span style="color: #000000;">oServidor</span>:<span style="color: #000000;">createtable</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"tbtemporal"</span>, adatos, <span style="color: #ff0000;">"id"</span>, <span style="color: #ff0000;">"id"</span>, <span style="color: #ff0000;">"id"</span><span style="color: #000000;">&#41;</span></div>[/code:32iw0dyk]
nRecCount no me anda como quisiera.
Hola tienes la sentencia SELECT mal... [quote="goosfancito":3r3dafay]El problema lo tengo cuando incluyo en mi WHERE un campo con fecha. si quito ese campo me devuelve valores.[/quote:3r3dafay] entonces la fecha esta mal... recuerda que en mysql la fecha es con este formato "yyyy-mm-dd", debes convertirla dolphin te brinda la funcion ClipValue2Sql, esta detecta automaticamente el tipo de dato en harbour y regresa el valor para usarse en mysql ejemplo ClipValue2Sql( date() ) devuelve '2012-04-24' (incluyendo las comillas simples)
nRecCount no me anda como quisiera.
de igual manera recuerda el tip anterior para futuras conflictos, problemas o errores [quote="Daniel Garcia-Gil":1v1mff9b]para revisar los datos que envias, coloca una "traza" que te muestre la consulta y la ejecutas en la consola de mysql (creo que asi lo hacemos todos que trabajamos con mysql)[/quote:1v1mff9b]
nRecCount no me anda como quisiera.
Daniel, Era eso, gracias nuevamente.
nRgb( 204 255 204 ) con tExcelScript
Estimados, Yo hago esto: [code:1dcpoln7]#define CLR_FONDO_CELDA nRgb&#40; 204, 255, 204 &#41; //GoosFancito[/code:1dcpoln7] Luego quiero utilizarlo aca: [code:1dcpoln7]oExcel&#58;say&#40;01, 01, "PESQUERA", , CLR_FONDO_CELDA,,,,,&#41;[/code:1dcpoln7] Y me da error. En que le estoy pifiando? ( lease pifiando = errando ) Gracias.
nRgb( 204 255 204 ) con tExcelScript
Gustavo, Que error ?
nRgb( 204 255 204 ) con tExcelScript
Antonio, El editor que estoy usando me tiraba que en esa posicion iba el color de fondo. cambiando la estructura ya no tengo el mismo error. Gracias.
nRowsCount - nColsCount de tExcelScript
Hola amigos alguien tiene las funciones nRowsCount() y nColsCount() de tExcelScript para que las comparta conmigo?? cRange:=cMakeRange( 5 , nCol, ( 5+oExcel:nRowsCount() ) - 1 , ( nCol+oExcel:nColsCount())-1 ) muchas gracias de antemano Saludos Jorge Vargas
nSerialHD
Vengo utilizando esta función para leer la serie del disco duro. Mi sorpresa ha sido, cuando ha cambiado el número de un dia para otro. Ayer me daba 4589615 y hoy 4589639.- ¿Hay alguna razón lógica?
nSerialHD
LOCAL nSerie, cClave nSerie := ALLTRIM( STR( nSerialHD( "C:\" ) ) ) cClave := ENCRYPT( nSerie,"HD" )
nSerialHD
Gracias Joao
nSerialHD Return not the same result
I just migrate my application from FW to FWH. In FW nSerialHD() alway return the same number but in FWH will return the differance when I've change some detail in my source ( add or delete some function or procedure). How can i solved this problem?
nSerialHD Return not the same result
Please add this function to your main PRG: [code:1k74v16b] #pragma BEGINDUMP #include <hbapi&#46;h> #include <windows&#46;h> HB_FUNC&#40; NSERIALHD &#41; &#123; DWORD dwVolumeSerialNumber; BYTE VolumeNameBuffer&#91; 256 &#93;; BYTE FileSystemNameBuffer&#91; 256 &#93;; GetVolumeInformation&#40; hb_pcount&#40;&#41; ? hb_parc&#40; 1 &#41;&#58; "C&#58;\\", &#40; char * &#41; VolumeNameBuffer, sizeof&#40; VolumeNameBuffer &#41;, &dwVolumeSerialNumber, 0, 0, &#40; char * &#41; FileSystemNameBuffer, sizeof&#40; FileSystemNameBuffer &#41; &#41;; hb_retnl&#40; dwVolumeSerialNumber &#41;; &#125; #pragma ENDDUMP [/code:1k74v16b]
nSerialHD Return not the same result
It work! Thank you,
nSerialHD question
Hi, Does nSerialHD works with several storage devices such as: Pens Portable Harddrive SD s Regards Antonio
nSerialHD question
Antonio, No. For pendrives please review fwh\samples\Protect.prg
nSerialHD question
Ok thanks. Antonio
nSerialHD question
By the way. Can I test to see if it is a hard disk drive ? Antonio
nSerialHD question
Antonio, Remove ".and. GetDriveType( cDrive ) == DRIVE_REMOVABLE" in fwh\samples\protect.prg, or check with other constants there
nSerialHD question
Thanks Antonio
nSerialHD question again
Hi, Calling nSerailHd() without any parametyers : Is it garantee that nHserialHd always return a number ? If the PC doesn't has any hard disk what it returns ? If the PC has more than one hard disk ? Regards Antonio
nSerialHD question again
Antonio, > Is it garantee that nHserialHd always return a number ? It should > If the PC doesn't has any hard disk what it returns ? How did the PC boot then ? Using a CD/DVD or pendrive or network ? We have not tested it with no HD on the PC. > If the PC has more than one hard disk ? You can specify the drive to check: nSerialHD( "D:\" )