topic
stringlengths
1
63
text
stringlengths
1
577k
xBrowse 1408 Edit_Get_Button
Rao Thank you for your recent fixes !! Rick Lipkin
xBrowse 1408 TAB thru Edit_Get Button
Antonio and Rao Please look at being able to TAB through EDIT_GET_BUTTON as well as EDIT_LISTBOX. Thanks Rick Lipkin
xBrowse 1408 TAB thru Edit_Get Button
Fixed FWH 14.09
xBrowse 2010 look..
Dear All, Any with 2010 look on xBrowse?
xBrowse 3 reg por pagina
Yo pondría en xBrowse para mostrar tres registros por página. ¿es posible? Por supuesto, cuando se le informó que el xBrowse deberá demostrar que la altura de las células ronaldo
xBrowse 3 reg por pagina
Yes. Please set oBrw:nRowHeight equal to 1/3 or the height of browse defined by you.
xBrowse 3 reg por pagina
but I need to properly adjust the xbrowse 3 lines at the right height
xBrowse 3 reg por pagina
Please try the logic in this sample: [code=fw:1chgaoyz]<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;">"ord.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"hbcompat.ch"</span><br /><br />REQUEST DBFCDX<br /><br />#xtranslate <x> <span style="color: #000000;">&#91;</span>is<span style="color: #000000;">&#93;</span> between <a> and <b>  => <span style="color: #000000;">&#40;</span> <x> >= <a> .and. <x> <= <b> <span style="color: #000000;">&#41;</span><br />#xtranslate <x> <span style="color: #000000;">&#91;</span>is<span style="color: #000000;">&#93;</span> not between <a> and <b> => !<span style="color: #000000;">&#40;</span> <x> between <a> and <b> <span style="color: #000000;">&#41;</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: #00C800;">local</span> oDlg, oBrw<br /><br />   USE CUSTOMER <span style="color: #00C800;">NEW</span> VIA <span style="color: #ff0000;">'DBFCDX'</span><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">500</span>,<span style="color: #000000;">500</span> <span style="color: #0000ff;">PIXEL</span><br />   @ <span style="color: #000000;">10</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-10</span>,<span style="color: #000000;">-10</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />      <span style="color: #0000ff;">AUTOCOLS</span> <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"CUSTOMER"</span> FOOTERS CELL LINES NOBORDER<br />   oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> ;<br />      <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> SetBrwSize<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span><br /><br />   CLOSE CUSTOMER<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> SetBrwSize<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oDlg     := oBrw:<span style="color: #000000;">oWnd</span><br />   <span style="color: #00C800;">local</span> aRect    := oBrw:<span style="color: #000000;">DataRect</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> nHeight  := aRect<span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> - aRect<span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> + <span style="color: #000000;">1</span><br />   <span style="color: #00C800;">local</span> nAdjust<br />   <span style="color: #00C800;">local</span> lFixedRowHeight := .t.   <span style="color: #B900B9;">// try with .t. or .f.</span><br /><br />   <span style="color: #00C800;">if</span> lFixedRowHeight<br />      oBrw:<span style="color: #000000;">nRowHeight</span>:= <span style="color: #000000;">40</span><br />   <span style="color: #00C800;">else</span><br />      oBrw:<span style="color: #000000;">nRowHeight</span> := Int<span style="color: #000000;">&#40;</span> nHeight / <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">endif</span><br /><br />   nAdjust        := <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">nRowHeight</span> * <span style="color: #000000;">3</span> - nHeight + <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span><br />   oBrw:<span style="color: #000000;">nHeight</span>   += nAdjust<br />   oDlg:<span style="color: #000000;">nHeight</span>   += nAdjust<br />   oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> .f.<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /> </div>[/code:1chgaoyz] Result with lFixedRowHeight := .t. [url=http&#58;//img573&#46;imageshack&#46;us/i/xbrsize1&#46;jpg/:1chgaoyz][img:1chgaoyz]http&#58;//img573&#46;imageshack&#46;us/img573/4857/xbrsize1&#46;jpg[/img:1chgaoyz][/url:1chgaoyz] With lFixedRowHeight := .f. [url=http&#58;//img204&#46;imageshack&#46;us/i/xbrssize2&#46;jpg/:1chgaoyz][img:1chgaoyz]http&#58;//img204&#46;imageshack&#46;us/img204/7295/xbrssize2&#46;jpg[/img:1chgaoyz][/url:1chgaoyz]
xBrowse 3 reg por pagina
Gracias
xBrowse : < oCol:nCreationOrder > Error
Hello, from Germany I want to create a xBrowser with automatic Col-defines [code:1htkt75u] // It works without define each COL // like i need it&#46; // ------------------------------------------------- lOemAnsi &#58;= &#46;T&#46; // to show old DOS-Clipper DBF // --------------------------------------- oBrw5 &#58;= TXBrowse&#40;&#41;&#58;New&#40; oDlg &#41; oBrw5&#58;nMarqueeStyle &#58;= MARQSTYLE_HIGHLROW oBrw5&#58;nColDividerStyle &#58;= LINESTYLE_BLACK oBrw5&#58;nRowDividerStyle &#58;= LINESTYLE_BLACK oBrw5&#58;lColDividerComplete &#58;= &#46;t&#46; oBrw5&#58;nHeaderLines &#58;= 1 oBrw5&#58;nDataLines &#58;= 1 oBrw5&#58;lAllowColSwapping &#58;= &#46;t&#46; oBrw5&#58;SetRDD&#40;&#41; FOR nFor &#58;= 1 to LEN&#40; oBrw5&#58;aCols &#41; oCol &#58;= oBrw5&#58;aCols&#91; nFor &#93; // To show D- and L-vars = Centered, N = Right // otherwise everything is shown left // --------------------------------------------------------- IF VALTYPE&#40;&#40;cAlias1&#41;->&#40;FieldGet&#40;nFor&#41;&#41;&#41; = 'N' oCol&#58;nDataStrAlign &#58;= AL_RIGHT ENDIF IF VALTYPE&#40;&#40;cAlias1&#41;->&#40;FieldGet&#40;nFor&#41;&#41;&#41; = 'D' &#46;or&#46; ; VALTYPE&#40;&#40;cAlias1&#41;->&#40;FieldGet&#40;nFor&#41;&#41;&#41; = 'L' oCol&#58;nDataStrAlign &#58;= AL_CENTER ENDIF // --------------------------------------------------------- oCol&#58;nEditType &#58;= 1 oCol&#58;nEditType &#58;= EDIT_GET // Shows OemToAnsi => if lOemnsi = &#46;T&#46; // -------------------------------------------------- oCol&#58;bStrData &#58;= &#123; |oCol| nOrder &#58;= oCol&#58;nCreationOrder, ; IIF&#40; VALTYPE&#40; &#40;cAlias1&#41;->&#40;FieldGet&#40;nOrder&#41;&#41; &#41; = 'C' ; &#46;and&#46; lOemAnsi = &#46;T&#46;, ; cValToChar&#40; OemToAnsi&#40; &#40; cAlias1 &#41;->&#40; FieldGet&#40; nOrder &#41; &#41;&#41; &#41;, ; cValToChar&#40; &#40; cAlias1 &#41;->&#40; FieldGet&#40; nOrder &#41; &#41;&#41; &#41; &#125; oCol&#58;nEditType &#58;= 1 oCol&#58;nEditType &#58;= EDIT_GET oCol&#58;bOnPostEdit&#58;= &#123; |oCol,xValue,nLastKey| ; nOrder &#58;= oCol&#58;nCreationOrder, ; BRW_SAVE&#40;oBrw5,xValue,nLastKey,cAlias1,nOrder,lOemAnsi&#41; &#125; next oBrw5&#58;CreateFromResource&#40; 110 &#41; &#46;&#46;&#46;&#46;&#46;&#46;&#46;&#46;&#46; &#46;&#46;&#46;&#46;&#46;&#46;&#46;&#46;&#46; On DBL-Click i get the Error in < oCol&#58;bStrData > In < oCol&#58;bOnPostEdit > there is no error and the Function < BRW_SAVE > saves C-Strings in AnsiToOem-Format !! // ------------------------------------------------------------- Error BASE/1004 Class&#58; 'NIL' has no exported method&#58; NCREATIONORDER Args&#58; &#91; 1&#93; = U Stack Calls ======== => NCREATIONORDER&#40;0&#41; ------------------------------------ &#40; oCol&#58;bStrData &#58;= &#123; |oCol| nOrder &#58;= oCol&#58;nCreationOrder &#41; xBrowse&#46;PRG => TXBRWCOLUMN&#58;EDIT&#40;4465&#41; xBrowse&#46;PRG => TXBROWSE&#58;LDBLCLICK&#40;2325&#41; //---------------------------------------------------------------------------// FUNCTION BRW_SAVE&#40;oBrw,xValue,nLastKey,cAlias,nOrder,lOemAnsi&#41; IF nLastKey == 13 IF VALTYPE&#40;&#40;cAlias&#41;->&#40;FieldGet&#40;nPOS&#41;&#41;&#41; = 'C' &#46;and&#46; lOemAnsi = &#46;T&#46; xValue &#58;= AnsiToOem&#40; xValue &#41; ELSEIF VALTYPE&#40;&#40;cAlias&#41;->&#40;FieldGet&#40;nPOS&#41;&#41;&#41; = 'C' &#46;and&#46; lOemAnsi = &#46;F&#46; xValue &#58;= xValue ELSEIF VALTYPE&#40;&#40;cAlias&#41;->&#40;FieldGet&#40;nPOS&#41;&#41;&#41; = 'N' xValue &#58;= Val&#40; xValue &#41; ELSEIF VALTYPE&#40;&#40;cAlias&#41;->&#40;FieldGet&#40;nPOS&#41;&#41;&#41; = 'D' IF EMPTY&#40;CTOD&#40; ALLTRIM&#40; xValue &#41; &#41;&#41; // IF Edit-xValue = "10102007" xValue = 10&#46;10&#46;2007 xValue &#58;= SUBSTR&#40; xValue,1,2&#41; + "&#46;" + ; SUBSTR&#40;xValue,4,2&#41; + "&#46;" + SUBSTR&#40; xValue,5,4&#41; ENDIF xValue &#58;= CTOD&#40; ALLTRIM&#40; xValue &#41; &#41; ELSEIF VALTYPE&#40;&#40;cAlias&#41;->&#40;FieldGet&#40;nPOS&#41;&#41;&#41; = 'L' xValue &#58;= &#40; Upper&#40; Left &#40; LTrim&#40; xValue &#41;, 1 &#41; &#41; $ "YT" &#41; ENDIF IF NET_RLOCK&#40;&#41; &#40;cAlias&#41;->&#40; FieldPut&#40; nPOS, xValue &#41; &#41; NET_ULOCK&#40;&#41; ENDIF oBrw&#58;DrawLine&#40; &#46;t&#46; &#41; oBrw&#58;Refresh&#40;&#41; ENDIF RETURN NIL [/code:1htkt75u] [img:1htkt75u]http&#58;//www&#46;pflegeplus&#46;com/pictures/xbrowse1&#46;jpg[/img:1htkt75u] It works i can read OemtoAnsi and write AnsiToOem back. Only on DBL-Click inside of a col i get the error. When i don't define < oCol:bStrData > everything is ok. But i have to read in format < OemToAnsi >. Maybe somebody knows, what to do with < oCol:bStrdata > ? Regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> [/img]
xBrowse : Arraysort and arrayseek (again)
Browsing a array make it possible to have each column as seek column , a dbf only the columns with a index. A index can be very complicated, see in the example column3 , numbers are omitted from the ordering (and seek) In many cases i try to use a array instead from a dbf. To have the same results from the dbf ordering and seek must be the same as in the dbf. In this example i use CUSTUMER.DBF as example. In the arrayseek i have as ordering (and seek) for the columns FIRST (1) : FIRST + LAST (secundary key) LAST (2) : LAST + FIRST STREET (3) : Numbers and spaces are omitted These columns have also an index , dbfseek must give the same results To show the possibility's from the arrayseek (and sort) i added : CITY (4) : CITY + STREET(numbers and spaces omitted) STATE(5) : STATE + CITY NOTES (11) : Only numbers are concidered. Ordering (and seek) on recordnumber !!! Only few changes are needed in xbrowse , the example is complete [code=fw:2eg7svdl]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"InKey.ch"</span><br /># include <span style="color: #ff0000;">"common.ch"</span><br /># <span style="color: #0000ff;">define</span> bORDER1       <span style="color: #000000;">&#123;</span>|a|IIF<span style="color: #000000;">&#40;</span>pCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>==<span style="color: #000000;">0</span> , a := <span style="color: #000000;">&#123;</span>FIELD->First,FIELD->Last<span style="color: #000000;">&#125;</span>,<span style="color: #000000;">&#41;</span> , PAD<span style="color: #000000;">&#40;</span>UPPER<span style="color: #000000;">&#40;</span>TRIM<span style="color: #000000;">&#40;</span>a<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>+TRIM<span style="color: #000000;">&#40;</span>a<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br /># <span style="color: #0000ff;">define</span> bORDER2       <span style="color: #000000;">&#123;</span>|a|IIF<span style="color: #000000;">&#40;</span>pCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>==<span style="color: #000000;">0</span> , a := <span style="color: #000000;">&#123;</span>FIELD->Last,FIELD->First<span style="color: #000000;">&#125;</span>,<span style="color: #000000;">&#41;</span> , PAD<span style="color: #000000;">&#40;</span>UPPER<span style="color: #000000;">&#40;</span>TRIM<span style="color: #000000;">&#40;</span>a<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>+TRIM<span style="color: #000000;">&#40;</span>a<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br /># <span style="color: #0000ff;">define</span> bORDER3       <span style="color: #000000;">&#123;</span>|a|PAD<span style="color: #000000;">&#40;</span>CharOnly<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"ABCDEFGHIJKLMNOPQRSTUVWXYZ"</span>,UPPER<span style="color: #000000;">&#40;</span>TRIM<span style="color: #000000;">&#40;</span>IIF<span style="color: #000000;">&#40;</span>PCOUNT<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>==<span style="color: #000000;">0</span>,FIELD->Street,a<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br /><span style="color: #00C800;">static</span> oWnd<br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />***************<br />    SET _3DLOOK <span style="color: #0000ff;">ON</span><br />    SET<span style="color: #000000;">&#40;</span>_SET_AUTOPEN, .F. <span style="color: #000000;">&#41;</span>                            <span style="color: #B900B9;">// Auto open cdx-file</span><br />   REQUEST DBFCDX<br />   rddsetdefault<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #000000;">&#41;</span><br />     <span style="color: #00C800;">IF</span> File<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Cust.cdx"</span><span style="color: #000000;">&#41;</span><br />        fErase<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Cust.cdx"</span><span style="color: #000000;">&#41;</span><br />     end<br />     USE CUSTOMER <span style="color: #00C800;">NEW</span> SHARED<br />     SET <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">TO</span><br />     <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> EVAL<span style="color: #000000;">&#40;</span>bORDER1<span style="color: #000000;">&#41;</span> TAG First <span style="color: #0000ff;">TO</span> Cust     <span style="color: #B900B9;">// EVAL(bORDER1) is executed without parameter</span><br />     <span style="color: #B900B9;">//INDEX ON PAD(UPPER(TRIM(First))+UPPER(TRIM(Last)),20) TAG First TO Cust</span><br />     <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> EVAL<span style="color: #000000;">&#40;</span>bORDER2<span style="color: #000000;">&#41;</span> TAG Last <span style="color: #0000ff;">TO</span> Cust      <span style="color: #B900B9;">// EVAL(bORDER2) is executed without parameter</span><br />     <span style="color: #B900B9;">//INDEX ON PAD(UPPER(TRIM(Last))+UPPER(TRIM(First)),20) TAG Last TO Cust</span><br />     <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> EVAL<span style="color: #000000;">&#40;</span>bORDER3<span style="color: #000000;">&#41;</span> TAG STREET <span style="color: #0000ff;">TO</span> Cust    <span style="color: #B900B9;">// EVAL(bORDER3) is executed without parameter</span><br />     <span style="color: #B900B9;">//INDEX ON PAD(CharOnly("ABCDEFGHIJKLMNOPQRSTUVWXYZ",UPPER(TRIM(Street))),20) TAG STREET TO Cust</span><br />     SET <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">TO</span> CUST<br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">2</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">20</span>, <span style="color: #000000;">70</span> ;<br />      <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Autosort and seek in Array with Secondary key(s)"</span> ;<br />      <span style="color: #0000ff;">MENU</span> BuildMenu<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">MAXIMIZED</span><br />     CLOSE ALL<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> BuildMenu<span style="color: #000000;">&#40;</span>oWnd<span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> oMenu, oItem<br /><span style="color: #0000ff;">MENU</span> oMenu<br />    <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Autorder and seek in Array"</span>;<br />    <span style="color: #0000ff;">ACTION</span>  ArraySortSeek<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />    <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Autorder and seek in DBF (Index)"</span>;<br />    <span style="color: #0000ff;">ACTION</span>  DbfSortSeek<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #0000ff;">ENDMENU</span><br /><span style="color: #00C800;">return</span> oMenu<br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> ArraySortSeek<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />*******************************<br />   <span style="color: #00C800;">local</span> oBrw, oCol<br />     <span style="color: #00C800;">local</span> Arr<span style="color: #000000;">&#91;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#93;</span> , i , oSay<br />     <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Autosort and seek in Array"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">1200</span>,<span style="color: #000000;">800</span> <span style="color: #0000ff;">PIXEL</span><span style="color: #B900B9;">//MDICHILD OF oWnd</span><br />     DBEVAL<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#123;</span>||AADD<span style="color: #000000;">&#40;</span>Arr,ReadRec<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br />     GO BOTTOM<br />     @ <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oDlg ARRAY Arr <span style="color: #0000ff;">AUTOCOLS</span> AUTOSORT <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">600</span>,<span style="color: #000000;">350</span> <span style="color: #0000ff;">PIXEL</span><br />   oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />     <span style="color: #00C800;">FOR</span> EACH oCol IN oBrw:<span style="color: #000000;">aCols</span><br />        i := Hb_EnumIndex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />        oCol:<span style="color: #000000;">cHeader</span> := FieldName<span style="color: #000000;">&#40;</span>i<span style="color: #000000;">&#41;</span><br />     <span style="color: #00C800;">NEXT</span><br />     oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bOrder</span> := bORDER1 <span style="color: #B900B9;">// EVAL(bORDER1) will be executed with parameter array oBrw:aRow</span><br />     <span style="color: #B900B9;">//oBrw:aCols[1]:bOrder := {|x|UPPER(TRIM(x[1])+TRIM(x[2]))}</span><br />     oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bOrder</span> := bORDER2 <span style="color: #B900B9;">// EVAL(bORDER2) will be executed with parameter array oBrw:aRow</span><br />     <span style="color: #B900B9;">//oBrw:aCols[2]:bOrder := {|x|UPPER(TRIM(x[2])+TRIM(x[1]))}</span><br />     oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bOrder</span> := bORDER3 <span style="color: #B900B9;">// EVAL(bORDER3) will be executed with parameter array oBrw:aRow</span><br />     oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bOrder</span> := <span style="color: #000000;">&#123;</span>|x|UPPER<span style="color: #000000;">&#40;</span>TRIM<span style="color: #000000;">&#40;</span>x<span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+EVAL<span style="color: #000000;">&#40;</span>bORDER3,x<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span>   <span style="color: #B900B9;">// In DBF no Index , here on CITY + STREET (Alfabetic , no numbers or space)</span><br />     oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bOrder</span> := <span style="color: #000000;">&#123;</span>|x|UPPER<span style="color: #000000;">&#40;</span>TRIM<span style="color: #000000;">&#40;</span>x<span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>+TRIM<span style="color: #000000;">&#40;</span>x<span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span>        <span style="color: #B900B9;">// In DBF no Index , here on STATE + CITY</span><br />     oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">11</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bOrder</span> := <span style="color: #000000;">&#123;</span>|x|VAL<span style="color: #000000;">&#40;</span>CharOnly<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"1234567890"</span>,TRIM<span style="color: #000000;">&#40;</span>x<span style="color: #000000;">&#91;</span><span style="color: #000000;">11</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span>        <span style="color: #B900B9;">// In DBF no Index , here on NOTES , only numbers , record number !</span><br />     @ <span style="color: #000000;">360</span> , <span style="color: #000000;">100</span> <span style="color: #0000ff;">SAY</span> oBrw:<span style="color: #000000;">oSeek</span> <span style="color: #0000ff;">PROMPT</span> oBrw:<span style="color: #000000;">cSeek</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PIXEL</span> BORDER <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">12</span><span style="color: #B900B9;">//SHADED</span><br />   oBrw:<span style="color: #000000;">bSeek</span> := <span style="color: #000000;">&#123;</span> | c | MySeekOnArray<span style="color: #000000;">&#40;</span> oBrw, oBrw:<span style="color: #000000;">aArrayData</span>, c <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />     <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cOrder</span>:=<span style="color: #ff0000;">"D"</span>,oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">SortArrayData</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> , oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br />********************************************************************************************<br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> DbfSortSeek<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />******************************<br />   <span style="color: #00C800;">local</span> oBrw, oCol<br />     <span style="color: #00C800;">local</span> Arr<span style="color: #000000;">&#91;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#93;</span> , i , oSay<br />     OrdSetFocus<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"First"</span><span style="color: #000000;">&#41;</span><br />     <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Auto Sort and seek in DBF"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">1200</span>,<span style="color: #000000;">800</span> <span style="color: #0000ff;">PIXEL</span><span style="color: #B900B9;">//MDICHILD OF oWnd</span><br />     GO BOTTOM<br />     @ <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"Customer"</span> <span style="color: #0000ff;">AUTOCOLS</span> AUTOSORT <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">600</span>,<span style="color: #000000;">350</span> <span style="color: #0000ff;">PIXEL</span><br />   oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />     @ <span style="color: #000000;">360</span> , <span style="color: #000000;">100</span> <span style="color: #0000ff;">SAY</span> oBrw:<span style="color: #000000;">oSeek</span> <span style="color: #0000ff;">PROMPT</span> oBrw:<span style="color: #000000;">cSeek</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PIXEL</span> BORDER <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">12</span>  <span style="color: #B900B9;">// SIZE MUST BE SPECIFIED , LEN(oBrw:cSeek) = 0 , oSay isn't showed without size</span><br />   oBrw:<span style="color: #000000;">bSeek</span> := <span style="color: #000000;">&#123;</span> | c | DbSeek<span style="color: #000000;">&#40;</span>UPPER<span style="color: #000000;">&#40;</span>c<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>   <span style="color: #B900B9;">// needed to upperseek (FWH 8.10) !</span><br />     <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">SetFocus</span><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> READREC<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />******************<br /><span style="color: #00C800;">LOCAL</span> aField<span style="color: #000000;">&#91;</span>fCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><br /><span style="color: #00C800;">LOCAL</span> i<br /><span style="color: #00C800;">FOR</span> i := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> fCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />    aField<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span> := FieldGet<span style="color: #000000;">&#40;</span>i<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">NEXT</span><br /><span style="color: #00C800;">RETURN</span> aField<br />***********************************************************************************************<br /><span style="color: #0000ff;">INIT</span> PROC InitXbrow<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />     OVERRIDE <span style="color: #00C800;">METHOD</span> SortArrayData IN <span style="color: #00C800;">CLASS</span> TXBrwColumn WITH MySortArray <span style="color: #B900B9;">// ClasTSCom7</span><br />     EXTEND <span style="color: #00C800;">CLASS</span> TXBrwColumn WITH <span style="color: #00C800;">DATA</span> bOrder<br /><span style="color: #00C800;">RETURN</span><br />*****************************************************************<br /><span style="color: #00C800;">FUNCTION</span> MySortArray<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #B900B9;">//  CLASS TXBrwColumn</span><br />**********************<br /> <span style="color: #00C800;">LOCAL</span> <span style="color: #00C800;">Self</span> := HB_QSelf<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />  <span style="color: #00C800;">local</span> aCols<br />   <span style="color: #00C800;">local</span> cOrder<br />   <span style="color: #00C800;">local</span> nAt, nFor, nLen<br />   <span style="color: #00C800;">local</span> uSave, cType<br />     # ifdef FRANKDEMONT<br />     <span style="color: #00C800;">local</span> bOrder<br />     # <span style="color: #00C800;">endif</span><br />   aCols  := ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aCols</span><br />   cOrder := ::<span style="color: #000000;">cOrder</span><br />   nLen   := Len<span style="color: #000000;">&#40;</span> aCols <span style="color: #000000;">&#41;</span><br />   nAt    := <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ValType<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cSortOrder</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">'N'</span>, ::<span style="color: #000000;">cSortOrder</span>, ::<span style="color: #000000;">nArrayCol</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">if</span> Len<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span> <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br />      cType       := ValType<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">if</span> cType == <span style="color: #ff0000;">'A'</span><br />         <span style="color: #00C800;">if</span> ValType<span style="color: #000000;">&#40;</span> nAt <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">'N'</span> .and. nAt > <span style="color: #000000;">0</span> .and. nAt <= nLen<br />            <span style="color: #00C800;">for</span> nFor := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> nLen<br />               <span style="color: #00C800;">if</span> aCols<span style="color: #000000;">&#91;</span> nFor <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nArrayCol</span> != ::<span style="color: #000000;">nArrayCol</span><br />                  aCols<span style="color: #000000;">&#91;</span> nFor <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cOrder</span> := <span style="color: #ff0000;">""</span><br />               <span style="color: #00C800;">endif</span><br />            <span style="color: #00C800;">next</span><br />            uSave    := ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">&#91;</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">nArrayAt</span> <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> ::<span style="color: #000000;">nArrayCol</span> <span style="color: #000000;">&#93;</span><br />                        # ifdef FRANKDEMONT<br />                        uSave := IIF<span style="color: #000000;">&#40;</span>Isnil<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">bOrder</span><span style="color: #000000;">&#41;</span> , ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">&#91;</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">nArrayAt</span> <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> ::<span style="color: #000000;">nArrayCol</span> <span style="color: #000000;">&#93;</span> , ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; EVAL<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">bOrder</span>, ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">&#91;</span>::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">nArrayAt</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">if</span> cOrder == <span style="color: #ff0000;">'A'</span><br />                            <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">bOrder</span> = <span style="color: #00C800;">nil</span><br />                                bOrder := <span style="color: #000000;">&#123;</span>|x,y| x<span style="color: #000000;">&#91;</span> nAt <span style="color: #000000;">&#93;</span> > y<span style="color: #000000;">&#91;</span> nAt <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#125;</span><br />                            <span style="color: #00C800;">ELSE</span><br />                                bOrder := <span style="color: #000000;">&#123;</span>|x,y| EVAL<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">bOrder</span>,x<span style="color: #000000;">&#41;</span> > EVAL<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">bOrder</span>,y<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />                            <span style="color: #00C800;">ENDIF</span><br />               ::<span style="color: #000000;">cOrder</span>     := <span style="color: #ff0000;">'D'</span><br />            <span style="color: #00C800;">else</span><br />                            <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">bOrder</span> = <span style="color: #00C800;">nil</span><br />                                bOrder := <span style="color: #000000;">&#123;</span>|x,y| x<span style="color: #000000;">&#91;</span> nAt <span style="color: #000000;">&#93;</span> < y<span style="color: #000000;">&#91;</span> nAt <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#125;</span><br />                            <span style="color: #00C800;">ELSE</span><br />                                bOrder := <span style="color: #000000;">&#123;</span>|x,y| EVAL<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">bOrder</span>,x<span style="color: #000000;">&#41;</span> < EVAL<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">bOrder</span>,y<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />                            <span style="color: #00C800;">ENDIF</span><br />               ::<span style="color: #000000;">cOrder</span>     := <span style="color: #ff0000;">'A'</span><br />            <span style="color: #00C800;">endif</span><br />                        ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span> := Asort<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span>,,, bOrder  <span style="color: #000000;">&#41;</span><br />                        <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">bOrder</span> = <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">nArrayAt</span> &nbsp; := AScan<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span>, <span style="color: #000000;">&#123;</span> |a| a<span style="color: #000000;">&#91;</span> ::<span style="color: #000000;">nArrayCol</span> <span style="color: #000000;">&#93;</span> == uSave <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">nArrayAt</span> &nbsp; := AScan<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span>, <span style="color: #000000;">&#123;</span> |a| EVAL<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">bOrder</span>,a<span style="color: #000000;">&#41;</span> == uSave <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; END<br /># <span style="color: #00C800;">else</span><br />                        <span style="color: #00C800;">if</span> cOrder == <span style="color: #ff0000;">'A'</span><br />               ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span> := Asort<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span>,,, <span style="color: #000000;">&#123;</span>|x,y| x<span style="color: #000000;">&#91;</span> nAt <span style="color: #000000;">&#93;</span> > y<span style="color: #000000;">&#91;</span> nAt <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />               ::<span style="color: #000000;">cOrder</span>     := <span style="color: #ff0000;">'D'</span><br />            <span style="color: #00C800;">else</span><br />               ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span> := Asort<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span>,,, <span style="color: #000000;">&#123;</span>|x,y| x<span style="color: #000000;">&#91;</span> nAt <span style="color: #000000;">&#93;</span> < y<span style="color: #000000;">&#91;</span> nAt <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />               ::<span style="color: #000000;">cOrder</span>     := <span style="color: #ff0000;">'A'</span><br />            <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">nArrayAt</span> &nbsp; := AScan<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span>, <span style="color: #000000;">&#123;</span> |a| a<span style="color: #000000;">&#91;</span> ::<span style="color: #000000;">nArrayCol</span> <span style="color: #000000;">&#93;</span> == uSave <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />                        # <span style="color: #00C800;">endif</span><br />              ::<span style="color: #000000;">oBrw</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />             <span style="color: #00C800;">endif</span><br />      elseif cType $ <span style="color: #ff0000;">'CDLN'</span><br />         <span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">&#40;</span> cOrder <span style="color: #000000;">&#41;</span><br />            uSave    := ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">&#91;</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">nArrayAt</span> <span style="color: #000000;">&#93;</span><br />            <span style="color: #00C800;">if</span> cOrder == <span style="color: #ff0000;">'A'</span><br />               ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span> := ASort<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span>,,,<span style="color: #000000;">&#123;</span>|x,y| cValToChar<span style="color: #000000;">&#40;</span> x <span style="color: #000000;">&#41;</span> > cValToChar<span style="color: #000000;">&#40;</span> y <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />               ::<span style="color: #000000;">cOrder</span> := <span style="color: #ff0000;">'D'</span><br />            <span style="color: #00C800;">else</span><br />               ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span> := ASort<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span>,,,<span style="color: #000000;">&#123;</span>|x,y| cValToChar<span style="color: #000000;">&#40;</span> x <span style="color: #000000;">&#41;</span> < cValToChar<span style="color: #000000;">&#40;</span> y <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />               ::<span style="color: #000000;">cOrder</span> := <span style="color: #ff0000;">'A'</span><br />            <span style="color: #00C800;">endif</span><br />            ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">nArrayAt</span>      := AScan<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span>, uSave <span style="color: #000000;">&#41;</span><br />            ::<span style="color: #000000;">oBrw</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />         <span style="color: #00C800;">endif</span><br />      <span style="color: #00C800;">endif</span><br />   <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">self</span><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #00C800;">FUNCTION</span> MySeekOnArray<span style="color: #000000;">&#40;</span> <span style="color: #00C800;">Self</span>, aData, cSeek <span style="color: #000000;">&#41;</span><br />*******************************************<br />   <span style="color: #00C800;">local</span> aCols<br />   <span style="color: #00C800;">local</span> nAt, nFor, nLen<br />   <span style="color: #00C800;">local</span> lExact<br />   aCols  := ::<span style="color: #000000;">aCols</span><br />   nLen   := len<span style="color: #000000;">&#40;</span> aCols <span style="color: #000000;">&#41;</span><br />   cSeek  := Upper<span style="color: #000000;">&#40;</span> cSeek <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">for</span> nFor := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> nLen<br />      <span style="color: #00C800;">if</span> !<span style="color: #000000;">&#40;</span> aCols<span style="color: #000000;">&#91;</span> nFor <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cOrder</span> == <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span><br />         lExact := Set<span style="color: #000000;">&#40;</span> _SET_EXACT, .f. <span style="color: #000000;">&#41;</span><br />                 # ifdef FRANKDEMONT<br />                 <span style="color: #00C800;">IF</span> IsBlock<span style="color: #000000;">&#40;</span>aCols<span style="color: #000000;">&#91;</span> nFor <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bOrder</span> <span style="color: #000000;">&#41;</span><br />            nAt    := Ascan<span style="color: #000000;">&#40;</span> aData, <span style="color: #000000;">&#123;</span>|v| cValToChar<span style="color: #000000;">&#40;</span>EVAL<span style="color: #000000;">&#40;</span> aCols<span style="color: #000000;">&#91;</span> nFor <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bOrder</span>  , v  <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>  = cSeek <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />                 <span style="color: #00C800;">ELSE</span><br />            nAt    := Ascan<span style="color: #000000;">&#40;</span> aData, <span style="color: #000000;">&#123;</span>|v| Upper<span style="color: #000000;">&#40;</span> cValToChar<span style="color: #000000;">&#40;</span> v<span style="color: #000000;">&#91;</span> aCols<span style="color: #000000;">&#91;</span> nFor <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nCreationOrder</span>  <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> = cSeek <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />                 END<br />                 # <span style="color: #00C800;">else</span><br />         nAt    := Ascan<span style="color: #000000;">&#40;</span> aData, <span style="color: #000000;">&#123;</span>|v| Upper<span style="color: #000000;">&#40;</span> cValToChar<span style="color: #000000;">&#40;</span> v<span style="color: #000000;">&#91;</span> nFor <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> = cSeek <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />         # <span style="color: #00C800;">endif</span><br />                 Set<span style="color: #000000;">&#40;</span> _SET_EXACT, lExact <span style="color: #000000;">&#41;</span><br />         <span style="color: #00C800;">if</span> nAt > <span style="color: #000000;">0</span><br />            ::<span style="color: #000000;">nArrayAt</span> := nAt<br />            <span style="color: #00C800;">return</span> .t.<br />         <span style="color: #00C800;">endif</span><br />      <span style="color: #00C800;">endif</span><br />   <span style="color: #00C800;">next</span><br /><span style="color: #00C800;">return</span> .f.<br /><br /> </div>[/code:2eg7svdl]
xBrowse : Arraysort and arrayseek (again)
Column 2 and column 8 are made unique . Clicking column 8 or 2 (several times) may NOT change the record !!!! [code=fw:1fi3qmfk]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"xbrowse.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"InKey.ch"</span><br /># include <span style="color: #ff0000;">"common.ch"</span><br /># <span style="color: #0000ff;">define</span> bORDER1             <span style="color: #000000;">&#123;</span>|a|IIF<span style="color: #000000;">&#40;</span>pCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>==<span style="color: #000000;">0</span> , a := <span style="color: #000000;">&#123;</span>FIELD->First,FIELD->Last<span style="color: #000000;">&#125;</span>,<span style="color: #000000;">&#41;</span> , PAD<span style="color: #000000;">&#40;</span>UPPER<span style="color: #000000;">&#40;</span>TRIM<span style="color: #000000;">&#40;</span>a<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>+TRIM<span style="color: #000000;">&#40;</span>a<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br /># <span style="color: #0000ff;">define</span> bORDER2             <span style="color: #000000;">&#123;</span>|a|IIF<span style="color: #000000;">&#40;</span>pCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>==<span style="color: #000000;">0</span> , a := <span style="color: #000000;">&#123;</span>FIELD->Last,FIELD->First,RECNO<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span>,<span style="color: #000000;">&#41;</span> , PAD<span style="color: #000000;">&#40;</span>UPPER<span style="color: #000000;">&#40;</span>TRIM<span style="color: #000000;">&#40;</span>a<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>+TRIM<span style="color: #000000;">&#40;</span>a<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span>+STR<span style="color: #000000;">&#40;</span>ATAIL<span style="color: #000000;">&#40;</span>a<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br /># <span style="color: #0000ff;">define</span> bORDER3             <span style="color: #000000;">&#123;</span>|a|PAD<span style="color: #000000;">&#40;</span>CharOnly<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"ABCDEFGHIJKLMNOPQRSTUVWXYZ"</span>,UPPER<span style="color: #000000;">&#40;</span>TRIM<span style="color: #000000;">&#40;</span>IIF<span style="color: #000000;">&#40;</span>PCOUNT<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>==<span style="color: #000000;">0</span>,FIELD->Street,a<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br /># <span style="color: #0000ff;">define</span> FRANKDEMONT<br /><br /><span style="color: #00C800;">static</span> oWnd<br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />***************<br />    SET _3DLOOK <span style="color: #0000ff;">ON</span><br />    SET<span style="color: #000000;">&#40;</span>_SET_AUTOPEN, .F. <span style="color: #000000;">&#41;</span>                                                      <span style="color: #B900B9;">// Auto open cdx-file</span><br />     REQUEST DBFCDX<br />     rddsetdefault<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #000000;">&#41;</span><br />     <span style="color: #00C800;">IF</span> File<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Cust.cdx"</span><span style="color: #000000;">&#41;</span><br />        fErase<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Cust.cdx"</span><span style="color: #000000;">&#41;</span><br />     end<br />     USE CUSTOMER <span style="color: #00C800;">NEW</span> SHARED<br />     SET <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">TO</span><br />     <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> EVAL<span style="color: #000000;">&#40;</span>bORDER1<span style="color: #000000;">&#41;</span> TAG First <span style="color: #0000ff;">TO</span> Cust           <span style="color: #B900B9;">// EVAL(bORDER1) is executed without parameter</span><br />     <span style="color: #B900B9;">//INDEX ON PAD(UPPER(TRIM(First))+UPPER(TRIM(Last)),20) TAG First TO Cust</span><br />     <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> EVAL<span style="color: #000000;">&#40;</span>bORDER2<span style="color: #000000;">&#41;</span> TAG Last <span style="color: #0000ff;">TO</span> Cust            <span style="color: #B900B9;">// EVAL(bORDER2) is executed without parameter</span><br />     <span style="color: #B900B9;">//INDEX ON PAD(UPPER(TRIM(Last))+UPPER(TRIM(First)),20) TAG Last TO Cust</span><br />     <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> EVAL<span style="color: #000000;">&#40;</span>bORDER3<span style="color: #000000;">&#41;</span> TAG STREET <span style="color: #0000ff;">TO</span> Cust      <span style="color: #B900B9;">// EVAL(bORDER3) is executed without parameter</span><br />     <span style="color: #B900B9;">//INDEX ON PAD(CharOnly("ABCDEFGHIJKLMNOPQRSTUVWXYZ",UPPER(TRIM(Street))),20) TAG STREET TO Cust</span><br />     SET <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">TO</span> CUST<br />     <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">2</span>, <span style="color: #000000;">2</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">20</span>, <span style="color: #000000;">70</span> ;<br />            <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Autosort and seek in Array with Secondary key(s)"</span> ;<br />            <span style="color: #0000ff;">MENU</span> BuildMenu<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />     <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">MAXIMIZED</span><br />     CLOSE ALL<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> BuildMenu<span style="color: #000000;">&#40;</span>oWnd<span style="color: #000000;">&#41;</span><br />     <span style="color: #00C800;">local</span> oMenu, oItem<br /><span style="color: #0000ff;">MENU</span> oMenu<br />    <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Autorder and seek in Array"</span>;<br />    <span style="color: #0000ff;">ACTION</span>  ArraySortSeek<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />    <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Autorder and seek in DBF (Index)"</span>;<br />    <span style="color: #0000ff;">ACTION</span>  DbfSortSeek<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #0000ff;">ENDMENU</span><br /><span style="color: #00C800;">return</span> oMenu<br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> ArraySortSeek<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />*******************************<br />     <span style="color: #00C800;">local</span> oBrw, oCol<br />     <span style="color: #00C800;">local</span> Arr<span style="color: #000000;">&#91;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#93;</span> , i , oSay<br />     <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Autosort and seek in Array"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">1200</span>,<span style="color: #000000;">800</span> <span style="color: #0000ff;">PIXEL</span><span style="color: #B900B9;">//MDICHILD OF oWnd</span><br />     DBEVAL<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#123;</span>||AADD<span style="color: #000000;">&#40;</span>Arr,ReadRec<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br />     GO BOTTOM<br />     @ <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oDlg ARRAY Arr <span style="color: #0000ff;">AUTOCOLS</span> AUTOSORT <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">600</span>,<span style="color: #000000;">350</span> <span style="color: #0000ff;">PIXEL</span><br />     oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />     <span style="color: #00C800;">FOR</span> EACH oCol IN oBrw:<span style="color: #000000;">aCols</span><br />        i := Hb_EnumIndex<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />        oCol:<span style="color: #000000;">cHeader</span> := FieldName<span style="color: #000000;">&#40;</span>i<span style="color: #000000;">&#41;</span><br />     <span style="color: #00C800;">NEXT</span><br />     oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bOrder</span> := bORDER1 <span style="color: #B900B9;">// EVAL(bORDER1) will be executed with parameter array oBrw:aRow</span><br />     <span style="color: #B900B9;">//oBrw:aCols[1]:bOrder := {|x|UPPER(TRIM(x[1])+TRIM(x[2]))}</span><br />     oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bOrder</span> := bORDER2 <span style="color: #B900B9;">// EVAL(bORDER2) will be executed with parameter array oBrw:aRow</span><br />     <span style="color: #B900B9;">//oBrw:aCols[2]:bOrder := {|x|UPPER(TRIM(x[2])+TRIM(x[1]))}</span><br />     oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bOrder</span> := bORDER3 <span style="color: #B900B9;">// EVAL(bORDER3) will be executed with parameter array oBrw:aRow</span><br />     oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bOrder</span> := <span style="color: #000000;">&#123;</span>|x|UPPER<span style="color: #000000;">&#40;</span>TRIM<span style="color: #000000;">&#40;</span>x<span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+EVAL<span style="color: #000000;">&#40;</span>bORDER3,x<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span>     <span style="color: #B900B9;">// In DBF no Index , here on CITY + STREET (Alfabetic , no numbers or space)</span><br />     oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bOrder</span> := <span style="color: #000000;">&#123;</span>|x|UPPER<span style="color: #000000;">&#40;</span>TRIM<span style="color: #000000;">&#40;</span>x<span style="color: #000000;">&#91;</span><span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span>+TRIM<span style="color: #000000;">&#40;</span>x<span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span>              <span style="color: #B900B9;">// In DBF no Index , here on STATE + CITY</span><br />     oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">8</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bOrder</span> := <span style="color: #000000;">&#123;</span>|x|cValToChar<span style="color: #000000;">&#40;</span> x<span style="color: #000000;">&#91;</span><span style="color: #000000;">8</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span> +STR<span style="color: #000000;">&#40;</span>ATAIL<span style="color: #000000;">&#40;</span>x<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>     <span style="color: #B900B9;">// Recno added to make unique</span><br />     oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">11</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bOrder</span> := <span style="color: #000000;">&#123;</span>|x|VAL<span style="color: #000000;">&#40;</span>CharOnly<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"1234567890"</span>,TRIM<span style="color: #000000;">&#40;</span>x<span style="color: #000000;">&#91;</span><span style="color: #000000;">11</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span>              <span style="color: #B900B9;">// In DBF no Index , here on NOTES , only numbers , record number !</span><br />     @ <span style="color: #000000;">360</span> , <span style="color: #000000;">100</span> <span style="color: #0000ff;">SAY</span> oBrw:<span style="color: #000000;">oSeek</span> <span style="color: #0000ff;">PROMPT</span> oBrw:<span style="color: #000000;">cSeek</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PIXEL</span> BORDER <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">12</span><span style="color: #B900B9;">//SHADED</span><br />     oBrw:<span style="color: #000000;">bSeek</span> := <span style="color: #000000;">&#123;</span> | c | MySeekOnArray<span style="color: #000000;">&#40;</span> oBrw, oBrw:<span style="color: #000000;">aArrayData</span>, c <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />     <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cOrder</span>:=<span style="color: #ff0000;">"D"</span>,oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">SortArrayData</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> , oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span><br />********************************************************************************************<br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> DbfSortSeek<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />******************************<br />     <span style="color: #00C800;">local</span> oBrw, oCol<br />     <span style="color: #00C800;">local</span> Arr<span style="color: #000000;">&#91;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#93;</span> , i , oSay<br />     OrdSetFocus<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"First"</span><span style="color: #000000;">&#41;</span><br />     <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Auto Sort and seek in DBF"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">1200</span>,<span style="color: #000000;">800</span> <span style="color: #0000ff;">PIXEL</span><span style="color: #B900B9;">//MDICHILD OF oWnd</span><br />     GO BOTTOM<br />     @ <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"Customer"</span> <span style="color: #0000ff;">AUTOCOLS</span> AUTOSORT <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">600</span>,<span style="color: #000000;">350</span> <span style="color: #0000ff;">PIXEL</span><br />     oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />     @ <span style="color: #000000;">360</span> , <span style="color: #000000;">100</span> <span style="color: #0000ff;">SAY</span> oBrw:<span style="color: #000000;">oSeek</span> <span style="color: #0000ff;">PROMPT</span> oBrw:<span style="color: #000000;">cSeek</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">PIXEL</span> BORDER <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">100</span>,<span style="color: #000000;">12</span>  <span style="color: #B900B9;">// SIZE MUST BE SPECIFIED , LEN(oBrw:cSeek) = 0 , oSay isn't showed without size</span><br />     oBrw:<span style="color: #000000;">bSeek</span> := <span style="color: #000000;">&#123;</span> | c | DbSeek<span style="color: #000000;">&#40;</span>UPPER<span style="color: #000000;">&#40;</span>c<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>       <span style="color: #B900B9;">// needed to upperseek (FWH 8.10) !</span><br />     <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">SetFocus</span><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> READREC<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />******************<br /><span style="color: #00C800;">LOCAL</span> aField<span style="color: #000000;">&#91;</span>fCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span><br /><span style="color: #00C800;">LOCAL</span> i<br /><span style="color: #00C800;">FOR</span> i := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> fCount<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />    aField<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span> := FieldGet<span style="color: #000000;">&#40;</span>i<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">NEXT</span><br />AADD<span style="color: #000000;">&#40;</span>aField,Recno<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">RETURN</span> aField<br />***********************************************************************************************<br /><span style="color: #0000ff;">INIT</span> PROC InitXbrow<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />     OVERRIDE <span style="color: #00C800;">METHOD</span> SortArrayData IN <span style="color: #00C800;">CLASS</span> TXBrwColumn WITH MySortArray <span style="color: #B900B9;">// ClasTSCom7</span><br />     EXTEND <span style="color: #00C800;">CLASS</span> TXBrwColumn WITH <span style="color: #00C800;">DATA</span> bOrder<br /><span style="color: #00C800;">RETURN</span><br />*****************************************************************<br /><span style="color: #00C800;">FUNCTION</span> MySortArray<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #B900B9;">//    CLASS TXBrwColumn</span><br />**********************<br /> <span style="color: #00C800;">LOCAL</span> <span style="color: #00C800;">Self</span> := HB_QSelf<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />    <span style="color: #00C800;">local</span> aCols<br />     <span style="color: #00C800;">local</span> cOrder<br />     <span style="color: #00C800;">local</span> nAt, nFor, nLen<br />     <span style="color: #00C800;">local</span> uSave, cType<br />     # ifdef FRANKDEMONT<br />     <span style="color: #00C800;">local</span> bOrder<br />     # <span style="color: #00C800;">endif</span><br />     aCols  := ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aCols</span><br />     cOrder := ::<span style="color: #000000;">cOrder</span><br />     nLen       := Len<span style="color: #000000;">&#40;</span> aCols <span style="color: #000000;">&#41;</span><br />     nAt        := <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ValType<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">cSortOrder</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">'N'</span>, ::<span style="color: #000000;">cSortOrder</span>, ::<span style="color: #000000;">nArrayCol</span> <span style="color: #000000;">&#41;</span><br />     <span style="color: #00C800;">if</span> Len<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span> <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br />            cType               := ValType<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />            <span style="color: #00C800;">if</span> cType == <span style="color: #ff0000;">'A'</span><br />                 <span style="color: #00C800;">if</span> ValType<span style="color: #000000;">&#40;</span> nAt <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">'N'</span> .and. nAt > <span style="color: #000000;">0</span> .and. nAt <= nLen<br />                        <span style="color: #00C800;">for</span> nFor := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> nLen<br />                             <span style="color: #00C800;">if</span> aCols<span style="color: #000000;">&#91;</span> nFor <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nArrayCol</span> != ::<span style="color: #000000;">nArrayCol</span><br />                                    aCols<span style="color: #000000;">&#91;</span> nFor <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cOrder</span> := <span style="color: #ff0000;">""</span><br />                             <span style="color: #00C800;">endif</span><br />                        <span style="color: #00C800;">next</span><br />                        # ifdef FRANKDEMONT<br />                        uSave := IIF<span style="color: #000000;">&#40;</span>Isnil<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">bOrder</span><span style="color: #000000;">&#41;</span> , ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">&#91;</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">nArrayAt</span> <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> ::<span style="color: #000000;">nArrayCol</span> <span style="color: #000000;">&#93;</span> , ;<br />                                                                                     EVAL<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">bOrder</span>, ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">&#91;</span>::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">nArrayAt</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />                        <span style="color: #00C800;">if</span> cOrder == <span style="color: #ff0000;">'A'</span><br />                            <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">bOrder</span> = <span style="color: #00C800;">nil</span><br />                                bOrder := <span style="color: #000000;">&#123;</span>|x,y| x<span style="color: #000000;">&#91;</span> nAt <span style="color: #000000;">&#93;</span> > y<span style="color: #000000;">&#91;</span> nAt <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#125;</span><br />                            <span style="color: #00C800;">ELSE</span><br />                                bOrder := <span style="color: #000000;">&#123;</span>|x,y| EVAL<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">bOrder</span>,x<span style="color: #000000;">&#41;</span> > EVAL<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">bOrder</span>,y<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />                            <span style="color: #00C800;">ENDIF</span><br />                             ::<span style="color: #000000;">cOrder</span>           := <span style="color: #ff0000;">'D'</span><br />                        <span style="color: #00C800;">else</span><br />                            <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">bOrder</span> = <span style="color: #00C800;">nil</span><br />                                bOrder := <span style="color: #000000;">&#123;</span>|x,y| x<span style="color: #000000;">&#91;</span> nAt <span style="color: #000000;">&#93;</span> < y<span style="color: #000000;">&#91;</span> nAt <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#125;</span><br />                            <span style="color: #00C800;">ELSE</span><br />                                bOrder := <span style="color: #000000;">&#123;</span>|x,y| EVAL<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">bOrder</span>,x<span style="color: #000000;">&#41;</span> < EVAL<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">bOrder</span>,y<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />                            <span style="color: #00C800;">ENDIF</span><br />                             ::<span style="color: #000000;">cOrder</span>           := <span style="color: #ff0000;">'A'</span><br />                        <span style="color: #00C800;">endif</span><br />                        <span style="color: #B900B9;">//uSave      :=  //::oBrw:aArrayData[ ::oBrw:nArrayAt ][ ::nArrayCol ]</span><br />                        ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span> := Asort<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span>,,, bOrder<span style="color: #000000;">&#41;</span><br />                        <span style="color: #00C800;">IF</span> ::<span style="color: #000000;">bOrder</span> = <span style="color: #00C800;">nil</span><br />                            ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">nArrayAt</span>     := AScan<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span>, <span style="color: #000000;">&#123;</span> |a| a<span style="color: #000000;">&#91;</span> ::<span style="color: #000000;">nArrayCol</span> <span style="color: #000000;">&#93;</span> == uSave <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />                        <span style="color: #00C800;">ELSE</span><br />                            ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">nArrayAt</span>     := AScan<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span>, <span style="color: #000000;">&#123;</span> |a| EVAL<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">bOrder</span>,a<span style="color: #000000;">&#41;</span> == uSave <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />                        END<br />                        # <span style="color: #00C800;">else</span><br />                        uSave        := ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">&#91;</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">nArrayAt</span> <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> ::<span style="color: #000000;">nArrayCol</span> <span style="color: #000000;">&#93;</span><br />                        <span style="color: #00C800;">if</span> cOrder == <span style="color: #ff0000;">'A'</span><br />                             ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span> := Asort<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span>,,, <span style="color: #000000;">&#123;</span>|x,y| x<span style="color: #000000;">&#91;</span> nAt <span style="color: #000000;">&#93;</span> > y<span style="color: #000000;">&#91;</span> nAt <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />                             ::<span style="color: #000000;">cOrder</span>           := <span style="color: #ff0000;">'D'</span><br />                        <span style="color: #00C800;">else</span><br />                             ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span> := Asort<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span>,,, <span style="color: #000000;">&#123;</span>|x,y| x<span style="color: #000000;">&#91;</span> nAt <span style="color: #000000;">&#93;</span> < y<span style="color: #000000;">&#91;</span> nAt <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />                             ::<span style="color: #000000;">cOrder</span>           := <span style="color: #ff0000;">'A'</span><br />                        <span style="color: #00C800;">endif</span><br />                        ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">nArrayAt</span>     := AScan<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span>, <span style="color: #000000;">&#123;</span> |a| a<span style="color: #000000;">&#91;</span> ::<span style="color: #000000;">nArrayCol</span> <span style="color: #000000;">&#93;</span> == uSave <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />                        # <span style="color: #00C800;">endif</span><br />                        ::<span style="color: #000000;">oBrw</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />                     <span style="color: #00C800;">endif</span><br />            elseif cType $ <span style="color: #ff0000;">'CDLN'</span><br />                 <span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">&#40;</span> cOrder <span style="color: #000000;">&#41;</span><br />                        uSave        := ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">&#91;</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">nArrayAt</span> <span style="color: #000000;">&#93;</span><br />                        <span style="color: #00C800;">if</span> cOrder == <span style="color: #ff0000;">'A'</span><br />                             ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span> := ASort<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span>,,,<span style="color: #000000;">&#123;</span>|x,y| cValToChar<span style="color: #000000;">&#40;</span> x <span style="color: #000000;">&#41;</span> > cValToChar<span style="color: #000000;">&#40;</span> y <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />                             ::<span style="color: #000000;">cOrder</span> := <span style="color: #ff0000;">'D'</span><br />                        <span style="color: #00C800;">else</span><br />                             ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span> := ASort<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span>,,,<span style="color: #000000;">&#123;</span>|x,y| cValToChar<span style="color: #000000;">&#40;</span> x <span style="color: #000000;">&#41;</span> < cValToChar<span style="color: #000000;">&#40;</span> y <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />                             ::<span style="color: #000000;">cOrder</span> := <span style="color: #ff0000;">'A'</span><br />                        <span style="color: #00C800;">endif</span><br />                        ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">nArrayAt</span>          := AScan<span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aArrayData</span>, uSave <span style="color: #000000;">&#41;</span><br />                        ::<span style="color: #000000;">oBrw</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />                 <span style="color: #00C800;">endif</span><br />            <span style="color: #00C800;">endif</span><br />     <span style="color: #00C800;">endif</span><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">self</span><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><span style="color: #00C800;">FUNCTION</span> MySeekOnArray<span style="color: #000000;">&#40;</span> <span style="color: #00C800;">Self</span>, aData, cSeek <span style="color: #000000;">&#41;</span><br />*******************************************<br />     <span style="color: #00C800;">local</span> aCols<br />     <span style="color: #00C800;">local</span> nAt, nFor, nLen<br />     <span style="color: #00C800;">local</span> lExact<br />     aCols  := ::<span style="color: #000000;">aCols</span><br />     nLen       := len<span style="color: #000000;">&#40;</span> aCols <span style="color: #000000;">&#41;</span><br />     cSeek  := Upper<span style="color: #000000;">&#40;</span> cSeek <span style="color: #000000;">&#41;</span><br />     <span style="color: #00C800;">for</span> nFor := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> nLen<br />            <span style="color: #00C800;">if</span> !<span style="color: #000000;">&#40;</span> aCols<span style="color: #000000;">&#91;</span> nFor <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cOrder</span> == <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span><br />                 lExact := Set<span style="color: #000000;">&#40;</span> _SET_EXACT, .f. <span style="color: #000000;">&#41;</span><br />                 # ifdef FRANKDEMONT<br />                 <span style="color: #00C800;">IF</span> IsBlock<span style="color: #000000;">&#40;</span>aCols<span style="color: #000000;">&#91;</span> nFor <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bOrder</span> <span style="color: #000000;">&#41;</span><br />                    nAt      := Ascan<span style="color: #000000;">&#40;</span> aData, <span style="color: #000000;">&#123;</span>|v| cValToChar<span style="color: #000000;">&#40;</span>EVAL<span style="color: #000000;">&#40;</span> aCols<span style="color: #000000;">&#91;</span> nFor <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bOrder</span>    , v  <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>  = cSeek <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />                 <span style="color: #00C800;">ELSE</span><br />                    nAt      := Ascan<span style="color: #000000;">&#40;</span> aData, <span style="color: #000000;">&#123;</span>|v| Upper<span style="color: #000000;">&#40;</span> cValToChar<span style="color: #000000;">&#40;</span> v<span style="color: #000000;">&#91;</span> aCols<span style="color: #000000;">&#91;</span> nFor <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nCreationOrder</span>    <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> = cSeek <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />                 END<br />                 # <span style="color: #00C800;">else</span><br />                 nAt        := Ascan<span style="color: #000000;">&#40;</span> aData, <span style="color: #000000;">&#123;</span>|v| Upper<span style="color: #000000;">&#40;</span> cValToChar<span style="color: #000000;">&#40;</span> v<span style="color: #000000;">&#91;</span> nFor <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> = cSeek <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />                 # <span style="color: #00C800;">endif</span><br />                 Set<span style="color: #000000;">&#40;</span> _SET_EXACT, lExact <span style="color: #000000;">&#41;</span><br />                 <span style="color: #00C800;">if</span> nAt > <span style="color: #000000;">0</span><br />                        ::<span style="color: #000000;">nArrayAt</span> := nAt<br />                        <span style="color: #00C800;">return</span> .t.<br />                 <span style="color: #00C800;">endif</span><br />            <span style="color: #00C800;">endif</span><br />     <span style="color: #00C800;">next</span><br /><span style="color: #00C800;">return</span> .f.<br /> </div>[/code:1fi3qmfk]
xBrowse : SameArrayStruct( oBrw aNew ) (fwh8.10)
HelloSetarray calls this functionFor me same arraystructure means :LEN(adata) == LEN(aNew) AND Each column from olddata must have the same valtype from new dataMust line :if nLen <= Len( aNew ) <=== !!!!!!!!!! not be changed in if nLen = Len( aNew[1] ) <=== !!!!!!!!!!Frank[code:830s2dws] function SameArrayStruct&#40; oBrw, aNew &#41; local lSame &#58;= &#46;t&#46; local n, nLen, aData aData &#58;= oBrw&#58;aArrayData // old Data if ValType&#40; aData &#41; == ValType&#40; aNew &#41; if ValType&#40; aData &#41; == 'A' if Len&#40; aData &#41; > 0 &#46;and&#46; Len&#40; aNew &#41; > 0 if ValType&#40; aData&#91; 1 &#93; &#41; == 'A' &#46;and&#46; ValType&#40; aNew&#91; 1 &#93; &#41; == 'A' nLen &#58;= Len&#40; aData&#91; 1 &#93; &#41; if nLen <= Len&#40; aNew &#41; <=== !!!!!!!!!! lSame &#58;= &#40; AScan&#40; aData&#91; 1 &#93;, &#123; |u,i| ValType&#40; u &#41; != ; ValType&#40; aNew&#91; 1 &#93;&#91; i &#93; &#41; &#125;, 1, nLen &#41; == 0 &#41; else lSame &#58;= &#46;f&#46; endif endif else lSame &#58;= &#46;f&#46; endif endif else lsame &#58;= &#46;f&#46; endif [/code:830s2dws]
xBrowse : SameArrayStruct( oBrw aNew ) (fwh8.10)
Frank, In FWH 8.12 it is fixed in the way you describe <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
xBrowse : Switch-back from Col to Row-preview => solved !
Hello,after some more tests, i found the solution, howto switch from Row- to Col-preview and back.[img:2q9g53ns]http&#58;//www&#46;pflegeplus&#46;com/pictures/setting16&#46;jpg[/img:2q9g53ns][img:2q9g53ns]http&#58;//www&#46;pflegeplus&#46;com/pictures/setting17&#46;jpg[/img:2q9g53ns]it has to be done in a complete different way.[code:2q9g53ns] &#46;&#46;&#46;&#46;&#46;&#46;&#46;&#46; &#46;&#46;&#46;&#46;&#46;&#46;&#46;&#46; // The browser shows the Row-selection // Define alternating row colors aClrCol &#58;= &#123; &#123; ROW_TEXT, ROW_COL1 &#125;, &#123; ROW_TEXT, ROW_COL2 &#125; &#125; oLbx0&#58;bClrStd &#58;= &#123; || aClrCol&#91; oLbx0&#58;KeyNo % 2 + 1 &#93; &#125; oLbx0&#58;CreateFromResource&#40; 110 &#41; // --------------- Button for COLUMN - Display &#40; RED &#41; -------------- REDEFINE BUTTONBMP oBtn11 ID 20 OF oDlg ; ACTION &#40; oLbx0&#58;aCols&#91;2&#93;&#58;bClrStd &#58;= &#123; || &#123; CLR_WHITE, 128 &#125; &#125;, ; oLbx0&#58;Refresh&#40;&#41; &#41; ; BITMAP "Magic" PROMPT " Col-Select" TEXTRIGHT oBtn11&#58;cToolTip = &#123; "Changing browser" + CRLF + ; "Column-Color","Column-Color", 1, CLR_BLACK, 14089979 &#125; // ------- Button for changing back to ROW-Display ----------------------- // you cannot call the Row- display again for repainting, // that doesn't work and the red Column is still visible // &#40; the Rows are not repainted &#41;&#46; // To show only the Row-colors again, you have to use // the < alternating ROW colors > and repaint the red Column No&#46; 2&#46; // That works perfect&#46; REDEFINE BUTTONBMP oBtn10 ID 10 OF oDlg ; ACTION &#40; aClrCol &#58;= &#123; &#123; ROW_TEXT, ROW_COL1 &#125;, ; &#123; ROW_TEXT, ROW_COL2 &#125; &#125;, ; oLbx0&#58;aCols&#91;2&#93;&#58;bClrStd &#58;= &#123; || aClrCol&#91; oLbx0&#58;KeyNo % 2 + 1 &#93; &#125;, ; oLbx0&#58;Refresh&#40;&#41; &#41; ; BITMAP "Magic" PROMPT " Row-Select" TEXTRIGHT oBtn10&#58;cToolTip = &#123; "Changing Browser" + CRLF + ; "Row-Colors","Row-Color", 1, CLR_BLACK, 14089979 &#125; [/code:2q9g53ns]RegardsUwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
xBrowse : Switch-back from Col to Row-preview => solved !
Uwe,Thanks for sharing it! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
xBrowse : oBrw:ColAtPos(nPos)
Hello, I have a button with as action : ATAIL(oBrw:aCols):Hide() , Prnt(oBrw ) , ATAIL(oBrw:aCols):Show() This give a error in : METHOD ColAtPos( nPos ) INLINE ::aCols[ ::aDisplay[ nPos ] ] LEN(::aDisplay) < LEN(::aCols) while npos == LEN(::aCols) Maybe is better : [code:i7j0illi] # xtranslate MinMax&#40;<xValue> , <nMin> , <nMax> &#41; => Min &#40; Max&#40; <xValue> , <nMin> &#41; , <nMax> &#41; METHOD ColAtPos&#40; nPos &#41; INLINE &#58;&#58;aCols&#91; &#58;&#58;aDisplay&#91;MinMax&#40;IIF&#40;npos==nil,1,nPos&#41;,1,LEN&#40;&#58;&#58;aDisplay&#41;&#41; &#93; &#93; [/code:i7j0illi]
xBrowse : oBrw:ColAtPos(nPos)
Frank, Modified, many thanks! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
xBrowse : using 'Ctrl-PgDn' or key 'end'
Hello , Using xbrowse with a dbf (dbfcdx) i have 3 columns with a index. When the first column (with a index) is seekcolumn and i press 'Ctrl-PgDn' or key 'end' , the browse shows the first 12 records followed with the last record. Moving the mouse to the top line from the dialog , clear the browse and displays the last record (oBrw:nColsel seem to be 1 , last record is the active record) Moving the mouse away from the aplication (or monitor) , the screen is build as expected , the last 13 records with the last record as active. Two other index(columns) gives no problems. Next lines are used in the aplication : oDlg:bGotFocus = { ||oBrw:SetFocus() } and oBrw:bGotFocus := { ||ResetOrder(oBrw) } [code=fw:3w0600zb]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">LOCAL</span> oCol<br /><span style="color: #00C800;">FOR</span> EACH oCol IN oBrw:<span style="color: #000000;">aCols</span><br />&nbsp; <span style="color: #00C800;">IF</span> oCol:<span style="color: #000000;">cOrder</span> IN <span style="color: #ff0000;">"AD"</span> .AND. BONALG-><span style="color: #000000;">&#40;</span>OrdSetFocus<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><>oCol:<span style="color: #000000;">cSortOrder</span><br />&nbsp; &nbsp; oCol:<span style="color: #000000;">cOrder</span> := IIF<span style="color: #000000;">&#40;</span>oCol:<span style="color: #000000;">cOrder</span>==<span style="color: #ff0000;">"A"</span>,<span style="color: #ff0000;">"D"</span>,<span style="color: #ff0000;">"A"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; oCol:<span style="color: #000000;">SetOrder</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #B900B9;">//oBrw:Refresh()</span><br />&nbsp; &nbsp; EXIT<br />&nbsp; END<br /><span style="color: #00C800;">NEXT</span><br /><span style="color: #00C800;">RETURN</span><br />&nbsp;</div>[/code:3w0600zb] Disabling this line(s) gives no difference. I am using FWH1203 Frank
xBrowse : using 'Ctrl-PgDn' or key 'end'
Sory , reindexing the dbf solves the problem. Frank
xBrowse :ToExcel Method - Problem with Memo's?
Hello I have some tables *.DBF with *.cdx indexes and some of them contain memo fields. The memo table is in *.fpt format. I am using the FWH / [x]Harbour xBrowse(...) function to do a quick browse of selected dbf tables and in some cases to export the table values to Excel for further processing. It works fine when there are no memo fields in the table. It gives the following error when a memo field is present: [quote:1iqsvpj2]Application =========== Path and name: D:\ac\fwhdb_phx\Project\ph_win32.exe (32 bits) Size: 3,793,920 bytes Time from start: 0 hours 0 mins 48 secs Error occurred at: 27/05/2009, 21:39:51 Error description: Error Excel.Application:ACTIVESHEET:COLUMNS/0 S_OK: _NUMBERFORMAT Args: [ 1] = C @d Stack Calls =========== Called from: source\rtl\win32ole.prg => TOLEAUTO:_NUMBERFORMAT(0) Called from: .\source\classes\XBROWSE.PRG => TXBROWSE:TOEXCEL(5207) Called from: xBrowse_dbf.prg => (b)BTNBAR(154) Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:CLICK(443) Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:LBUTTONUP(629) Called from: => TWINDOW:HANDLEEVENT(0) Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1453) Called from: .\source\classes\BTNBMP.PRG => TBTNBMP:HANDLEEVENT(1283) Called from: .\source\classes\WINDOW.PRG => _FWH(3333) Called from: => SYSREFRESH(0) Called from: .\source\classes\folder.PRG => SYSWAIT(484) Called from: xBrowse_dbf.prg => SHOW_DBF_IN_DIALOG(140) Called from: xBrowse_dbf.prg => (b)XBROWSE_DBF(58) Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE(945) Called from: xBrowse_dbf.prg => XBROWSE_DBF(58) Called from: ph_win32.prg => (b)BUILDMENU(1215) Called from: .\source\classes\MENU.PRG => TMENU:COMMAND(437) Called from: .\source\classes\WINDOW.PRG => TWINDOW:COMMAND(1003) Called from: => TWINDOW:HANDLEEVENT(0) Called from: .\source\classes\WINDOW.PRG => _FWH(3333) Called from: => WINRUN(0) Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE(952) Called from: ph_win32.prg => MAIN(521) [SNIP] Variables in use ================ Procedure Type Value ========================== TOLEAUTO:_NUMBERFORMAT Param 1: C "@d" Local 1: U Local 2: C "Excel.Application:ACTIVESHEET:COLUMNS" TXBROWSE:TOEXCEL Local 1: U Local 2: U Local 3: O Class: TXBROWSE Local 4: O Class: TOLEAUTO Local 5: O Class: TOLEAUTO Local 6: O Class: TOLEAUTO Local 7: U Local 8: N 15 Local 9: N 15 Local 10: O Class: TXBRWCOLUMN Local 11: C "D" Local 12: U Local 13: N 260 Local 14: N 1 Local 15: N 1040 Local 16: A Len: 48 Local 17: U Local 18: U Local 19: U Local 20: U Local 21: C "0" Local 22: A Len: 0 Local 23: L .F. Local 24: L .T. Local 25: U (b)BTNBAR Param 1: O Class: TBTNBMP [SNIP][/quote:1iqsvpj2] Has anyone else had a similar problem? If so, how did it get solved? I'm using FiveWin V9.04 / [x]Harbour 1.2.1, [x]Harbour Compiler build 1.2.1 (SimpLex) (Rev. 6406)) and Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland, Win XP Professional Windows version: 5.1, Build 2600 Service Pack 3 Best Regards, Angelo.c
xBrowse :ToExcel Method - Problem with Memo's?
I think the problem is not with memo fields, but with a date field in your browse. I also guess you have SET EXACT ON in your application. The original code in xbrowse.prg at line 5206 is [code=fw:2r4rhfs5]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">if</span> ValType<span style="color: #000000;">&#40;</span> oCol:<span style="color: #000000;">cEditPicture</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">'C'</span> .and. !<span style="color: #000000;">&#40;</span> oCol:<span style="color: #000000;">cEditPicture</span> = <span style="color: #ff0000;">'@'</span> <span style="color: #000000;">&#41;</span></div>[/code:2r4rhfs5] Please try changing this line as [code=fw:2r4rhfs5]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">if</span> ValType<span style="color: #000000;">&#40;</span> oCol:<span style="color: #000000;">cEditPicture</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">'C'</span> .and. <span style="color: #0000ff;">Left</span><span style="color: #000000;">&#40;</span> oCol:<span style="color: #000000;">cEditPicture</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> != <span style="color: #ff0000;">'@'</span></div>[/code:2r4rhfs5] Please compile the modified xbrowse.prg and link to your application and see if your problem is solved. It is also true that memo fields are not handled well in the ToExcel method of xbrowse. We get unexpected results when the memo contains tabs and crlfs.
xBrowse :ToExcel Method - Problem with Memo's?
Thank you for quick response. Your suggestion worked well. The above problem is fixed. Perhaps Antonio can include this minor change in the next release of FWH / [x]Harbour so that a custom version of xBrowse need not be generated for Fivewin applications? Again, I thank you Best Regards, Angelo.c
xBrowse :ToExcel error
Hi all, the following error appear exporting using the xbrowse method :ToExcel() with Excel 2003. error excel application/1 language settings I'm using FWHx 12.12 and xHarbour 1.2.1 Any ideas ? Thanks in advance.
xBrowse :ToExcel error
Can you please test this program on the PC where Excel 2003 is installed? [code=fw:101bh75t]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> ExcelTest<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oExcel, nLangID<br /><br />&nbsp; &nbsp;oExcel &nbsp; := ExcelObj<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> oExcel == <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; ? <span style="color: #ff0000;">'Excel not loaded'</span><br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; nLangID := oExcel:<span style="color: #000000;">LanguageSettings</span>:<span style="color: #000000;">LanguageID</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; ? nLangID<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:101bh75t] Please let us know the result.
xBrowse :bEditValid executed 3x...
Hello everyone, Im Using FW9.11's xBrowse [code=fw:3kc2vr8b]<div class="fw" id="{CB}" style="font-family: monospace;">WITH OBJECT xBrw<br />     :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bEditValid</span> := <span style="color: #000000;">&#123;</span>|| <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">'1'</span><span style="color: #000000;">&#41;</span>, .T. <span style="color: #000000;">&#125;</span>     <span style="color: #B900B9;">//executed 3 times.</span><br />END</div>[/code:3kc2vr8b] How to prevent this? Regards, Fraxzi
xBrowse :bEditValid executed 3x...
for me it evaluates only once.
xBrowse :bEditValid executed 3x...
Colleague here is the solution <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=6&t=15953&p=82608&hilit=bvalid#p82608">viewtopic.php?f=6&t=15953&p=82608&hilit=bvalid#p82608</a><!-- l --> Luiz Fernando FWH 912, XHB 1.2, ADS9.0
xBrowse :bEditValid executed 3x...
[quote="nageswaragunupudi":37c58rse]for me it evaluates only once.[/quote:37c58rse] GNR, Are you using FW9.11? I have no fancy routine just plain :bEditValid, BTW :nEditType := EDIT_GET Regards, Fraxzi
xBrowse :oBtnElip background color
Dear All, I tried to :setcolor oBtnElip but still cannot change the background particularly if stretching the xBrowse's data height. see in red line.. [img:39klmjsf]http&#58;//i208&#46;photobucket&#46;com/albums/bb82/fraxzi/xBrwButton&#46;jpg[/img:39klmjsf] How to properly set this with Fivewin v9.11.. Regards, FAP
xBrowse :oBtnElip background color
Hello try with oCol:lBtnTransparent = .T.
xBrowse :oBtnElip background color
[quote="Daniel Garcia-Gil":1mqmyckd]Hello try with oCol:lBtnTransparent = .T.[/quote:1mqmyckd] Hi Daniel, I already tried.. [code=fw:1mqmyckd]<div class="fw" id="{CB}" style="font-family: monospace;"><br />..<br />oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">lBtnTransparent</span> := .T.<br />oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">lBmpTransparent</span> := .T.<br />..<br />&nbsp;</div>[/code:1mqmyckd] but still with awful results... Thank you and regards, FAP
xBrowse < DrawTextEx > on right-mouseclick ?
Hello, I have a little problem using < [color=#FF0000:30iwui0u]DrawTextEx[/color:30iwui0u] > With a right-mouseclick I can change a Image, but the painted text is not refreshed. How to call < DrawTextEx > on right-mouseclick, after the new Image is selected ? oBrw:Refresh() doesn't work. The Image-matrix : [img:30iwui0u]http&#58;//www&#46;pflegeplus&#46;com/pictures/matrix&#46;jpg[/img:30iwui0u] < DrawTextEx > called inside Drawcell : [code=fw:30iwui0u]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">FOR</span> nCol := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> nColums<br />    WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> nCol <span style="color: #000000;">&#93;</span><br />        :<span style="color: #000000;">oHeaderFont</span> := oTxtFont<br />        :<span style="color: #000000;">oDataFont</span> := oImgFont<br />        :<span style="color: #000000;">cHeader</span> := ALLTRIM<span style="color: #000000;">&#40;</span>STR<span style="color: #000000;">&#40;</span>nCol<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />        :<span style="color: #000000;">bPaintText</span> := <span style="color: #000000;">&#123;</span> | oCol, hDC, cData, aRect, aColors, lHighLite | ;<br />                        DrawCell<span style="color: #000000;">&#40;</span> oCol, hDC, cData, aRect, aColors, lHighLite <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />    END<br /><span style="color: #00C800;">NEXT</span><br /> </div>[/code:30iwui0u] < DrawCell > paints the Text : [color=#0000FF:30iwui0u]SetTextColor( hDC, 0 ) DrawHorz( hDC, nTop + nCellSize -1 , nLeft - 2, nRight + 3, oBrw:hRowPen ) GradientFill( hDC, nTop + nCellSize, nLeft - 2, nBottom, nRight + 3, { { 1, 16777215, nBackColor } } , .T. ) DrawTextEx( hDC, SUBSTR( cData, 1, 4 ), { nTop + nCellSize + 2, nLeft + 5, nBottom + 1, nRight }, ; DT_CENTER + DT_VCENTER ) [/color:30iwui0u] On right-mouseclick on a Cell inside xBrowse, I replace the Image-array : [color=#0000FF:30iwui0u]oBrw:bRClicked := { | nRow, nCol |nRPos := oBrw:KeyNo(), nCPos := oBrw:SelectedCol():nCreationOrder, ; nRecPos := ( ( oBrw:KeyNo() - 1 )* nColums ) + nCPos, ; DBSELECTAREA(1), DBGOTO(nRecPos), SET_IMAGE(nRecPos, nRPos, nCPos ) } SET_IMAGE calls : aImg[ nRPos, nCPos ] := SPACE(4) + c_Path1 + cObjectName [/color:30iwui0u] ( selection 1 - 5 ) [color=#FF0000:30iwui0u][b:30iwui0u]Maybe the new Image ( on right Mouseclick ) deletes the Text-area ?[/b:30iwui0u][/color:30iwui0u] [img:30iwui0u]http&#58;//www&#46;pflegeplus&#46;com/pictures/celltext3&#46;jpg[/img:30iwui0u] Sample Screenshots : The display at startup : [img:30iwui0u]http&#58;//www&#46;pflegeplus&#46;com/pictures/celltext1&#46;jpg[/img:30iwui0u] Image 17, 18 and 19 are replaced / repainted, but without Text : ( multiple selections possible ) [img:30iwui0u]http&#58;//www&#46;pflegeplus&#46;com/pictures/celltext2&#46;jpg[/img:30iwui0u] Best Regards Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
xBrowse < oLbx:bClrSelFocus > not allways works ?
Hello,I wanted to define a focused Text-color.It seems, it only works together with something like :oLbx:nMarqueeStyle := MARQSTYLE_HIGHLROW[img:1xbcmofo]http&#58;//www&#46;pflegeplus&#46;com/pictures/textcolor0&#46;jpg[/img:1xbcmofo]I need this !!!!-----------------[img:1xbcmofo]http&#58;//www&#46;pflegeplus&#46;com/pictures/textcolor1&#46;jpg[/img:1xbcmofo]It only works with :oLbx:nMarqueeStyle := MARQSTYLE_HIGHLROWbut the row is not transparent with this selection.--------------------------------------------------------[img:1xbcmofo]http&#58;//www&#46;pflegeplus&#46;com/pictures/textcolor2&#46;jpg[/img:1xbcmofo][code:1xbcmofo] AADD&#40;aTEXT1, &#123; "This is Textline 1" &#125;&#41; AADD&#40;aTEXT1, &#123; "This is Textline 2" &#125;&#41; AADD&#40;aTEXT1, &#123; "This is Textline 3" &#125;&#41; AADD&#40;aTEXT1, &#123; "This is Textline 4" &#125;&#41; AADD&#40;aTEXT1, &#123; "This is Textline 5" &#125;&#41; AADD&#40;aTEXT1, &#123; "This is Textline 6" &#125;&#41; AADD&#40;aTEXT1, &#123; "This is Textline 7" &#125;&#41; // 16777215 = white // 65535 = yellow oLbx2 &#58;= TXBrowse&#40;&#41;&#58;New&#40; oFld&#58;aDialogs&#91;2&#93; &#41; // oLbx2&#58;nMarqueeStyle &#58;= MARQSTYLE_HIGHLROW // ---------------------------------------------------------- oLbx2&#58;nColDividerStyle &#58;= LINESTYLE_BLACK oLbx2&#58;nRowDividerStyle &#58;= LINESTYLE_BLACK oLbx2&#58;nRecSelColor &#58;= 14592854 // Record-Selector oLbx2&#58;bClrStd &#58;= &#123; || &#123; 16777215, &#125; &#125; // Text and background oLbx2&#58;bClrSelFocus &#58;= &#123; || &#123; 65535, 128 &#125; &#125; // Focus-Color // -------------------------------------------------------------------------------- oLbx2&#58;bClrSel = &#123; || &#123; 0, 65535 &#125; &#125; // Lost Focus oLbx2&#58;SetArray&#40; aTEXT1 &#41; // !!!!!! oLbx2&#58;cBmpAdjBrush &#58;= "Tree&#46;bmp" oLbx2&#58;SetBackGround&#40; "Tree&#46;bmp" &#41; // !!!!!! oLbx2&#58;aCols&#91; 1 &#93;&#58;cHeader = Padr&#40;"Info", 150&#41; oLbx2&#58;lHScroll &#58;= &#46;T&#46; oLbx2&#58;lVScroll &#58;= &#46;T&#46; oLbx2&#58;lFooter &#58;= &#46;T&#46; oLbx2&#58;lRecordSelector &#58;= &#46;T&#46; oLbx2&#58;CreateFromResource&#40; 210 &#41; [/code:1xbcmofo]RegardsUwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
xBrowse < oLbx:bClrSelFocus > not allways works ?
bClrSelFocus color cell selectedbClrRowFocus color row selectedwhen you use MARQSTYLE_HIGHLROW or upyou can use oLbx2:bClrSelFocus and oLbx:bClrRowFocus (you can see this with 2 or more columns)using only MARQSTYLE_HIGHLROW or upcolor selection row will be defaultusing MARQSTYLE_HIGHLROW or up with oLbx2:bClrSelFocusthe browse use oLbx2:bClrSelFocus color to oLbx:bClrRowFocususing MARQSTYLE_HIGHLROW or up with oLbx2:bClrSelFocus and oLbx:bClrRowFocusthe browse use oLbx2:bClrSelFocus and oLbx:bClrRowFocus individuallyyou need modify the class to see row transparent[b:34qijm28]SO SORRY MY ENGLISH I HOPE YOU UNDESTAND ME[/b:34qijm28]
xBrowse < oLbx:bClrSelFocus > not allways works ?
see row transparet using MARQSTYLE_HIGHLROW or upStep 1..[b:36v727gb] New DATA to [color=red:36v727gb]CLASS TXBrwColumn[/color:36v727gb][/b:36v727gb][code:36v727gb] DATA lColTransparent INIT &#46;f&#46; [/code:36v727gb] Step 2... Change this line in method PainData [code:36v727gb] if oBrush != nil hBrush &#58;= oBrush&#58;hBrush lBrush &#58;= &#46;t&#46; lTransparent&#58;= &#46;f&#46; elseif ! lTransparent hBrush &#58;= CreateSolidBrush&#40; aColors&#91; 2 &#93; &#41; endif [/code:36v727gb] [b:36v727gb] for this line [/b:36v727gb] [code:36v727gb] if oBrush != nil hBrush &#58;= oBrush&#58;hBrush lBrush &#58;= &#46;t&#46; lTransparent&#58;= &#46;f&#46; elseif ! lTransparent &#46;and&#46; !&#58;&#58;lColTransparent hBrush &#58;= CreateSolidBrush&#40; aColors&#91; 2 &#93; &#41; elseif &#58;&#58;lColTransparent hBrush &#58;= CreateSolidBrush&#40; 0 &#41; lTransparent &#58;= &#46;t&#46; endif [/code:36v727gb] example.. [code:36v727gb] aBrw&#91; 1 &#93;&#58;= txbrowse&#40;&#41;&#58;new&#40; oFolder&#58;aDialogs&#91; 1 &#93; &#41; aBrw&#91; 1 &#93;&#58;nRowHeight &#58;= 25 aBrw&#91; 1 &#93;&#58;nColDividerStyle &#58;= LINESTYLE_BLACK aBrw&#91; 1 &#93;&#58;nRowDividerStyle &#58;= LINESTYLE_BLACK aBrw&#91; 1 &#93;&#58;SetArray&#40; aArray1 &#41; aBrw&#91; 1 &#93;&#58;cBmpAdjBrush &#58;= "tree&#46;bmp" aBrw&#91; 1 &#93;&#58;SetBackGround&#40; "tree&#46;bmp" &#41; aBrw&#91; 1 &#93;&#58;nTop &#58;= 0 aBrw&#91; 1 &#93;&#58;nLeft &#58;= 0 aBrw&#91; 1 &#93;&#58;nBottom &#58;= 120 aBrw&#91; 1 &#93;&#58;nRight &#58;= 160 aBrw&#91; 1 &#93;&#58;nMarqueeStyle &#58;= MARQSTYLE_HIGHLROW aBrw&#91; 1 &#93;&#58;bClrRowFocus&#58;=&#123;||&#123;CLR_BLUE,NIL&#125; &#125; //use whatever color back, remember is transparent aBrw&#91; 1 &#93;&#58;bClrSelFocus&#58;=&#123;||&#123;CLR_RED,NIL&#125; &#125; //use whatever color back, remember is transparent aeval&#40; aBrw&#91; 1 &#93;&#58;aCols, &#123; |o|o&#58;lColTransparent &#58;= &#46;t&#46; &#125; &#41; // u can use 1 column or all colomns or some columns transparent [/code:36v727gb][img:36v727gb]http&#58;//i485&#46;photobucket&#46;com/albums/rr217/danielgarciagil/rowtrans&#46;jpg[/img:36v727gb]
xBrowse < oLbx:bClrSelFocus > not allways works ?
Hello Daniel,It's tested and works perfect !!!Great job.Thank You very much.RegardsUwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
xBrowse => oBrw:SelectCol(nPos) doesn't work ?
Hello, I added Buttons, to jump to a defined Position ( in % ) Row and Col of a Grid. Useful, to jump to a Position working with big Tables. Because each Project can have different Sizes, I used [color=#FF0000:f0xpshk2]Percent[/color:f0xpshk2] of max Rows and Cols. For my Test, I created a Browser with 20 Rows and 50 Cols Jump to Row 50% : ( nSGet[2] = defined max Rows ) @ 53, 455 BTNBMP oBtn[5] ; SIZE 32, 11 OF oDlg1 PIXEL 2007 ROUND ; PROMPT "R 50%" ; FONT oTxtfont ; ACTION ( nRPos := INT(nSGet[2] * 0.5), [color=#008000:f0xpshk2]oBrw2:nArrayAt := nRPos[/color:f0xpshk2], ; oSay2:Refresh(), oBrw2:Refresh() ) oBtn[5]:cTooltip := "Jump to Row ( 50% )" oBtn[5]:SetColor( 128 ) Jump to Col 50% : ( nSGet[3] = defined max Cols ) @ 173, 455 BTNBMP oBtn[15] ; SIZE 32, 11 OF oDlg1 PIXEL 2007 ROUND ; PROMPT "C 50%" ; FONT oTxtfont ; ACTION ( nCPos := INT(nSGet[3] * 0.5), [color=#FF0000:f0xpshk2]oBrw2:SelectCol(nCPos)[/color:f0xpshk2], ; oSay4:Refresh(), oBrw2:Refresh() ) oBtn[15]:cTooltip := "Jump to Col ( 50% ) oBtn[15]:SetColor( 128 ) Jumping to a defined [color=#008000:f0xpshk2]Row[/color:f0xpshk2] works fine [color=#008040:f0xpshk2]oBrw:nArrayAt := nRPos[/color:f0xpshk2] But with a defined [color=#FF0000:f0xpshk2]Col[/color:f0xpshk2], the table doesn't move only HScroll works. Clicking on the HScroll-thumb, the table moves to the Position. [color=#FF0000:f0xpshk2]oBrw:SelectCol(nCPos)[/color:f0xpshk2] [img:f0xpshk2]http&#58;//www&#46;pflegeplus&#46;com/pictures/xbrwpos1&#46;jpg[/img:f0xpshk2] The calculated Col-pos with 50% shows 25 and the HScroll-thumb is centered. The Table only moves, clicking on the adjusted HScroll-thumb. [img:f0xpshk2]http&#58;//www&#46;pflegeplus&#46;com/pictures/xbrwpos2&#46;jpg[/img:f0xpshk2]
xBrowse => oBrw:SelectCol(nPos) doesn't work ?
If you want to go to a particular column number, oBrw:nColSel := <nColNo> oBrw:RefreshCurrent()
xBrowse => oBrw:SelectCol(nPos) doesn't work ?
Mr. Rao, Thank You very much. I tested, but it seems to work only in one Direction I still had to add < oBrw:oHScroll:SetPos( nCPos ) >, otherwise the HScroll-thumb stays at the left. I got it working with : // nSGet[3] = max Cols @ 173, 455 BTNBMP oBtn[15] ; SIZE 32, 11 OF oDlg1 PIXEL 2007 ROUND ; PROMPT "C 50%" ; FONT oTxtfont ; ACTION ( nCPos := INT(nSGet[3] * 0.5), [color=#0000FF:3j2tr4y3]oBrw2:SelectCol( Min( nCPos, Len( oBrw2:aCols ) ), .t. ), [/color:3j2tr4y3]; oBrw2:Refresh(), oSay4:Refresh(), nObject := 0, oSay6:Refresh() ) oBtn[15]:cTooltip := "Jump to Col ( 50% )" oBtn[15]:SetColor( 128 ) Forward : [img:3j2tr4y3]http&#58;//www&#46;pflegeplus&#46;com/pictures/xbrwpos3&#46;jpg[/img:3j2tr4y3] Back to 10% moves the visible Col-Position to 10 on Screen and not the Record : The Browser-Col-position is stll the same. [img:3j2tr4y3]http&#58;//www&#46;pflegeplus&#46;com/pictures/xbrwpos4&#46;jpg[/img:3j2tr4y3] Best Regards Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
xBrowse ARRAY SELECTBOX
To all, Would someone be so kind to post an example how to make best a xBrowse from an ARRAY with a select column (YES/NO). I always change the array and then read the whole array again and do a refresh. But I think this could be done easier. Thanks in advance, Otto [img:3ddwsi46]http&#58;//www&#46;atzwanger-software&#46;com/fw/checkbox&#46;jpg[/img:3ddwsi46]
xBrowse ARRAY SELECTBOX
Otto, Here is a copy of an old message about using a on/off bitmap in xBrowse. Is this what you are already doing? Why do you need to reload the array? James ---------------------------- Post subject: Re: Xbrowse newbiePosted: Fri Mar 20, 2009 11:07 am Joined: Fri Oct 07, 2005 5:50 am Posts: 474 Location: Columbia, South Carolina USA Here is the answer to my own question .. for all those folks like me .. Txbrowse is very powerful .. especially using the EDIT_GET code block and notice the oCol:SetCheck( { "ON", "OFF" } ) where "ON", "OFF" is a bitmap .. which is a resource .. that shows the checkbox column .. Very Nice Rick Lipkin
xBrowse ARRAY SELECTBOX
Hello James, thank you for putting me in the right direction. Now it is working. Best regards, Otto [code=fw:3vlh40f6]<div class="fw" id="{CB}" style="font-family: monospace;">oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">cHeader</span> &nbsp; &nbsp; &nbsp; &nbsp; := <span style="color: #ff0000;">'Löschen'</span><br />&nbsp; &nbsp; oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nWidth</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">90</span><br />&nbsp; &nbsp; &nbsp;oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nEditType</span> &nbsp; &nbsp; &nbsp; := EDIT_BUTTON<br />&nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">AddResource</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"OKKLEIN"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">AddResource</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"LEER"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bBmpData</span> &nbsp; &nbsp; &nbsp; := &nbsp;<span style="color: #000000;">&#123;</span> || iif<span style="color: #000000;">&#40;</span> &nbsp;aTageSort<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nArrayAt</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> = .t., <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bEditBlock</span> &nbsp; &nbsp; &nbsp;:= &nbsp; <span style="color: #000000;">&#123;</span>|| iif<span style="color: #000000;">&#40;</span> aTageSort<span style="color: #000000;">&#91;</span> oBrw:<span style="color: #000000;">nArrayAt</span> <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> = .t.,;<br />&nbsp; &nbsp; aTageSort<span style="color: #000000;">&#91;</span> oBrw:<span style="color: #000000;">nArrayAt</span> <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> := .f. , ;<br />&nbsp; &nbsp; aTageSort<span style="color: #000000;">&#91;</span> oBrw:<span style="color: #000000;">nArrayAt</span> <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> := .t. <span style="color: #000000;">&#41;</span> &nbsp;<span style="color: #000000;">&#125;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>[/code:3vlh40f6]
xBrowse ARRAY SELECTBOX
Mr Otto Why all this code? I think this small function works well oBrw:aCols[ 1 ]:SetCheck( { 'OKKLEIN', 'LEER' } ) oBrw:aCols[ 1 ]:nEditType := 1
xBrowse ARRAY SELECTBOX
Hello Mr. Rao, thank you. You are right. May I ask for some more help. How do I suppress the displaying of .T., .F. beside the bitmap? I would like to lock some records from being able to be changed. I tried like this. How would you suggest to implement this functionality. Thanks in advance Otto [code=fw:1ptd88iy]<div class="fw" id="{CB}" style="font-family: monospace;"> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bEditBlock</span> &nbsp; &nbsp; &nbsp;:= &nbsp; <span style="color: #000000;">&#123;</span>|| iif<span style="color: #000000;">&#40;</span> aTageSort<span style="color: #000000;">&#91;</span> oBrw:<span style="color: #000000;">nArrayAt</span> <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span>=<span style="color: #ff0000;">"NEIN"</span>,;<br />&nbsp; &nbsp; <span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Mindestsicherung"</span><span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; iif<span style="color: #000000;">&#40;</span> aTageSort<span style="color: #000000;">&#91;</span> oBrw:<span style="color: #000000;">nArrayAt</span> <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> = .t.,;<br />&nbsp; &nbsp; aTageSort<span style="color: #000000;">&#91;</span> oBrw:<span style="color: #000000;">nArrayAt</span> <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> := .f. , ;<br />&nbsp; &nbsp; aTageSort<span style="color: #000000;">&#91;</span> oBrw:<span style="color: #000000;">nArrayAt</span> <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> := .t. <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span></div>[/code:1ptd88iy] [img:1ptd88iy]http&#58;//www&#46;atzwanger-software&#46;com/fw/checkbox2&#46;jpg[/img:1ptd88iy]
xBrowse ARRAY SELECTBOX
Hello Otto. Please try with bStrDta := {|| NIL }
xBrowse ARRAY SELECTBOX
Hello Daniel, I tried oBrw:aCols[1]:bStrData := {|| NIL } but with no success. But on the PC I am working – production system – I have 9.01 installed. I will try with a newer xBrowse later. I will post the result tomorrow. Thanks again. Best regards, Otto
xBrowse ARRAY SELECTBOX
this was a minor bug earlier. In the present version it is automatically suppressed
xBrowse ARRAY SELECTBOX
Otto... this is a easy way to solve your problem... but you need modify the xbrowse class open xbrowse.prg find METHOD PaintData in method find ( aprox line 6834 ) [code=fw:27ctfg5t]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">if</span> ::<span style="color: #000000;">bStrData</span> != <span style="color: #00C800;">nil</span></div>[/code:27ctfg5t] change with [code=fw:27ctfg5t]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">if</span> ::<span style="color: #000000;">bStrData</span> != <span style="color: #00C800;">nil</span> .and. ! ::<span style="color: #000000;">hChecked</span></div>[/code:27ctfg5t] save file and include this in you project
xBrowse ARRAY SELECTBOX
Hello Daniel, thank you. Now it is ok. Best regards, Otto
xBrowse ASC / VKey -viewer ( DOWNLOAD ) Upd. 3.2
Hello, because I'm to lazy, searching always inside a ASC-table or loading a external appl, I created a xBrowse-solution. The different CHR's are seperated in groups and displayed inside a extra browser. I noticed, serching for a value, nKeys < 100 must be edit with a 0 like [b:384na6jr]063[/b:384na6jr] Maybe You like it : Download : <!-- m --><a class="postlink" href="http://www.pflegeplus.com/fw_downloads/Ascview.zip">http://www.pflegeplus.com/fw_downloads/Ascview.zip</a><!-- m --> [img:384na6jr]http&#58;//www&#46;pflegeplus&#46;com/pictures/Ascview&#46;jpg[/img:384na6jr] Best Regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
xBrowse ASC / VKey -viewer ( DOWNLOAD ) Upd. 3.2
Thanks!
xBrowse ASC / VKey -viewer ( DOWNLOAD ) Upd. 3.2
Hello, for the new release with print-button, I need a[color=#0000FF:2cflqu2l] [size=150:2cflqu2l]REPORT-sample[/size:2cflqu2l][/color:2cflqu2l] printing 4 columns from 4 defined ARRAYS [color=#0000FF:2cflqu2l][b:2cflqu2l]next each other [/b:2cflqu2l]:[/color:2cflqu2l] like the browsers : [img:2cflqu2l]http&#58;//www&#46;pflegeplus&#46;com/pictures/Ascview1&#46;jpg[/img:2cflqu2l] CANNOT ADD AS CODE : I explain : The defined STRINGS [b:2cflqu2l]cCHAR1 := "ABCDEFGHIJKLMNOPQRSTUVWXYZ" cCHAR2 := "abcdefghijklmnopqrstuvwxyzß" cCHAR3 := "0123456789" cCHAR4 := '^°!"§$%&/()=?\´`@€+*~#' + "'" + '<>|µ,;.:-_' the created ARRAYS I := 1 FOR I := 1 TO LEN( cCHAR1) AADD(aArray1, { SUBSTR(cCHAR1,I,1), ASC(SUBSTR(cCHAR1,I,1)) }) NEXT I := 1 FOR I := 1 TO LEN( cCHAR2) AADD(aArray2, { SUBSTR(cCHAR2,I,1), ASC(SUBSTR(cCHAR2,I,1)) }) NEXT I := 1 FOR I := 1 TO LEN( cCHAR3) AADD(aArray3, { SUBSTR(cCHAR3,I,1), ASC(SUBSTR(cCHAR3,I,1)) }) NEXT I := 1 FOR I := 1 TO LEN( cCHAR4) AADD(aArray4, { SUBSTR(cCHAR4,I,1), ASC(SUBSTR(cCHAR4,I,1)) }) NEXT[/b:2cflqu2l] As code NOT possible because : [color=#FF0000:2cflqu2l][b:2cflqu2l]General Error SQL ERROR [ mysql4 ] Incorrect string value: '\xC2 An SQL error occurred while fetching this page. Please contact the Board Administrator if this problem persists[/b:2cflqu2l].[/color:2cflqu2l] Best Regards Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
xBrowse ASC / VKey -viewer ( DOWNLOAD ) Upd. 3.2
Uwe, Define the action of your print button: ACTION Print( cChar1, cChar2, cChar3, cChar4 ) [code=fw:2xhqxzt8]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> <span style="color: #00C800;">Print</span><span style="color: #000000;">&#40;</span> cChar1, cChar2, cChar3, cChar4 <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">LOCAL</span> nMaxiArray<br /><span style="color: #00C800;">LOCAL</span> aPrint&nbsp; &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><span style="color: #00C800;">LOCAL</span> I<br /><span style="color: #00C800;">LOCAL</span> aArray1 := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><span style="color: #00C800;">LOCAL</span> aArray2 := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><span style="color: #00C800;">LOCAL</span> aArray3 := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><span style="color: #00C800;">LOCAL</span> aArray4 := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><span style="color: #00C800;">LOCAL</span> oRepo<br /><br />I := <span style="color: #000000;">1</span><br /><span style="color: #00C800;">FOR</span> I := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> LEN<span style="color: #000000;">&#40;</span> cCHAR1<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; AADD<span style="color: #000000;">&#40;</span>aArray1, <span style="color: #000000;">&#123;</span> <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">&#40;</span>cCHAR1,I,<span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span>, <span style="color: #0000ff;">ASC</span><span style="color: #000000;">&#40;</span><span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">&#40;</span>cCHAR1,I,<span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">NEXT</span><br />nMaxiArray := I<br />I := <span style="color: #000000;">1</span><br /><span style="color: #00C800;">FOR</span> I := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> LEN<span style="color: #000000;">&#40;</span> cCHAR2<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; AADD<span style="color: #000000;">&#40;</span>aArray2, <span style="color: #000000;">&#123;</span> <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">&#40;</span>cCHAR2,I,<span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span>, <span style="color: #0000ff;">ASC</span><span style="color: #000000;">&#40;</span><span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">&#40;</span>cCHAR2,I,<span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">NEXT</span><br />nMaxiArray := <span style="color: #0000ff;">max</span><span style="color: #000000;">&#40;</span> nMaxiArray, I <span style="color: #000000;">&#41;</span><br />I := <span style="color: #000000;">1</span><br /><span style="color: #00C800;">FOR</span> I := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> LEN<span style="color: #000000;">&#40;</span> cCHAR3<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; AADD<span style="color: #000000;">&#40;</span>aArray3, <span style="color: #000000;">&#123;</span> <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">&#40;</span>cCHAR3,I,<span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span>, <span style="color: #0000ff;">ASC</span><span style="color: #000000;">&#40;</span><span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">&#40;</span>cCHAR3,I,<span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">NEXT</span><br />nMaxiArray := <span style="color: #0000ff;">max</span><span style="color: #000000;">&#40;</span> nMaxiArray, I <span style="color: #000000;">&#41;</span><br />I := <span style="color: #000000;">1</span><br /><span style="color: #00C800;">FOR</span> I := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> LEN<span style="color: #000000;">&#40;</span> cCHAR4<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; AADD<span style="color: #000000;">&#40;</span>aArray4, <span style="color: #000000;">&#123;</span> <span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">&#40;</span>cCHAR4,I,<span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span>, <span style="color: #0000ff;">ASC</span><span style="color: #000000;">&#40;</span><span style="color: #0000ff;">SUBSTR</span><span style="color: #000000;">&#40;</span>cCHAR4,I,<span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">NEXT</span><br />nMaxiArray := <span style="color: #0000ff;">max</span><span style="color: #000000;">&#40;</span> nMaxiArray, I <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">FOR</span> I := <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> nMaxiArray<br />&nbsp; &nbsp; <span style="color: #00C800;">IF</span> I <= len<span style="color: #000000;">&#40;</span> aArray1 <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; aAdd<span style="color: #000000;">&#40;</span> aPrint, <span style="color: #000000;">&#123;</span> aArray1<span style="color: #000000;">&#91;</span> I, <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span>, str<span style="color: #000000;">&#40;</span> aArray1<span style="color: #000000;">&#91;</span> I, <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>, <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp; &nbsp; &nbsp; aAdd<span style="color: #000000;">&#40;</span> aPrint, <span style="color: #000000;">&#123;</span> space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span>, space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp; <span style="color: #00C800;">IF</span> I <= len<span style="color: #000000;">&#40;</span> aArray2 <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; aAdd<span style="color: #000000;">&#40;</span> aTail<span style="color: #000000;">&#40;</span> aPrint <span style="color: #000000;">&#41;</span>, aArray2<span style="color: #000000;">&#91;</span> I, <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; aAdd<span style="color: #000000;">&#40;</span> aTail<span style="color: #000000;">&#40;</span> aPrint <span style="color: #000000;">&#41;</span>, str<span style="color: #000000;">&#40;</span> aArray2<span style="color: #000000;">&#91;</span> I, <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>, <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp; &nbsp; &nbsp; aAdd<span style="color: #000000;">&#40;</span> aTail<span style="color: #000000;">&#40;</span> aPrint <span style="color: #000000;">&#41;</span>, space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; aAdd<span style="color: #000000;">&#40;</span> aTail<span style="color: #000000;">&#40;</span> aPrint <span style="color: #000000;">&#41;</span>, space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp; <span style="color: #00C800;">IF</span> I <= len<span style="color: #000000;">&#40;</span> aArray3 <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; aAdd<span style="color: #000000;">&#40;</span> aTail<span style="color: #000000;">&#40;</span> aPrint <span style="color: #000000;">&#41;</span>, aArray3<span style="color: #000000;">&#91;</span> I, <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; aAdd<span style="color: #000000;">&#40;</span> aTail<span style="color: #000000;">&#40;</span> aPrint <span style="color: #000000;">&#41;</span>, str<span style="color: #000000;">&#40;</span> aArray3<span style="color: #000000;">&#91;</span> I, <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>, <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp; &nbsp; &nbsp; aAdd<span style="color: #000000;">&#40;</span> aTail<span style="color: #000000;">&#40;</span> aPrint <span style="color: #000000;">&#41;</span>, space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; aAdd<span style="color: #000000;">&#40;</span> aTail<span style="color: #000000;">&#40;</span> aPrint <span style="color: #000000;">&#41;</span>, space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br />&nbsp; &nbsp; <span style="color: #00C800;">IF</span> I <= len<span style="color: #000000;">&#40;</span> aArray4 <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; aAdd<span style="color: #000000;">&#40;</span> aTail<span style="color: #000000;">&#40;</span> aPrint <span style="color: #000000;">&#41;</span>, aArray4<span style="color: #000000;">&#91;</span> I, <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; aAdd<span style="color: #000000;">&#40;</span> aTail<span style="color: #000000;">&#40;</span> aPrint <span style="color: #000000;">&#41;</span>, str<span style="color: #000000;">&#40;</span> aArray4<span style="color: #000000;">&#91;</span> I, <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span>, <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp; &nbsp; &nbsp; aAdd<span style="color: #000000;">&#40;</span> aTail<span style="color: #000000;">&#40;</span> aPrint <span style="color: #000000;">&#41;</span>, space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; aAdd<span style="color: #000000;">&#40;</span> aTail<span style="color: #000000;">&#40;</span> aPrint <span style="color: #000000;">&#41;</span>, space<span style="color: #000000;">&#40;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br /><span style="color: #00C800;">NEXT</span><br />I := <span style="color: #000000;">1</span><br /><br />REPORT oRepo <span style="color: #0000ff;">TITLE</span> &nbsp;<span style="color: #ff0000;">"*** ASC TABLE BY UWE ***"</span>,<span style="color: #ff0000;">""</span> PREVIEW<br />&nbsp; &nbsp; COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"CHR"</span> <span style="color: #00C800;">DATA</span> aPrint<span style="color: #000000;">&#91;</span> I, <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">5</span><br />&nbsp; &nbsp; COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"ASC"</span> <span style="color: #00C800;">DATA</span> aPrint<span style="color: #000000;">&#91;</span> I, <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">5</span><br />&nbsp; &nbsp; COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"CHR"</span> <span style="color: #00C800;">DATA</span> aPrint<span style="color: #000000;">&#91;</span> I, <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">5</span><br />&nbsp; &nbsp; COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"ASC"</span> <span style="color: #00C800;">DATA</span> aPrint<span style="color: #000000;">&#91;</span> I, <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">5</span><br />&nbsp; &nbsp; COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"CHR"</span> <span style="color: #00C800;">DATA</span> aPrint<span style="color: #000000;">&#91;</span> I, <span style="color: #000000;">5</span> <span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">5</span><br />&nbsp; &nbsp; COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"ASC"</span> <span style="color: #00C800;">DATA</span> aPrint<span style="color: #000000;">&#91;</span> I, <span style="color: #000000;">6</span> <span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">5</span><br />&nbsp; &nbsp; COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"CHR"</span> <span style="color: #00C800;">DATA</span> aPrint<span style="color: #000000;">&#91;</span> I, <span style="color: #000000;">7</span> <span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">5</span><br />&nbsp; &nbsp; COLUMN <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"ASC"</span> <span style="color: #00C800;">DATA</span> aPrint<span style="color: #000000;">&#91;</span> I, <span style="color: #000000;">8</span> <span style="color: #000000;">&#93;</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">5</span><br />END REPORT<br /><span style="color: #00C800;">IF</span> oRepo:<span style="color: #000000;">lCreated</span><br />&nbsp; oRepo:<span style="color: #000000;">bSkip</span> := <span style="color: #000000;">&#123;</span>|| I ++ <span style="color: #000000;">&#125;</span><br /><span style="color: #00C800;">ENDIF</span><br /><span style="color: #0000ff;">ACTIVATE</span> REPORT oRepo <span style="color: #00C800;">WHILE</span> I <= len<span style="color: #000000;">&#40;</span> aPrint <span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">RETURN</span> <span style="color: #00C800;">NIL</span></div>[/code:2xhqxzt8]
xBrowse ASC / VKey -viewer ( DOWNLOAD ) Upd. 3.2
André, Thank You very much for Your help. Now it works / includes the things I needed. One browser solution . New Download 1.2 : <!-- m --><a class="postlink" href="http://www.pflegeplus.com/fw_downloads/Ascview2.zip">http://www.pflegeplus.com/fw_downloads/Ascview2.zip</a><!-- m --> [img:2foj5gs9]http&#58;//www&#46;pflegeplus&#46;com/picture/ascview2&#46;jpg[/img:2foj5gs9]( [img:2foj5gs9]http&#58;//www&#46;pflegeplus&#46;com/picture/ascview3&#46;jpg[/img:2foj5gs9]( Best Regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
xBrowse ASC / VKey -viewer ( DOWNLOAD ) Upd. 3.2
A extended version . Now You can create Your own viewer with any Brush-background-combination and Textcolor A working PRG / EXE will be generated with or without a main-window. As well it is a tool, to optimize the background-selection between Window, Dialog, Folder and Text. Download <!-- m --><a class="postlink" href="http://www.pflegeplus.com/fw_downloads/Ascview21.zip">http://www.pflegeplus.com/fw_downloads/Ascview21.zip</a><!-- m --> [size=150:1b399y1o]I'm still looking for a solution, to bring EXCEL to FRONT !!!![/size:1b399y1o] You can test it from inside the Tables A new Main-window added. Create Window- or Dialog-EXE added. Info of all Settings / Sekection added. Background-painters added. Creates a PRG and EXE Two Styles : with Mainwindow or only Dialog [size=150:1b399y1o]Please adjust these link-files : GOW.bat and WASC.rmk and GOD.bat and DASC.rmk[/size:1b399y1o] [img:1b399y1o]http&#58;//www&#46;pflegeplus&#46;com/pictures/ascv1&#46;jpg[/img:1b399y1o] Viw the ASC-table [img:1b399y1o]http&#58;//www&#46;pflegeplus&#46;com/pictures/ascv2&#46;jpg[/img:1b399y1o] View the VKey-table [img:1b399y1o]http&#58;//www&#46;pflegeplus&#46;com/pictures/ascv3&#46;jpg[/img:1b399y1o] Create / select any brush-combination between Window / Dialog and Folder [img:1b399y1o]http&#58;//www&#46;pflegeplus&#46;com/pictures/ascv4&#46;jpg[/img:1b399y1o] A extra folder-tab, to select the BMP- and Image-brush [img:1b399y1o]http&#58;//www&#46;pflegeplus&#46;com/pictures/ascv5&#46;jpg[/img:1b399y1o] The Window-background can be selected from a extra Dialog. [img:1b399y1o]http&#58;//www&#46;pflegeplus&#46;com/pictures/ascv6&#46;jpg[/img:1b399y1o] A overview of all settings / selections [img:1b399y1o]http&#58;//www&#46;pflegeplus&#46;com/pictures/ascv7&#46;jpg[/img:1b399y1o] Best Regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
xBrowse ASC / VKey -viewer ( DOWNLOAD ) Upd. 3.2
Uwe, Compiled with MSVC excel (2007) goes to front. The only change I did was to remove line 627 from wasc.prg because it throwed an error: wasc.prg(627) Error E0030 Syntax error "syntax error at '|'"
xBrowse ASC / VKey -viewer ( DOWNLOAD ) Upd. 3.2
André, Thank You very much for testing. There are 2 compiled versions included ( EXE ) WAsc.exe ( with Mainwindow ) and DAsc.exe ( only Dialog ). There Excel is not shown on TOP ? Maybe someting to do with my config. Can You send me Your recompiled Version by Email for a test ? <!-- e --><a href="mailto:esckoenig@aol.com">esckoenig@aol.com</a><!-- e --> The error, I don't understand : DEFINE DIALOG oDlg1 FROM 30, 50 TO 650, 800 OF oWnd PIXEL ; [color=#FF0000:1gjcuszi][b:1gjcuszi]627 [/b:1gjcuszi][/color:1gjcuszi]STYLE nOR( DS_MODALFRAME | WS_POPUP | WS_DLGFRAME | WS_THICKFRAME ) Best Regards Uwe <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
xBrowse ASC / VKey -viewer ( DOWNLOAD ) Upd. 3.2
Sent.
xBrowse ASC / VKey -viewer ( DOWNLOAD ) Upd. 3.2
Hello Uwe, nice job! Here, to compile WASC.PRG, had to change the line # 627 to: STYLE nOR( DS_MODALFRAME , WS_POPUP, WS_DLGFRAME, WS_THICKFRAME ) The Excel opens at the front. Regards, Euclides.
xBrowse ASC / VKey -viewer ( DOWNLOAD ) Upd. 3.2
New Update 3.1 now You can create Your own tables, because Array changed to DBF. Complete rewritten with many new functions. Download : <!-- m --><a class="postlink" href="http://www.pflegeplus.com/fw_downloads/ascview3.zip">http://www.pflegeplus.com/fw_downloads/ascview3.zip</a><!-- m --> [img:1rshn9wf]http&#58;//www&#46;pflegeplus&#46;com/pictures/AView1&#46;jpg[/img:1rshn9wf] [img:1rshn9wf]http&#58;//www&#46;pflegeplus&#46;com/pictures/AView2&#46;jpg[/img:1rshn9wf] Create a viewer with a main-window [img:1rshn9wf]http&#58;//www&#46;pflegeplus&#46;com/pictures/AView3&#46;jpg[/img:1rshn9wf] Create a viewer with only a Dialog [img:1rshn9wf]http&#58;//www&#46;pflegeplus&#46;com/pictures/AView4&#46;jpg[/img:1rshn9wf] Define any background-combination between Window / Dialog and Folder A overview of all selected selected values [img:1rshn9wf]http&#58;//www&#46;pflegeplus&#46;com/pictures/AView5&#46;jpg[/img:1rshn9wf] Best Regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
xBrowse ASC / VKey -viewer ( DOWNLOAD ) Upd. 3.2
New Update 3.2 added [color=#0000FF:dpbpt1rc][b:dpbpt1rc]colored xbrowse-cell[/b:dpbpt1rc], [/color:dpbpt1rc] showing the incremental search result of a key Because all settings are saved in the first record of ASCKEYS.dbf, there is no need to recompile WASC.exe and DASC.exe. Changing brushes or colors, is done with the main-appl. ASCVIEW.exe [img:dpbpt1rc]http&#58;//www&#46;pflegeplus&#46;com/pictures/search1&#46;jpg[/img:dpbpt1rc] You can change the cellcolor of the seach-result [img:dpbpt1rc]http&#58;//www&#46;pflegeplus&#46;com/pictures/search2&#46;jpg[/img:dpbpt1rc] Download : ( only the needed update-files ) <!-- m --><a class="postlink" href="http://www.pflegeplus.com/fw_downloads/asupd2.zip">http://www.pflegeplus.com/fw_downloads/asupd2.zip</a><!-- m --> Best Regards Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
xBrowse AUTOSORT
Muy buenas, alguien me podría decir por que si ordeno el xbrowse con AUTOSORT y definido así solo me deja ordenar algúnas columnas: function xbrowsetest() redefine XBROWSE oR:aoTbrs[1] id 501 COLUMNS 17,2,6,9,7,15,16; OF oR:oDlg SIZES 40,120,90,170,90,170,90 HEADERS "Sel.","Recibo","F.Factura","Cliente","F.Emision","Cuenta Bancaria","Importe"; JUSTIFY .f.,.f.,.f.,.f.,.f.,.f.,.t.; ARRAY oR:o:aRecibos LINES CELL AUTOSORT PropXBrowse(oR:aoTbrs[1],,@oR) return static function PropXBrowse(oTbr,oFont,oCS) local oCol,n:=1 default oFont:=nil oTbr:nMarqueeStyle:=5 oTbr:nStretchCol := STRETCHCOL_WIDEST //oTbr:nColDividerStyle := LINESTYLE_NOLINES //oTbr:nRowDividerStyle := LINESTYLE_NOLINES oTbr:lColDividerComplete := .t. //oTbr:lAllowRowSizing:=.f. oTbr:lAllowColSwapping:=.t. oTbr:lRecordSelector:=.f. oTbr:lHeader:=.t. oTbr:lFooter:=.f. oTbr:lHScroll:=.f. oTbr:lVScroll:=.t. if oFont=nil oTbr:oFont:=oApplication:oFontVerdanaBold else oTbr:oFont:=oFont end if with object oTbr:aCols[1] :SetCheck( { "OK_SMALL", "CANCEL_SMALL" } ) :bStrData:={||NIL} end oTbr:bLClicked := { | nRow, nCol | LClicked(@oTbr,@oCS)} oTbr:aCols[7]:cEditPicture := Precios_Mask(.t.) return Mil Gracias.
xBrowse AUTOSORT
Do you want that xbrowse should NOT sort on some columns? Set oCol:cSortOrder := nil, for those columns.
xBrowse AUTOSORT
Gracias, pero es todo lo contrario, hay columnas que se pueden ordenar y otras nó, me gustaría que todas se puedan ordenar. Un Saludo y mil gracias.
xBrowse AUTOSORT
If you use AUTOSORT clause, all columns are sorted.
xBrowse AUTOSORT
Pues en este caso no es así, no se porque, ¿alguien sabe por que? un saludo.
xBrowse AUTOSORT DBF does not work
Hello, I have an xBrowse defined such way: [code=fw:ba6a40fe]<div class="fw" id="{CB}" style="font-family: monospace;">  @ <span style="color: #000000;">14</span>,<span style="color: #000000;">72</span> <span style="color: #0000ff;">XBROWSE</span> oVMenuBrowse <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-10</span>,<span style="color: #000000;">-21</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />          <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"CLIENTES"</span> AUTOSORT;<br />          FIELDS CLIENTES->CODIGO,CLIENTES->NOMBRE ;<br />          HEADERS <span style="color: #ff0000;">"Código"</span>, <span style="color: #ff0000;">"Nombre"</span>  ;<br />          SIZES  <span style="color: #000000;">90</span>, <span style="color: #000000;">80</span><br /> </div>[/code:ba6a40fe] Indexes are: [code=fw:ba6a40fe]<div class="fw" id="{CB}" style="font-family: monospace;">   <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> NOMBRE TAG CLIENTES1  <span style="color: #00C800;">FOR</span> !Deleted<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> CODIGO TAG CLIENTES2  <span style="color: #00C800;">FOR</span> !Deleted<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></div>[/code:ba6a40fe] Thank you.
xBrowse AUTOSORT DBF does not work
[code=fw:3okjbbck]<div class="fw" id="{CB}" style="font-family: monospace;">@ <span style="color: #000000;">14</span>,<span style="color: #000000;">72</span> <span style="color: #0000ff;">XBROWSE</span> oVMenuBrowse <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-10</span>,<span style="color: #000000;">-21</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"CLIENTES"</span> AUTOSORT;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; COLUMNS <span style="color: #ff0000;">"CODIGO"</span>,<span style="color: #ff0000;">"NOMBRE"</span> ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HEADERS <span style="color: #ff0000;">"Código"</span>, <span style="color: #ff0000;">"Nombre"</span> &nbsp;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SIZES &nbsp;<span style="color: #000000;">90</span>, <span style="color: #000000;">80</span><br />&nbsp;</div>[/code:3okjbbck] Autosort works when you use COLUMNS clause like this. Does not work when you use FIELDS clause. We advise you to use COLUMNS clause only and never to use FIELDS clause. Note: FIELDS clause was created for compatibility with WBrowse syntax to ease initial migration.
xBrowse AUTOSORT DBF does not work
Thank you. But in some xbrowse cols, I have defined the field like this: ( CONCEPTO->IMPORTE + (CONCEPTO->IMPORTE*CONCEPTO->IVA/100) - (CONCEPTO->IMPORTE*CONCEPTO->IRPF/100) ) But in COLUMNS clause does not work. How should I proceed please?
xBrowse AUTOSORT DBF does not work
In the COLUMNS clause, we can include expressions also, as long as the expression can be evaluated in another module, i.e., expressions not containing local variables or static functions. The above can be written as [code=fw:26ghjn3p]<div class="fw" id="{CB}" style="font-family: monospace;">COLUMNS <span style="color: #ff0000;">"IMPORTE+(IMPORTE*IVA/100)-(IMPORTE*IRPF/100)"</span>, <span style="color: #ff0000;">"NEXTCOL"</span>, ...</div>[/code:26ghjn3p] Incidentally, the expression IMPORTE+(IMPORTE*IVA/100)-(IMPORTE*IRPF/100) can be simplified as IMPORTE * ( 1 + ( IVA-IRPF) / 100 ) So we can write [code=fw:26ghjn3p]<div class="fw" id="{CB}" style="font-family: monospace;">COLUMNS <span style="color: #ff0000;">"IMPORTE * ( 1 + ( IVA-IRPF) / 100 )"</span>, <span style="color: #ff0000;">"NEXTCOL"</span>, ...</div>[/code:26ghjn3p]
xBrowse Adjust Last Column
Esta adaptacion esta hecha a sugerencia del colega William Morales, espero haber captado la idea This adaptation was suggest by William Morales Se trata de ajustas la ultima columna del browse al ancho restante disponible, para que no quede ningun espacio vacio.... Adjust Last Column browse of the remaining available width, so that no empty space .... les dejo un ejemplo a descargar, si desean probar... Let a sample for test.. [url:qpq38oc7]http&#58;//www&#46;sitasoft&#46;com/fivewin/test/xbcoladj&#46;rar[/url:qpq38oc7] [b:qpq38oc7]Archivo a Modificar / File to Change[/b:qpq38oc7] XBROWSE.PRG [b:qpq38oc7]Metodo a modificar /METHOD To Change[/b:qpq38oc7] LastDisplayPos( ) [b:qpq38oc7]ABRIR/OPEN XBROWSE.PRG[/b:qpq38oc7] [b:qpq38oc7]AGREGAR NUEVA DATA en TXBrowse / ADD NEW DATA in TXBrowse[/b:qpq38oc7] [code=fw:qpq38oc7]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; <span style="color: #00C800;">DATA</span> lAdjustLastCol AS LOGICAL <span style="color: #0000ff;">INIT</span> .F.</div>[/code:qpq38oc7] [b:qpq38oc7]BUSCAR EN/FIND IN METHOD LastDisplayPos( lComplete ) CLASS TXBrowse[/b:qpq38oc7] [code=fw:qpq38oc7]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; <span style="color: #00C800;">if</span> lComplete .and. nWidth >= nMaxwidth</div>[/code:qpq38oc7] [b:qpq38oc7]EN LINEA AGREGAR DESPUES/ INLINE ADD AFER[/b:qpq38oc7] [code=fw:qpq38oc7]<div class="fw" id="{CB}" style="font-family: monospace;">.and. !::<span style="color: #000000;">lAdjustLastCol</span></div>[/code:qpq38oc7] [b:qpq38oc7]BUSCAR/FIND [/b:qpq38oc7] [code=fw:qpq38oc7]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">return</span> nPos</div>[/code:qpq38oc7] [b:qpq38oc7]AGREGAR ANTES/ ADD BEFORE[/b:qpq38oc7] [code=fw:qpq38oc7]<div class="fw" id="{CB}" style="font-family: monospace;"> &nbsp; <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lAdjustLastCol</span> .and. nPos = nLen<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> nWidth < nMaxwidth <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">ColAtPos</span><span style="color: #000000;">&#40;</span> nPos <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">nWidth</span> += <span style="color: #000000;">&#40;</span> nMaxWidth - nWidth - COL_SEPARATOR <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; elseif nWidth > nMaxwidth<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::<span style="color: #000000;">ColAtPos</span><span style="color: #000000;">&#40;</span> nPos <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">nWidth</span> -= <span style="color: #000000;">&#40;</span> nWidth - nMaxWidth + COL_SEPARATOR <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span></div>[/code:qpq38oc7] [code=fw:qpq38oc7]<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;">"xbrowse.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> oWnd1<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oBrw<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aArray1 := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nI<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> nI = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">20</span><br />&nbsp; &nbsp;aadd<span style="color: #000000;">&#40;</span> aArray1, <span style="color: #000000;">&#123;</span> .f.,SPACE<span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"Row:"</span>+StrZero<span style="color: #000000;">&#40;</span>nI,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" Col:02"</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"Row:"</span>+StrZero<span style="color: #000000;">&#40;</span>nI,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" Col:03"</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"Row:"</span>+StrZero<span style="color: #000000;">&#40;</span>nI,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" Col:03"</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"Row:"</span>+StrZero<span style="color: #000000;">&#40;</span>nI,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" Col:03"</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"Row:"</span>+StrZero<span style="color: #000000;">&#40;</span>nI,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" Col:03"</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"Row:"</span>+StrZero<span style="color: #000000;">&#40;</span>nI,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" Col:03"</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"Row:"</span>+StrZero<span style="color: #000000;">&#40;</span>nI,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" Col:03"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">next</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">window</span> oWnd1 <span style="color: #0000ff;">Title</span> <span style="color: #ff0000;">"Test Adjust Last Column xBrowse"</span> <br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oBrw:= txbrowse<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">new</span><span style="color: #000000;">&#40;</span> oWnd1 <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">nRowHeight</span> := <span style="color: #000000;">40</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">nColDividerStyle</span> &nbsp; &nbsp;:= LINESTYLE_BLACK<br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">nRowDividerStyle</span> &nbsp; &nbsp;:= LINESTYLE_BLACK<br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">SetArray</span><span style="color: #000000;">&#40;</span> aArray1 <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">nMarqueeStyle</span> := <span style="color: #000000;">6</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">bClrStd</span> := <span style="color: #000000;">&#123;</span>|| <span style="color: #000000;">&#123;</span> CLR_BLACK,RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">193</span>,<span style="color: #000000;">221</span>,<span style="color: #000000;">255</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">lRecordSelector</span> := .f.<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">lAdjustLastCol</span> := .t.<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oWnd1:<span style="color: #000000;">oClient</span> = oBrw<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">window</span> oWnd1 <br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:qpq38oc7]
xBrowse Adjust Last Column
Daniel, Thanks! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
xBrowse Adjust Last Column
Dear Mr.Antonio, Can we expect these recent xBrowse changes in the next FWH build. Regards Anser
xBrowse Adjust Last Column
This facility already exists in xbrowse without any change. oBrw:nStretchCol := STRETCHCOL_LAST With this setting, xbrowse fits ( or streches ) the last column to fit the width of the browse. This may not look nice if the last column is a small numeric column. In such cases, there is another setting : oBrw:nStretchCol := STRETCHCOL_WIDEST With this setting, xbrowse stretches the widest character column to fit the width of the browse. I hope I understood the original purpose of the posting correctly
xBrowse Adjust Last Column
Hello nageswaragunupudi Thank for you feedback, every day we learn new things...
xBrowse Adjust Last Column
Hello Mr. Rao to use nStretchCol property does browse so slow, apparently always recalculating the column widths this effect is visible when does use nEditType >= EDIT_LISTBOX check this samples and click any button or resize any columns or rows... thank for you attention [code=fw:llhxpcrg]<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;">"xbrowse.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 />   <span style="color: #00C800;">local</span> oWnd1<br />   <span style="color: #00C800;">local</span> oBrw<br />   <span style="color: #00C800;">local</span> aArray1 := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br />   <span style="color: #00C800;">local</span> nI<br />   <br />   <br />   <span style="color: #00C800;">for</span> nI = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">20</span><br />   aadd<span style="color: #000000;">&#40;</span> aArray1, <span style="color: #000000;">&#123;</span> .f.,SPACE<span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span>,;<br />                                <span style="color: #ff0000;">"Row:"</span>+StrZero<span style="color: #000000;">&#40;</span>nI,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" Col:02"</span>,;<br />                                <span style="color: #ff0000;">"Row:"</span>+StrZero<span style="color: #000000;">&#40;</span>nI,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" Col:03"</span>,;<br />                                <span style="color: #ff0000;">"Row:"</span>+StrZero<span style="color: #000000;">&#40;</span>nI,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" Col:03"</span>,;<br />                                <span style="color: #ff0000;">"Row:"</span>+StrZero<span style="color: #000000;">&#40;</span>nI,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" Col:03"</span>,;<br />                                <span style="color: #ff0000;">"Row:"</span>+StrZero<span style="color: #000000;">&#40;</span>nI,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" Col:03"</span>,;<br />                                <span style="color: #ff0000;">"Row:"</span>+StrZero<span style="color: #000000;">&#40;</span>nI,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" Col:03"</span>,;<br />                                <span style="color: #ff0000;">"Row:"</span>+StrZero<span style="color: #000000;">&#40;</span>nI,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" Col:03"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">next</span><br />   <br />   <br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">window</span> oWnd1 <span style="color: #0000ff;">Title</span> <span style="color: #ff0000;">"Test Adjust Last Column xBrowse"</span> <br />   <br />   <br />   oBrw:= txbrowse<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">new</span><span style="color: #000000;">&#40;</span> oWnd1 <span style="color: #000000;">&#41;</span><br />   oBrw:<span style="color: #000000;">nRowHeight</span> := <span style="color: #000000;">40</span><br />   oBrw:<span style="color: #000000;">nColDividerStyle</span>    := LINESTYLE_BLACK<br />   oBrw:<span style="color: #000000;">nRowDividerStyle</span>    := LINESTYLE_BLACK<br />   oBrw:<span style="color: #000000;">SetArray</span><span style="color: #000000;">&#40;</span> aArray1 <span style="color: #000000;">&#41;</span><br />   oBrw:<span style="color: #000000;">nMarqueeStyle</span> := <span style="color: #000000;">6</span><br />   oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   oBrw:<span style="color: #000000;">bClrStd</span> := <span style="color: #000000;">&#123;</span>|| <span style="color: #000000;">&#123;</span> CLR_BLACK,RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">193</span>,<span style="color: #000000;">221</span>,<span style="color: #000000;">255</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />   oBrw:<span style="color: #000000;">lRecordSelector</span> := .f.<br />   <br />   oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nEditType</span> := EDIT_LISTBOX<br />   oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">4</span> <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nEditType</span> := EDIT_BUTTON<br />   <br />   oBrw:<span style="color: #000000;">nStretchCol</span> := STRETCHCOL_LAST<br /><br />   <br />   oWnd1:<span style="color: #000000;">oClient</span> = oBrw<br />   <br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">window</span> oWnd1 <br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span> <br /> </div>[/code:llhxpcrg]
xBrowse Adjust Last Column
Yes. Stretched columns and EditListBoxes do not go together well. Once the listbox is activated, the flicker starts.
xBrowse Ajuste automatico ultima columna
Esta adaptacion esta hecha a sugerencia del colega William Morales, espero haber captado la idea This adaptation was suggest by William Morales Se trata de ajustas la ultima columna del browse al ancho restante disponible, para que no quede ningun espacio vacio.... Adjust Last Column browse of the remaining available width, so that no empty space .... les dejo un ejemplo a descargar, si desean probar... Let a sample for test.. [url:9tu6rzpk]http&#58;//www&#46;sitasoft&#46;com/fivewin/test/xbcoladj&#46;rar[/url:9tu6rzpk] [b:9tu6rzpk]Archivo a Modificar / File to Change[/b:9tu6rzpk] XBROWSE.PRG [b:9tu6rzpk]Metodo a modificar /METHOD To Change[/b:9tu6rzpk] LastDisplayPos( ) [b:9tu6rzpk]ABRIR/OPEN XBROWSE.PRG[/b:9tu6rzpk] [b:9tu6rzpk]AGREGAR NUEVA DATA en TXBrowse / ADD NEW DATA in TXBrowse[/b:9tu6rzpk] [code=fw:9tu6rzpk]<div class="fw" id="{CB}" style="font-family: monospace;">   <span style="color: #00C800;">DATA</span> lAdjustLastCol AS LOGICAL <span style="color: #0000ff;">INIT</span> .F.</div>[/code:9tu6rzpk] [b:9tu6rzpk]BUSCAR EN/FIND IN METHOD LastDisplayPos( lComplete ) CLASS TXBrowse[/b:9tu6rzpk] [code=fw:9tu6rzpk]<div class="fw" id="{CB}" style="font-family: monospace;">   <span style="color: #00C800;">if</span> lComplete .and. nWidth >= nMaxwidth</div>[/code:9tu6rzpk] [b:9tu6rzpk]EN LINEA AGREGAR DESPUES/ INLINE ADD AFER[/b:9tu6rzpk] [code=fw:9tu6rzpk]<div class="fw" id="{CB}" style="font-family: monospace;">.and. !::<span style="color: #000000;">lAdjustLastCol</span></div>[/code:9tu6rzpk] [b:9tu6rzpk]BUSCAR/FIND [/b:9tu6rzpk] [code=fw:9tu6rzpk]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">return</span> nPos</div>[/code:9tu6rzpk] [b:9tu6rzpk]AGREGAR ANTES/ ADD BEFORE[/b:9tu6rzpk] [code=fw:9tu6rzpk]<div class="fw" id="{CB}" style="font-family: monospace;">   <span style="color: #00C800;">if</span> ::<span style="color: #000000;">lAdjustLastCol</span> .and. nPos = nLen<br />      <span style="color: #00C800;">if</span> nWidth < nMaxwidth <br />          ::<span style="color: #000000;">ColAtPos</span><span style="color: #000000;">&#40;</span> nPos <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">nWidth</span> += <span style="color: #000000;">&#40;</span> nMaxWidth - nWidth - COL_SEPARATOR <span style="color: #000000;">&#41;</span><br />      elseif nWidth > nMaxwidth<br />          ::<span style="color: #000000;">ColAtPos</span><span style="color: #000000;">&#40;</span> nPos <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">nWidth</span> -= <span style="color: #000000;">&#40;</span> nWidth - nMaxWidth + COL_SEPARATOR <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">endif</span><br />   <span style="color: #00C800;">endif</span></div>[/code:9tu6rzpk] [code=fw:9tu6rzpk]<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;">"xbrowse.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> oWnd1<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oBrw<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aArray1 := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> nI<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> nI = <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">20</span><br />&nbsp; &nbsp;aadd<span style="color: #000000;">&#40;</span> aArray1, <span style="color: #000000;">&#123;</span> .f.,SPACE<span style="color: #000000;">&#40;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#41;</span>,;<br />&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"Row:"</span>+StrZero<span style="color: #000000;">&#40;</span>nI,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" Col:02"</span>,;<br />&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"Row:"</span>+StrZero<span style="color: #000000;">&#40;</span>nI,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" Col:03"</span>,;<br />&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"Row:"</span>+StrZero<span style="color: #000000;">&#40;</span>nI,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" Col:03"</span>,;<br />&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"Row:"</span>+StrZero<span style="color: #000000;">&#40;</span>nI,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" Col:03"</span>,;<br />&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"Row:"</span>+StrZero<span style="color: #000000;">&#40;</span>nI,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" Col:03"</span>,;<br />&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"Row:"</span>+StrZero<span style="color: #000000;">&#40;</span>nI,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" Col:03"</span>,;<br />&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff0000;">"Row:"</span>+StrZero<span style="color: #000000;">&#40;</span>nI,<span style="color: #000000;">2</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" Col:03"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">next</span><br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">window</span> oWnd1 <span style="color: #0000ff;">Title</span> <span style="color: #ff0000;">"Test Adjust Last Column xBrowse"</span> <br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oBrw:= txbrowse<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">new</span><span style="color: #000000;">&#40;</span> oWnd1 <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">nRowHeight</span> := <span style="color: #000000;">40</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">nColDividerStyle</span> &nbsp; &nbsp;:= LINESTYLE_BLACK<br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">nRowDividerStyle</span> &nbsp; &nbsp;:= LINESTYLE_BLACK<br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">SetArray</span><span style="color: #000000;">&#40;</span> aArray1 <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">nMarqueeStyle</span> := <span style="color: #000000;">6</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">bClrStd</span> := <span style="color: #000000;">&#123;</span>|| <span style="color: #000000;">&#123;</span> CLR_BLACK,RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">193</span>,<span style="color: #000000;">221</span>,<span style="color: #000000;">255</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">lRecordSelector</span> := .f.<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">lAdjustLastCol</span> := .t.<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;oWnd1:<span style="color: #000000;">oClient</span> = oBrw<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">window</span> oWnd1 <br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:9tu6rzpk]
xBrowse Ajuste automatico ultima columna
Daniel, gracias! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
xBrowse Ajuste automatico ultima columna
Es importante la participacion de los usuarios, sobre comentarios y sugerencias... eso ayuda a solidificar el producto y obtener el mejor rendimiento del mismo En el foro de ingles han comentado que no hacen falta estos cambios pue ya existe en el xbrowse esta propiedad, los intresados pueden revisar el post [quote="nageswaragunupudi":3bbf6ogt]This facility already exists in xbrowse without any change. oBrw:nStretchCol := STRETCHCOL_LAST With this setting, xbrowse fits ( or streches ) the last column to fit the width of the browse. This may not look nice if the last column is a small numeric column. In such cases, there is another setting : oBrw:nStretchCol := STRETCHCOL_WIDEST With this setting, xbrowse stretches the widest character column to fit the width of the browse. I hope I understood the original purpose of the posting correctly[/quote:3bbf6ogt] debo agradecer a nuestro colega Rao (nageswaragunupudi) por tan valiosa observacion, de manera de evitar codigo redundante en la clase txbrowse
xBrowse Ajuste automatico ultima columna
Nuevo descubrimiento con respecto a este punto... despues de varias pruebas me he dado cuenta que el uso de EDIT_GET_LISTBOX, EDIT_LISTBOX, EDIT_GET_BUTTON Y EDIT_BUTTON no trabajan apropiadamente con la propiedad de nStretchCol, porque genera un desagradable parpadeo en los botones Por tal motivo se mantendra el cambio planteado en este post y podra ser incuido en el proximo build
xBrowse AutoSort won't work if xBrw:lAllowColSwapping = .f.
I tested with FWH8.02. Is this a bug?
xBrowse AutoSort won't work if xBrw:lAllowColSwapping = .f.
This is a bug even in 8.04. I tried this small correction in XBrowse.Prg [code:2wwevqpb] METHOD HeaderLButtonDown&#40; nMRow, nMCol, nFlags &#41; CLASS TXBrwColumn if &#58;&#58;oBrw&#58;nCaptured == 0 //&#46;and&#46; &#58;&#58;oBrw&#58;lAllowColSwapping // commented out &#58;&#58;oBrw&#58;oCapCol &#58;= Self &#58;&#58;oBrw&#58;nCaptured &#58;= 1 &#58;&#58;oBrw&#58;Capture&#40;&#41; &#58;&#58;PaintHeader&#40; 2, nil, &#58;&#58;oBrw&#58;nHeaderHeight - 3, &#46;t&#46; &#41; endif return nil [/code:2wwevqpb] Now everything seems to be working fine. But I am not yet sure this does not have any other side effects. Or there is another better way to do this
xBrowse AutoSort won't work if xBrw:lAllowColSwapping = .f.
Seems to still exist in FWH10.4. Can it be fixed in 10.5 as per Rao's suggestion? Thanks
xBrowse Back colour of a column based on the column value.
Hi, How do I change the Background colour of a column based on a the column value. The following code is giving error [code=fw:26qykd2r]<div class="fw" id="{CB}" style="font-family: monospace;">Error description: <span style="color: #000000;">Error</span> BASE/<span style="color: #000000;">1004</span>  <span style="color: #00C800;">Class</span>: <span style="color: #ff0000;">'NIL'</span> has no exported <span style="color: #00C800;">method</span>: <span style="color: #000000;">EVAL</span></div>[/code:26qykd2r] [code=fw:26qykd2r]<div class="fw" id="{CB}" style="font-family: monospace;">@ <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw ;<br />    <span style="color: #0000ff;">OF</span> oWnd ;<br />    FOOTERS CELL<br /><br />oBrw:<span style="color: #000000;">oRs</span>:=oRecSet  <span style="color: #B900B9;">// ADO RecordSet</span><br /><span style="color: #00C800;">For</span> i:=<span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> len<span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#41;</span><br /><br />    <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span>Eval<span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bStrData</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>  <span style="color: #B900B9;">// Error occurs at this point</span><br /><br />    <span style="color: #B900B9;">// Trying to assign column back colour based on condition</span><br />    <span style="color: #00C800;">if</span> Eval<span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bStrData</span><span style="color: #000000;">&#41;</span> > aBranchTemp<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span><br />        oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bClrStd</span>:=<span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span>CLR_RED,CLR_GREEN<span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />    <span style="color: #00C800;">Endif</span><br /><span style="color: #00C800;">Next</span>  </div>[/code:26qykd2r] Regards Anser
xBrowse Back colour of a column based on the column value.
Please see the following sample code: [code=fw:176cgr90]<div class="fw" id="{CB}" style="font-family: monospace;">   @ <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">OF</span> oWnd ;<br />      COLUMNS <span style="color: #ff0000;">'col1'</span>, <span style="color: #ff0000;">'col2'</span> ;<br />      RECORDSET oRs CELL FOOTERS<br /><br />   oBrw:<span style="color: #000000;">Col2</span>:<span style="color: #000000;">bClrStd</span> := <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">Col2</span>:<span style="color: #000000;">Value</span> > n, <span style="color: #000000;">&#123;</span> CLR_BLACK, CLR_WHITE <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> CLR_WHITE,CLR_RED <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /> </div>[/code:176cgr90] The above code sets color of the column with header 'Col2' as { CLR_BLACK, CLR_WHITE } when the cell's value > n and otherwise to { CLR_WHITE, CLR_WHITE }. 1. Please avoid using :bStrData directly in your code either to assign or to find its value. Let us leave bStrData to be used by XBrowse internally. You may find some postings in these forums using bStrData directly. That kind of usage is very obsolete and results in (a) not using XBrowse to its full power and (b) problems like this. Instead use oCol:Value to find the cell's value. If we allow xBrowse to construct the browse for the recordset by specifying column names XBrowse takes care of all the values properly. In case we need set the codeblocks for a column ourselves, assign the codeblock to :bEditValue and the picture clause to :cEditPicture. XBrowse constructs internally bStrData to be something like { || Transform( Eval( oCol:bEditValue ), oCol:cEditPicture ) }. 2) Please also try to avoid using column numbers in our code. Column numbers change dynamically at runtime, when the user swaps columns. Even otherwise future mainenance of the code may become difficult when we change the order of columns or drop or add some columns in future versions. Instead better to refer to the column object by its header name as oBrw:oCol( <cHeader> ) or oBrw:<cHeader>. Code is more readable and also easier to maintain in future.
xBrowse Back colour of a column based on the column value.
Dear Mr.Rao, First of all let me thank you for providing a very detailed explanation and guidance on the proper usage of xBrowse. You are a real master of xBrowse. <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> Many novice users of FiveWin, like me may not be aware of the proper usage of the FiveWin Classes and fail to extract/utilize the 100% power out of these classes. I have very well noted all the points which you have suggested <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --> I shall test your suggestion tomorrow morning. I am creating recordset's columns dynamically based on the user's choice. For eg. the columns like ItemCode, ItemName will be the minimum columns in a recordset. After that the user has the choice to add columns further, for eg. Location1_Qty, Location2_Qty etc. . Based on the user's choice I generate the SQL statement dynamically and then the recordset. On the XBrowse's oBar, further I give choice to the user via a DbCombo to choose to display either the stock quantity or the stock value and the recordset is further recreated. For this reason I have referred xBrowse columns by col number. After reading your suggestions, I feel that I should redesign the way I have written the code. May I ask your advice. As I said above, I change the recordsets dynamically using the DbCombo on the xBrowse's oBar. When I change the contents of the recordset I loose all the column width settings, Column totals, oBrw:oSeek etc. and I have to re-do the settings again through a function. Is this the expected behavior or am I doing something wrong. The xBrowse is on a window and not on a dialog. Regards Anser
xBrowse Back colour of a column based on the column value.
Mr Anser I see that you want to allow the user to select the columns that are to be displayed. The approach you are adopting is that you are reading only those selected columns from the table. I agree that reading only the required columns against reading all columns from the table is theoretically faster than reading all the columns. But the difference in speeds and burden on the server or network traffic may not be perceptible in many cases of medium sized tables. I propose this approach: 1) Construct SQL and populate the recordset with all columns that the user has choice, leaving out the columns that are never to be shown in the browse. 2) Construct the browse with all columns, by using AUTOCOLS clause of XBROWSE command. 3) Hide columns that are not yet selected and show only columns that are anyway to be shown, ( oCol:lHide := .t. ) before activating the dialog / window. 4) Offer the user a combobox selection to display or hide the columns as per his choice. In fact you do not have to make this feature yourself. XBrowse has a built-in facility for this. If the user right clicks on headers, a menu appears with all the columns allowing him to hide and unhide the columns of his choice. Please try this feature by right clicking on any xbrowse header. If you offer this feature, this is the standard way for all browses accross the application. ( you can disable this feature by oBrw:lAllowColHiding := .f. ) Please test my approach and I am sure you will not be disappointed. You may also be surprised that you can write the entire module within less than half a page of code with all the interface you have in mind. You save the time to write the code and maintenance.
xBrowse Back colour of a column based on the column value.
Personal note to Mr Anser We live in nearby cities. If you don't mind, I would be glad to be in touch with you. My email id is <!-- e --><a href="mailto:nageswaragunupudi@gmail.com">nageswaragunupudi@gmail.com</a><!-- e --> and my phone is +91 9848046726. There could be a lot for us to learn from each other.
xBrowse Back colour of a column based on the column value.
Dear Mr.Rao, Thank you very much and glad to be in touch with you. I have send you an email Regards Anser
xBrowse Back colour of a column based on the column value.
Dear Mr.Rao, What would be the code to change the color of a cell based on the value of the cell. I made a mistake while raising the query. I asked the code to change the xBrowse back colour for a column, in fact my requirement was to change the back colour of a cell based on the value of the cell. I tried your above code. It is working fine but the whole column's back color is getting effected based on the 1st row's value of each column. Sorry for the confusion <!-- s:oops: --><img src="{SMILIES_PATH}/icon_redface.gif" alt=":oops:" title="Embarassed" /><!-- s:oops: --> Regards Anser
xBrowse Back colour of a column based on the column value.
Hi, Solved the issue [code=fw:cvqcp9yl]<div class="fw" id="{CB}" style="font-family: monospace;">oBrw:<span style="color: #000000;">bClrStd</span> := <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">Col2</span>:<span style="color: #000000;">Value</span> > n, <span style="color: #000000;">&#123;</span> CLR_BLACK, CLR_WHITE <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> CLR_WHITE,CLR_RED <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span></div>[/code:cvqcp9yl] I was using the alternative row colors (Pijama effect). Now I should find a simple way to display the xBrowse with alternative row colors (Pijama effect) and change only the back color of the cell to red only when a particular condition is met. Regards Anser
xBrowse Back colour of a column based on the column value.
Pajama Effect: [code=fw:negp1nv2]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oBrw:<span style="color: #000000;">bClrStd</span> := <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">KeyNo</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> % <span style="color: #000000;">2</span> == <span style="color: #000000;">0</span>, aClrPair1, aClrPair2 <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span></div>[/code:negp1nv2] Pajama Effect + Conditional [code=fw:negp1nv2]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oCol:<span style="color: #000000;">bClrStd</span> := <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> lCondition, aClrPair3, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">KeyNo</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> % <span style="color: #000000;">2</span> == <span style="color: #000000;">0</span>, &nbsp;aClrPair1, aClrPair2 <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span></div>[/code:negp1nv2]
xBrowse Back colour of a column based on the column value.
Dear Mr.Rao, Thank you. Solved the issue with similiar logic. I was just trying to make sure that there are no other methods to achieve the same and that I am following the right path. Many times we may not know that there exists some methods/tricks in xbrowse to achieve the same, and without knowing it we may complicate our code. Regards Anser
xBrowse Boxed Selected Row
Hi All, How to make selected row with solid box instead of cell? [url=http&#58;//s208&#46;photobucket&#46;com/user/fraxzi/media/FWxHarbour/Boxed_Row_zpssec6ghoo&#46;png&#46;html:293v51ox][img:293v51ox]http&#58;//i208&#46;photobucket&#46;com/albums/bb82/fraxzi/FWxHarbour/Boxed_Row_zpssec6ghoo&#46;png[/img:293v51ox][/url:293v51ox] <!-- s:?: --><img src="{SMILIES_PATH}/icon_question.gif" alt=":?:" title="Question" /><!-- s:?: -->
xBrowse Boxed Selected Row
Mr. Fraxi Where can I find your background image?, I like it. Regards
xBrowse Boxed Selected Row
[quote="Armando":2tobg1mx]Mr. Fraxi Where can I find your background image?, I like it. Regards[/quote:2tobg1mx] Hi Mr. Armando, I made it not so fancy.. <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> I used this for Dialog: [url=http&#58;//s208&#46;photobucket&#46;com/user/fraxzi/media/FWxHarbour/DialogBrush_zps1flqtxum&#46;png&#46;html:2tobg1mx][img:2tobg1mx]http&#58;//i208&#46;photobucket&#46;com/albums/bb82/fraxzi/FWxHarbour/DialogBrush_zps1flqtxum&#46;png[/img:2tobg1mx][/url:2tobg1mx] and this one for xBrowse: [url=http&#58;//s208&#46;photobucket&#46;com/user/fraxzi/media/FWxHarbour/BrowseBrush_zpszmaealwt&#46;png&#46;html:2tobg1mx][img:2tobg1mx]http&#58;//i208&#46;photobucket&#46;com/albums/bb82/fraxzi/FWxHarbour/BrowseBrush_zpszmaealwt&#46;png[/img:2tobg1mx][/url:2tobg1mx] feel free to use it as your brush background.
xBrowse Boxed Selected Row
This is not provided.
xBrowse Boxed Selected Row
Mr. Fraxzi: Thank you, very much. Regards