topic
stringlengths
1
63
text
stringlengths
1
577k
xBrowse and current column
Hi, is there any way to know what is the absolute number of the column ? Using the method oBrw:nColSel I can only know the number of the column based on the current display. Thanks Best Regards, Marco Turco
xBrowse and current column
Marco, Try this: oBrw:ColAtPos( oBrw:nColSel ):nCreationOrder
xBrowse and datas
Hi i have a xbrowse like this: oBrw := TXBrowse():New( oDlg ) oBrw:nMarqueeStyle := MARQSTYLE_HIGHLROW oBrw:CreateFromResource( 109 ) oBrw:nColDividerStyle := 5 //LINESTYLE_BLACK // COLUNAS oBrw:lColDividerComplete := .T. oBrw:nHeaderHeight :=30 oBrw:nStretchCol := STRETCHCOL_LAST oCol := oBrw:AddCol() oCol:bStrData := { || ARQEMP->SIGLA } oCol:cHeader := "SIGLA" oCol := oBrw:AddCol() oCol:bStrData := { || ARQEMP->FANTASIA } oCol:cHeader := "FANTASIA" oCol := oBrw:AddCol() oCol:bStrData := { || Substr(ARQEMP->CIDADE,1,28) } oCol:cHeader := "CIDADE" oCol := oBrw:AddCol() oCol:bStrData := { || ARQEMP->UF } oCol:cHeader := "UF" But they display just the same records in all browser area. If i put Sele ARQEMP and Set Order to 1 and Go Top before this definitions runs ok, but i use Dabase object how i set txbrowse alias with a Database object and how i link the columns? oCol:bStrData := { || oArqEmp:SIGLA } This is correct? Thanks in advance.
xBrowse and datas
Wanderson, [quote:34lo43ow]...but i use Dabase object how i set txbrowse alias with a Database object and how i link the columns? oCol:bStrData := { || oArqEmp:SIGLA } This is correct?[/quote:34lo43ow] Yes, your bStrData definition is correct. You must also tell TXBrowse that you are using a database object: oBrw:SetoDBF( oArqEmp ) May I suggest naming your database object after the realworld object, for example "oEmployees." This makes the code easier to read and understand, especially a year from now. Regards, James
xBrowse and datas
Please do not forget to specify the alias in the above case when you are coding for DBF. [code=fw:3l6fy8vi]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oBrw   := TXBrowse<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> oDlg <span style="color: #000000;">&#41;</span><br />oBrw:<span style="color: #000000;">cAlias</span> := <span style="color: #ff0000;">"ARQEMP"</span>   <span style="color: #B900B9;">// important</span><br /> </div>[/code:3l6fy8vi] Instead of coding oCol := oBrw:AddCol(), oBrw:bStrData := ... for each column, it is easier and more useful to code oBrw:SetRDD( lAddCols, lAutoSort, aFieldNames ) The entire above code can be written as: [code=fw:3l6fy8vi]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oBrw   := TXBrowse<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> oDlg <span style="color: #000000;">&#41;</span><br />WITH OBJECT oBrw<br />   <span style="color: #B900B9;">// If using DBF include these two lines</span><br />   :<span style="color: #000000;">cAlias</span> := <span style="color: #ff0000;">"ARQEMP"</span> <br />   :<span style="color: #000000;">SetRDD</span><span style="color: #000000;">&#40;</span> .f., .t., <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"SIGLA"</span>, <span style="color: #ff0000;">"FANTASIA"</span>, <span style="color: #ff0000;">"CIDADE"</span>, <span style="color: #ff0000;">"UF"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #B900B9;">// If using TDataBase object, include the following one line and remove the above 2 lines</span><br />   :<span style="color: #000000;">SetoDbf</span><span style="color: #000000;">&#40;</span> oArqEmp, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"SIGLA"</span>, <span style="color: #ff0000;">"FANTASIA"</span>, <span style="color: #ff0000;">"CIDADE"</span>, <span style="color: #ff0000;">"UF"</span> <span style="color: #000000;">&#125;</span>, .t. <span style="color: #000000;">&#41;</span><br />   <br />   <span style="color: #B900B9;">// next lines are common for both</span><br />   :<span style="color: #000000;">nColDividerStyle</span> := LINESTYLE_BLACK<br />   :<span style="color: #000000;">lColDividerComplete</span> := .t.<br />   :<span style="color: #000000;">nHeaderHeight</span> := <span style="color: #000000;">30</span><br />   :<span style="color: #000000;">nStretchCol</span>   := STRETCHCOL_LAST<br />   :<span style="color: #000000;">CreateFromResource</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">109</span> <span style="color: #000000;">&#41;</span><br />END<br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg<br />&nbsp;</div>[/code:3l6fy8vi]
xBrowse and datas
Rao, [quote:35kwwa0i] :SetoDbf( oArqEmp, { "SIGLA", "FANTASIA", "CIDADE", "UF" }, .t. )[/quote:35kwwa0i] When using the aCols parameter, how do you define colum titles that are different than the fieldnames. I'm guessing we have to assign them to each column? oBrw:aCols[ 2 ]:cHeader:="Whatever" Regards, James
xBrowse and datas
Thanks James works great!
xBrowse and datas
[quote="nageswaragunupudi":1gc5d8sb]Please do not forget to specify the alias in the above case when you are coding for DBF. [code=fw:1gc5d8sb]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oBrw   := TXBrowse<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> oDlg <span style="color: #000000;">&#41;</span><br />oBrw:<span style="color: #000000;">cAlias</span> := <span style="color: #ff0000;">"ARQEMP"</span>   <span style="color: #B900B9;">// important</span><br /> </div>[/code:1gc5d8sb] Instead of coding oCol := oBrw:AddCol(), oBrw:bStrData := ... for each column, it is easier and more useful to code oBrw:SetRDD( lAddCols, lAutoSort, aFieldNames ) The entire above code can be written as: [code=fw:1gc5d8sb]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oBrw   := TXBrowse<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> oDlg <span style="color: #000000;">&#41;</span><br />WITH OBJECT oBrw<br />   <span style="color: #B900B9;">// If using DBF include these two lines</span><br />   :<span style="color: #000000;">cAlias</span> := <span style="color: #ff0000;">"ARQEMP"</span> <br />   :<span style="color: #000000;">SetRDD</span><span style="color: #000000;">&#40;</span> .f., .t., <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"SIGLA"</span>, <span style="color: #ff0000;">"FANTASIA"</span>, <span style="color: #ff0000;">"CIDADE"</span>, <span style="color: #ff0000;">"UF"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #B900B9;">// If using TDataBase object, include the following one line and remove the above 2 lines</span><br />   :<span style="color: #000000;">SetoDbf</span><span style="color: #000000;">&#40;</span> oArqEmp, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"SIGLA"</span>, <span style="color: #ff0000;">"FANTASIA"</span>, <span style="color: #ff0000;">"CIDADE"</span>, <span style="color: #ff0000;">"UF"</span> <span style="color: #000000;">&#125;</span>, .t. <span style="color: #000000;">&#41;</span><br />   <br />   <span style="color: #B900B9;">// next lines are common for both</span><br />   :<span style="color: #000000;">nColDividerStyle</span> := LINESTYLE_BLACK<br />   :<span style="color: #000000;">lColDividerComplete</span> := .t.<br />   :<span style="color: #000000;">nHeaderHeight</span> := <span style="color: #000000;">30</span><br />   :<span style="color: #000000;">nStretchCol</span>   := STRETCHCOL_LAST<br />   :<span style="color: #000000;">CreateFromResource</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">109</span> <span style="color: #000000;">&#41;</span><br />END<br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg<br /> </div>[/code:1gc5d8sb][/quote:1gc5d8sb] Thanks G. N. Rao., but in this case why i set many diferents properties of columns like pictures, colors, fonts and others? Setting one bye one column is more flexible and clear or not?
xBrowse and empty array
Hi,the xBrowse crash when the array is empty. Is there any solution ? With the old tcbrowse all runs fine.Sample code:#include "FiveWin.ch"#include "xbrowse.ch"function Main() DEFINE BITMAP oGreen FILENAME "16green.bmp" DEFINE BITMAP oRed FILENAME "16red.bmp" aNames:=array(0,5) ** aadd(aNames,{1,"Marc1","4th Floor","Queens House",oRed}) ** aadd(aNames,{2,"Marc2","4th Floor","Queens House",oRed}) ** aadd(aNames,{3,"Marc3","4th Floor","Queens House",oGreen}) ** aadd(aNames,{4,"Marc4","4th Floor","Queens House",oGreen}) DEFINE dialog oDlg TITLE "xBrowse tests" FROM 5,5 TO 40,80 @1,1 XBROWSE oBrw ARRAY aNames of oDlg AUTOSORT ADD COLUMN TO XBROWSE oBrw DATA ARRAY ELEM 1; HEADER "Num" SIZE 30 LEFT order 2 ADD COLUMN TO XBROWSE oBrw DATA ARRAY ELEM 2; HEADER "Name" SIZE 80 order 2 oBrw:CreateFromCode() ACTIVATE dialog oDlg
xBrowse and empty array
Hello Marco,after creating a array, you have to add aempty element like => ASIZE( YOUR_ARRAY, 0 )otherwise you have a problem with xBrowseBest regards <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: --> Uwe
xBrowse and empty array
Hi Uwe,do you means something like this:aNames:=array(0,5) aadd(aNames,{"","","","","}) in order to add at least one record in the array ?
xBrowse and empty array
Hello Marco,yes, before you open xBrowse,you have to add 1 empty array-element.The function ASIZE works only with 1 dimension-arrays.A sample with 7 xbrowse-Rows and 2 Chars ( 2 Col's ).PRIVATE aBRCOLOR[7][2]aBRCOLOR[1] := { "1", "Black" }aBRCOLOR[2] := { "2", "White" }aBRCOLOR[3] := { "3", "Blue" }aBRCOLOR[4] := { "4", "Green" }aBRCOLOR[5] := { "5", "Red" }aBRCOLOR[6] := { "6", "Yellow" }aBRCOLOR[7] := { "7", "Magenta" }A empty array with 2 Chars ( 2 Col's ):aBRCOLOR := {}Before you open xBrowse !!!---------------------------------AADD( aBRCOLOR, { " ", " " } )Best regardsUwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
xBrowse and empty array
Marco,To start with the row should contain at least one row. XBrowse uses this row to examine and store information about datatype, default picture, default alignment, etc. Then from the ON INIT clause of the Dialog or Window, resize the array to 0.Example:[code:3yrkykhj] aNames&#58;=&#123;&#125; aadd&#40;aNames,&#123;1,"Marc","4th Floor","Queens House", 2 &#125;&#41; DEFINE dialog oDlg TITLE "xBrowse Empty Array" SIZE 600,300 PIXEL @ 10,10 XBROWSE oBrw COLUMNS 1, 2 ; HEADERS "Num", "Name" ; COLSIZES 30, 80 ; ARRAY aNames of oDlg SIZE 280,130 PIXEL AUTOSORT oBrw&#58;CreateFromCode&#40;&#41; ACTIVATE dialog oDlg ON INIT &#40; ASize&#40; aNames, 0 &#41; &#41; [/code:3yrkykhj]
xBrowse and images - Flags - A simple example
Good morning, here you are a simple simple of xBrowse and images. [img:2tjtefxp]http&#58;//imageshack&#46;com/a/img924/5606/Ewcouj&#46;png[/img:2tjtefxp] [code=fw:2tjtefxp]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><br /><span style="color: #00C800;">Function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   CountryTable<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">Function</span> CountryTable<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oDlgXls, oBrw, oFont<br />   <span style="color: #00C800;">local</span> aArray:= <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br />   <br />   aadd<span style="color: #000000;">&#40;</span> aArray, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"AD"</span>, <span style="color: #ff0000;">"ANDORRA"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   aadd<span style="color: #000000;">&#40;</span> aArray, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"AT"</span>, <span style="color: #ff0000;">"AUSTRIA"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   aadd<span style="color: #000000;">&#40;</span> aArray, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"BE"</span>, <span style="color: #ff0000;">"BELGICA"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   aadd<span style="color: #000000;">&#40;</span> aArray, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"BG"</span>, <span style="color: #ff0000;">"BULGARIA"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   aadd<span style="color: #000000;">&#40;</span> aArray, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"CZ"</span>, <span style="color: #ff0000;">"REPUBLICA CHECA"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   aadd<span style="color: #000000;">&#40;</span> aArray, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"DE"</span>, <span style="color: #ff0000;">"ALEMANIA"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   aadd<span style="color: #000000;">&#40;</span> aArray, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"DK"</span>, <span style="color: #ff0000;">"DINAMARCA"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   aadd<span style="color: #000000;">&#40;</span> aArray, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"EE"</span>, <span style="color: #ff0000;">"ESTONIA"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   aadd<span style="color: #000000;">&#40;</span> aArray, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"ES"</span>, <span style="color: #ff0000;">"ESPAÑA"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   aadd<span style="color: #000000;">&#40;</span> aArray, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"FI"</span>, <span style="color: #ff0000;">"FINLANDIA"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   aadd<span style="color: #000000;">&#40;</span> aArray, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"FR"</span>, <span style="color: #ff0000;">"FRANCIA"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   aadd<span style="color: #000000;">&#40;</span> aArray, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"GR"</span>, <span style="color: #ff0000;">"GRECIA"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   aadd<span style="color: #000000;">&#40;</span> aArray, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"HR"</span>, <span style="color: #ff0000;">"CROACIA"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   aadd<span style="color: #000000;">&#40;</span> aArray, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"HU"</span>, <span style="color: #ff0000;">"HUNGRIA"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   aadd<span style="color: #000000;">&#40;</span> aArray, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"IE"</span>, <span style="color: #ff0000;">"IRLANDA"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   aadd<span style="color: #000000;">&#40;</span> aArray, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"IT"</span>, <span style="color: #ff0000;">"ITALIA"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   aadd<span style="color: #000000;">&#40;</span> aArray, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"LT"</span>, <span style="color: #ff0000;">"LITUANIA"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   aadd<span style="color: #000000;">&#40;</span> aArray, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"LU"</span>, <span style="color: #ff0000;">"LUXEMBURGO"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   aadd<span style="color: #000000;">&#40;</span> aArray, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"LV"</span>, <span style="color: #ff0000;">"LETONIA"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   aadd<span style="color: #000000;">&#40;</span> aArray, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"MT"</span>, <span style="color: #ff0000;">"MALTA"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   aadd<span style="color: #000000;">&#40;</span> aArray, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"NL"</span>, <span style="color: #ff0000;">"HOLANDA"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <br />   aadd<span style="color: #000000;">&#40;</span> aArray, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"NO"</span>, <span style="color: #ff0000;">"NORUEGA"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   aadd<span style="color: #000000;">&#40;</span> aArray, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"PL"</span>, <span style="color: #ff0000;">"POLONIA"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   aadd<span style="color: #000000;">&#40;</span> aArray, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"PT"</span>, <span style="color: #ff0000;">"PORTUGAL"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   aadd<span style="color: #000000;">&#40;</span> aArray, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"RO"</span>, <span style="color: #ff0000;">"RUMANIA"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   aadd<span style="color: #000000;">&#40;</span> aArray, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"RS"</span>, <span style="color: #ff0000;">"SERBIA"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   aadd<span style="color: #000000;">&#40;</span> aArray, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"RU"</span>, <span style="color: #ff0000;">"RUSIA"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   aadd<span style="color: #000000;">&#40;</span> aArray, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"SE"</span>, <span style="color: #ff0000;">"SUECIA"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   aadd<span style="color: #000000;">&#40;</span> aArray, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"SI"</span>, <span style="color: #ff0000;">"ESLOVENIA"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   aadd<span style="color: #000000;">&#40;</span> aArray, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"SK"</span>, <span style="color: #ff0000;">"ESLOVAQUIA"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   aadd<span style="color: #000000;">&#40;</span> aArray, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"UA"</span>, <span style="color: #ff0000;">"UCRANIA"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   aadd<span style="color: #000000;">&#40;</span> aArray, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">""</span>, <span style="color: #ff0000;">"UK"</span>, <span style="color: #ff0000;">"REINO UNIDO"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   <br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">'Arial'</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-12</span> BOLD<br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlgXls <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">300</span>,<span style="color: #000000;">600</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">'Tabla paises'</span>  <br />      <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> oDlgXls columns <span style="color: #000000;">&#123;</span><span style="color: #000000;">1</span>,<span style="color: #000000;">2</span>,<span style="color: #000000;">3</span><span style="color: #000000;">&#125;</span> Array aArray sizes <span style="color: #000000;">&#123;</span><span style="color: #000000;">100</span>,<span style="color: #000000;">50</span>,<span style="color: #000000;">200</span><span style="color: #000000;">&#125;</span> HEADERS <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"BANDERA"</span>,<span style="color: #ff0000;">"SIM"</span>,<span style="color: #ff0000;">"PAIS"</span><span style="color: #000000;">&#125;</span> LINES CELL NOBORDER <span style="color: #0000ff;">AUTOCOLS</span> AUTOSORT<br />   <br />   oBrw:<span style="color: #000000;">nMarqueeStyle</span>              := <span style="color: #000000;">1</span><br />   oBrw:<span style="color: #000000;">nRowHeight</span>                 := <span style="color: #000000;">40</span><br />   <br />   WITH OBJECT oBrw<br />      :<span style="color: #000000;">nRowDividerStyle</span> = LINESTYLE_BLACK<br />      :<span style="color: #000000;">nColDividerStyle</span> = LINESTYLE_BLACK<br />      :<span style="color: #000000;">nMarqueeStyle</span> = MARQSTYLE_HIGHLROW<br />    END<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;">nEditType</span>       := TYPE_IMAGE<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;">lBmpStretch</span>     := .F.<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> := .F.<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;">bStrImage</span>       := <span style="color: #000000;">&#123;</span>|oCol, oBrw| oBrw:<span style="color: #000000;">aRow</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">2</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#125;</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;">nDataBmpAlign</span>   := AL_CENTER<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;">bAlphaLevel</span>     := <span style="color: #000000;">&#123;</span> | o | o:<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aRow</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">3</span> <span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#125;</span><br />      <br />   oDlgXls:<span style="color: #000000;">oClient</span>                    := oBrw<br />   oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />     <br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlgXls <span style="color: #0000ff;">CENTERED</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oDlgXls:<span style="color: #000000;">Resize</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">Return</span> <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /> </div>[/code:2tjtefxp] Source code and resource file at <!-- m --><a class="postlink" href="https://bitbucket.org/fivetech/fivewin-contributions/downloads/Flags.zip">https://bitbucket.org/fivetech/fivewin- ... /Flags.zip</a><!-- m --> It's a very simple simple. Regards
xBrowse and lFastEdit
Hello When you press ENTER (as the first key in a cell editable with lFastEdit on ) the cell is rehabilitated and we have to press ENTER again to confirm . Is it possible i this situation with ENTER key skip to the next cell after chek bValid , bOnPostEdit ? Regards Maurizio
xBrowse and lFastEdit
What you wanted is now possible with the revised build of 10.3 published today. Please review.
xBrowse and lFastEdit
Hello Nage I download FW 10.3 but xBrowse works like before . I check with SET CONFIRM ON and with SET CONFIRM OFF but doesn't work . Regards Maurizio
xBrowse and lFastEdit
Set oBrw:lEnter2Edit := .f. ( Default is TRUE ) Now pressing Enter key does not invoke edit. It goes to the next cell. Still edit can be invoked by pressing any valid key for FastEdit and also F2 key ( like in Excel ) However bValid also is skipped.
xBrowse and lFastEdit
Thank nageswaragunupudi With oBrw:lEnterKy2Edit := .f. it works. The problem now is that bValid is skipped. Maurizio
xBrowse and lFastEdit
bEditValid can be evaluated only when a Get is created. Actually bEditValid is called with paramters oGet and oCol, while exiting a Get. We need to choose either to jump the column or enter into Get. If you want to take some action when user moves from column to column, you can use bChange codeblock. Normally bChange codeblock is called when Row is changed. If we set oBrw:lColChangeNotify := .t., bChange is evaluated even when user moves from column to column, with .f. as parameter. oBrw:lColChangeNotify := .t. oBrw:bChange := { | lRowChange | If( lRowChange, <...>, <..colchangecode> ) }
xBrowse and lMergeVert
Hello Rao I use oCol:lMergeVert and oCol:WorkMergeData() to activate at runtime lMergeVert and it works fine , but is it possible to disable for other conditions? IF oBrw:oRs:Sort) == 'State' WITH OBJECT oBrw:State :lMergeVert := .t. :WorkMergeData() END ELSE // HOW DO YOU RESTORE WITHOUT lMergeVert ??? ENDIF Regards Maurizio
xBrowse and lMergeVert
[code=fw:1hc405dn]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// cancellation of vertical merge, if already merged</span><br /><span style="color: #00C800;">if</span> oCol:<span style="color: #000000;">lMergeVert</span><br />&nbsp; &nbsp;oCol:<span style="color: #000000;">lMergeVert</span> := .f.<br />&nbsp; &nbsp;oBrw:<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 />&nbsp;</div>[/code:1hc405dn]
xBrowse and lMergeVert
Thanks RAO it works very well . is it possible to have a sub total for each merge? Maurizio
xBrowse and lMergeVert
Possible, but you need to do more work. Please search the forums for samples I posted showing subtotals with mergecols. May I know if you are using ADO with MySql or MSSql or other database?
xBrowse and lMergeVert
I use ADO Maurizio
xBrowse and lMergeVert
[quote="Maurizio":3qdpfxhr]I use ADO Maurizio[/quote:3qdpfxhr] It is clear to me that you are using ADO. But with what database? MySQL or MSSQL or Oralce? what database? I am asking because SQL syntax can vary a little between different databases.
xBrowse and lMergeVert
I use Mysql Maurizio
xBrowse and lMergeVert sporadic error
If I use oBrw: lMergeVert =. t. appears sporadically error: Error BASE/1132 Bound error: array access Parameter : [ 1] = A { ... } [ 2] = N 6 Stack-List ---------- called by TXBRWCOLUMN:MERGEAREA(11782) called by TXBRWCOLUMN:PAINTCELL(10042) called by TXBRWCOLUMN:PAINTDATA(9668) called by TXBROWSE:PAINT(1474) called by TXBROWSE:DISPLAY(1288) called by TCONTROL:HANDLEEVENT(1690) called by TXBROWSE:HANDLEEVENT(11754) called by _FWH(3177) called by DIALOGBOX(0) called by TDIALOG:ACTIVATE(270) called by USTAZBR(133) called by (b)MAIN(277) called by TBTNBMP:CLICK(465) called by TBTNBMP:LBUTTONUP(656) called by TCONTROL:HANDLEEVENT(1714) called by TBTNBMP:HANDLEEVENT(1408) called by _FWH(3177) called by WINRUN(0) called by TMDIFRAME:ACTIVATE(990) called by MAIN(350) CPU type: Intel(R) Core(TM)2 Duo CPU E7400 @ 2.80GHz -412317 Mhz Hardware memory: 3327 MB ( available: 1732 MB ) Free System resources: 90 % GDI resources: 90 % User resources: 90 % Compiler version: xHarbour build 1.2.1 Intl. (SimpLex) (Rev. 9382) FiveWin Version: FWHX 12.08 Windows version: 6.1, Build 7601 Service Pack 1 Does anyone know the cause? Regards, Milos
xBrowse and lMergeVert sporadic error
This can happen if any row is added during runtime. If a row is added or deleted, we should call oCol:WorkMergeData() and oBrw:Refresh(). In case you are browsing DBF it is desirable to SET FILTER TO !DELETED() so that oBrw:keyNo() always returns a correct value.
xBrowse and lMergeVert sporadic error
I do not add row or delete it, if I try use oCol:WorkMergeData() I have a new error: Error BASE/1004 Class: 'NIL' has no exported method: EVAL Parameter : [ 1] = U Stack-List ---------- called by EVAL(0) called by TXBRWCOLUMN:WORKMERGEDATA(11714) called by USTAZBR(62) called by (b)MAIN(277) called by TBTNBMP:CLICK(465) called by TBTNBMP:LBUTTONUP(656) called by TCONTROL:HANDLEEVENT(1714) called by TBTNBMP:HANDLEEVENT(1408) called by _FWH(3177) called by WINRUN(0) called by TMDIFRAME:ACTIVATE(990) called by MAIN(350) Regards, Milos
xBrowse and lMergeVert sporadic error
Line 11714 is Eval( ::oBrw:bGoTop ) and this can not be NIL, unless this method is called before setting the browse completely. I hope when you call oCol:WorkMergeData, the browse is already visible on the screen.
xBrowse and lMergeVert sporadic error
This my code: [code=fw:15nvuwyu]<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;">"dtpicker.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"calendar.ch"</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> TestGrp<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">Private</span> mDatum, oBrwZbr<br /><br />USE RptStaZbr <span style="color: #00C800;">NEW</span> <br />  DBCREATEINDEX<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"RptStaZbr"</span>,<span style="color: #ff0000;">"Naziv"</span>,<span style="color: #000000;">&#123;</span>|| Naziv<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br /><br />USE Inf_Firma SHARED VIA <span style="color: #ff0000;">"SQLRDD"</span> <span style="color: #00C800;">NEW</span><br /><br />    DbSelectArea<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Inf_Firma"</span><span style="color: #000000;">&#41;</span><br /><br />        <span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> ! eof<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      <br />                cComp=Inf_Firma->Naziv<br />        cSta=Inf_Firma->Firma_Id+<span style="color: #ff0000;">"_STANJE"</span><br />        USE &cSta SHARED VIA <span style="color: #ff0000;">"SQLRDD"</span> <span style="color: #00C800;">NEW</span><br /><br />        DbSelectArea<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Inf_Firma"</span><span style="color: #000000;">&#41;</span><br />    <br />        skip<br />        <span style="color: #00C800;">enddo</span><br /><br />    mDatum    = date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />    mDTPicker = date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><br />  <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"NADANZBR"</span> <br /> <br />  <span style="color: #0000ff;">REDEFINE</span> CALENDAR oDTPicker <span style="color: #0000ff;">VAR</span> mDTPicker <span style="color: #0000ff;">ID</span> <span style="color: #000000;">4002</span>;<br />              <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> <span style="color: #000000;">&#40;</span>mDatum:= oDTPicker:<span style="color: #000000;">GetDate</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,oDatum:<span style="color: #0000ff;">refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #0000ff;">UPDATE</span><br /><br />  <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oDatum <span style="color: #0000ff;">VAR</span> mDatum <span style="color: #0000ff;">ID</span> <span style="color: #000000;">101</span> <span style="color: #0000ff;">OF</span> oDlg;<br />                <span style="color: #0000ff;">FONT</span> oFont <br /><br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oBrwZbr <span style="color: #0000ff;">ID</span> <span style="color: #000000;">4003</span> <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"RptStaZbr"</span> ;<br />        <span style="color: #0000ff;">FONT</span> oFontBrw;<br />        <span style="color: #0000ff;">OF</span> oDlg <br /><br /><br />       oCol := oBrwZbr:<span style="color: #000000;">AddCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />       oCol:<span style="color: #000000;">bStrData</span>  := <span style="color: #000000;">&#123;</span> || RptStaZbr->Naziv<span style="color: #000000;">&#125;</span><br />       oCol:<span style="color: #000000;">cHeader</span>   := <span style="color: #ff0000;">"Naziv"</span><br />       oCol:<span style="color: #000000;">nWidth</span>    := <span style="color: #000000;">220</span><br />       oCol:<span style="color: #000000;">nHeadStrAlign</span> := AL_CENTER<br />       oCol:<span style="color: #000000;">nDataStrAlign</span> := AL_LEFT<br />       oCol:<span style="color: #000000;">oDataFont</span> := oFontBrw<br />       oCol:<span style="color: #000000;">lMergeVert</span> := .t.<br />   *        oCol:<span style="color: #000000;">WorkMergeData</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />       oCol := oBrwZbr:<span style="color: #000000;">AddCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />       oCol:<span style="color: #000000;">bStrData</span>  := <span style="color: #000000;">&#123;</span> || RptStaZbr->Banka<span style="color: #000000;">&#125;</span><br />       oCol:<span style="color: #000000;">cHeader</span>   := <span style="color: #ff0000;">"Banka"</span><br />       oCol:<span style="color: #000000;">nWidth</span>    := <span style="color: #000000;">200</span><br />       oCol:<span style="color: #000000;">nHeadStrAlign</span> := AL_CENTER<br />       oCol:<span style="color: #000000;">nDataStrAlign</span> := AL_LEFT<br />       oCol:<span style="color: #000000;">oDataFont</span> := oFontBrw<br /><br />       oCol := oBrwZbr:<span style="color: #000000;">AddCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />       oCol:<span style="color: #000000;">bStrData</span>  := <span style="color: #000000;">&#123;</span> || RptStaZbr->Racun<span style="color: #000000;">&#125;</span><br />       oCol:<span style="color: #000000;">cHeader</span>   := <span style="color: #ff0000;">"Ra?un"</span><br />       oCol:<span style="color: #000000;">nWidth</span>    := <span style="color: #000000;">140</span><br />       oCol:<span style="color: #000000;">nHeadStrAlign</span> := AL_CENTER<br />       oCol:<span style="color: #000000;">nDataStrAlign</span> := AL_LEFT<br />       oCol:<span style="color: #000000;">oDataFont</span> := oFontBrw<br /><br />       oCol:= oBrwZbr:<span style="color: #000000;">AddCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />       oCol:<span style="color: #000000;">bEditValue</span> := <span style="color: #000000;">&#123;</span> || RptStaZbr->Iznos <span style="color: #000000;">&#125;</span><br />       oCol:<span style="color: #000000;">cEditPicture</span> := <span style="color: #ff0000;">'@E 999,999,999.99'</span><br />       oCol:<span style="color: #000000;">cHeader</span>   := <span style="color: #ff0000;">"Iznos"</span><br />       oCol:<span style="color: #000000;">bClrHeader</span>    := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">255</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">203</span>, <span style="color: #000000;">225</span>, <span style="color: #000000;">252</span> <span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">255</span>, <span style="color: #000000;">220</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />       oCol:<span style="color: #000000;">bClrFooter</span>    := <span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span> RGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">255</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">203</span>, <span style="color: #000000;">225</span>, <span style="color: #000000;">252</span> <span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">255</span>, <span style="color: #000000;">255</span>, <span style="color: #000000;">220</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />       oCol:<span style="color: #000000;">bClrGrad</span> :=<span style="color: #000000;">&#123;</span> || <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#123;</span> <span style="color: #000000;">0.4</span> , nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">160</span>, <span style="color: #000000;">160</span> <span style="color: #000000;">&#41;</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">180</span>, <span style="color: #000000;">180</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>,<span style="color: #000000;">&#123;</span> <span style="color: #000000;">0.6</span>, nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">180</span>, <span style="color: #000000;">180</span> <span style="color: #000000;">&#41;</span>,nRGB<span style="color: #000000;">&#40;</span> <span style="color: #000000;">0</span>, <span style="color: #000000;">160</span>, <span style="color: #000000;">160</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br />       oCol:<span style="color: #000000;">nHeadStrAlign</span> := AL_CENTER<br />       oCol:<span style="color: #000000;">nDataStrAlign</span> := AL_RIGHT<br />       oCol:<span style="color: #000000;">nFootStrAlign</span> := AL_RIGHT<br />       oCol:<span style="color: #000000;">nWidth</span>        := <span style="color: #000000;">110</span><br />       oCol:<span style="color: #000000;">lTotal</span>        := .t.<br />       oCol:<span style="color: #000000;">nTotal</span>        := <span style="color: #000000;">0</span><br />       oCol:<span style="color: #000000;">oDataFont</span> := oFontBrw<br /><br />       oCol := oBrwZbr:<span style="color: #000000;">AddCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />       oCol:<span style="color: #000000;">AddResource</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"OFF"</span><span style="color: #000000;">&#41;</span><br />       oCol:<span style="color: #000000;">AddResource</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"ON"</span><span style="color: #000000;">&#41;</span><br />       oCol:<span style="color: #000000;">cHeader</span>   := <span style="color: #ff0000;">" "</span><br />       oCol:<span style="color: #000000;">bBmpData</span>  := <span style="color: #000000;">&#123;</span> || iif<span style="color: #000000;">&#40;</span> RptStaZbr->Iznos < <span style="color: #000000;">0</span> ,<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 />       oCol:<span style="color: #000000;">oDataFont</span> := oFontBrw<br /><br /><br />           oBrwZbr:<span style="color: #000000;">lMergeVert</span>          := .t. <br />       oBrwZbr:<span style="color: #000000;">nMarqueeStyle</span>       := <span style="color: #000000;">0</span><br />       oBrwZbr:<span style="color: #000000;">nColDividerStyle</span>    := LINESTYLE_BLACK<br />       oBrwZbr:<span style="color: #000000;">nHeaderHeight</span>       := <span style="color: #000000;">26</span><br />       oBrwZbr:<span style="color: #000000;">lColDividerComplete</span> := .t.<br />       oBrwZbr:<span style="color: #000000;">nRowDividerStyle</span>    := LINESTYLE_BLACK<br />       oBrwZbr:<span style="color: #000000;">nHeaderLines</span>        := <span style="color: #000000;">1</span><br />       oBrwZbr:<span style="color: #000000;">nFooterLines</span>        := <span style="color: #000000;">1</span><br />       oBrwZbr:<span style="color: #000000;">nDataLines</span>          := <span style="color: #000000;">1</span><br />       oBrwZbr:<span style="color: #000000;">lFooter</span>             := .t.<br />     <br /><br />       <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> oBtnDal <span style="color: #0000ff;">ID</span> <span style="color: #000000;">18</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />            <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Dalje"</span> <span style="color: #0000ff;">LEFT</span> <span style="color: #000000;">2007</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">" &Primeni "</span>;<br />            <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span>TestZbr<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,oBrwZbr:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,oBrwZbr:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,oBrwZbr:<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: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> oBtnIzl <span style="color: #0000ff;">ID</span> <span style="color: #000000;">11</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />            <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Izlaz"</span> <span style="color: #0000ff;">LEFT</span> <span style="color: #000000;">2007</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"   &Izlaz  "</span>;<br />            <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span>DBcloseAll<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,oDlg:<span style="color: #000000;">end</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br />  <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span>TestZbr<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,oBrwZbr:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,oBrwZbr:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,oBrwZbr:<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 /><br />DbCloseAll<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> TestZbr<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> nErr<br /><br />    DBSelectArea<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"RptStaZbr"</span><span style="color: #000000;">&#41;</span><br />     zap<br /><br />        DbSelectArea<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Inf_Firma"</span><span style="color: #000000;">&#41;</span><br />        DbGoTop<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />            <span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> ! eof<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />              mFirma_Id=Inf_Firma->Firma_Id<br />          <br />                cSta=Inf_Firma->Firma_Id+<span style="color: #ff0000;">"_STANJE"</span><br /><br />                   nErr := oSql:<span style="color: #000000;">exec</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"SELECT Inf_Firma. Naziv, &cSta .Racun_Id, &cSta .Banka, &cSta .Racun, &cSta .Iznos"</span>+;<br />                        <span style="color: #ff0000;">" FROM Inf_Firma, &cSta"</span>+;<br />                        <span style="color: #ff0000;">" WHERE &cSta .Datum='"</span> + dtos<span style="color: #000000;">&#40;</span>mDatum<span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"'"</span>+;<br />                        <span style="color: #ff0000;">" AND Inf_Firma. Firma_Id = '"</span> + mFirma_Id + <span style="color: #ff0000;">"'"</span>+;<br />                        <span style="color: #ff0000;">" GROUP BY Inf_Firma. Naziv, &cSta .Racun_Id, &cSta .Racun, &cSta .Iznos, &cSta .Banka"</span>,,.t.,,<span style="color: #ff0000;">"RptStaZbr.dbf"</span><span style="color: #000000;">&#41;</span><br /><br />            DbSelectArea<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Inf_Firma"</span><span style="color: #000000;">&#41;</span><br />        <br /><br />            skip<br />            <span style="color: #00C800;">enddo</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span></div>[/code:15nvuwyu] What I quickly choose the date and press oBtnDal possibility of a mistake is higher. The error occurs when executing commands oBrwZbr:SetFocus(). Regards, Milos
xBrowse and lMergeVert sporadic error
When you use SQLRDD, OrdKeyNo() does not work. Consequently oBrw:KeyNo always returns 0. The feature of MergeVert does not work for SQLRDD. If you use SQLRDD you can do basic browsing and many advanced features of xbrowse are not available.
xBrowse and menu
[code=fw:1vesg6up]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oBrw:<span style="color: #000000;">bPopup</span> := <span style="color: #000000;">&#123;</span> |oCol| MyPopMenuFunction<span style="color: #000000;">&#40;</span> oCol <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp;</div>[/code:1vesg6up] The "MyPopMenuFunction( oCol )" should return a PopMenu object. The parameter oCol is the currently selected column. Right-clicking on any column opens the popup menu just below the current cell.. If you want to implement this only for a specific column then [code=fw:1vesg6up]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oCol:<span style="color: #000000;">bPopup</span> := <span style="color: #000000;">&#123;</span> |oCol| MyPopMenuFunction<span style="color: #000000;">&#40;</span> oCol <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp;</div>[/code:1vesg6up] In this case, right-click on that column only activates the popup menu. For implementation sample, please see \fwh\samples\testxbr3.prg
xBrowse and menu
Dear Mr. Nages, Is it possible to show a menu with several options when clicking on a field in a row? Thank you. Best regards
xBrowse and menu
Hi, And what about bLClicked? I need to show the menu in this event, but it does not work. The menu does not show up. If you need, I can build a sample code. Thank you.
xBrowse and menu
Try with this code [code=fw:1nf1r29m]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bLClicked</span> &nbsp; &nbsp; &nbsp; &nbsp; := <span style="color: #000000;">&#123;</span> | nR, nC, nF | MyPopupMnu<span style="color: #000000;">&#40;</span> oBrw, nR, nC <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />.../...<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">Function</span> MyPopupMnu<span style="color: #000000;">&#40;</span> o, nRow, nCol <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oMnu<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">MENU</span> oMnu <span style="color: #0000ff;">POPUP</span> <br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Option 1"</span> &nbsp; &nbsp;<span style="color: #0000ff;">ACTION</span> <span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">&#40;</span> o:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">ClassName</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">SEPARATOR</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Exit"</span> <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"close"</span> <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> o:<span style="color: #000000;">oWnd</span>:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ENDMENU</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">MENU</span> oMnu <span style="color: #00C800;">AT</span> nRow, nCol <span style="color: #0000ff;">OF</span> o:<span style="color: #000000;">oWnd</span><br /><br /><span style="color: #00C800;">Return</span> oMnu<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br />&nbsp;</div>[/code:1nf1r29m]
xBrowse and menu
My advice works with right-click. We advise you not to use single click for any action because single click is used for navigation Right click and popup menu is a standard user interface
xBrowse and menu
my solution on left mouseclick using a defined style connected to the cell ( radio, combo, listbox, fieldedit, dateselection ... ) [img:1m1wkdvt]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Leftclick1&#46;jpg[/img:1m1wkdvt] more samples radio and listbox [img:1m1wkdvt]http&#58;//www&#46;pflegeplus&#46;com/IMAGES/Leftclick2&#46;jpg[/img:1m1wkdvt] regards Uwe <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
xBrowse and menu
Thank you Cristóbal, works perfect!!!
xBrowse and nStretchCol
Hello I note that nStretchCol works well if I have to extend a column , but If I need to reduce doesn't work . this is the xbgrpsum.prg adjusted that explain the problem [code=fw:2epbh03f]<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> oDlg, oBrw, oFont, oBold<br />   <span style="color: #00C800;">local</span> aData := Array<span style="color: #000000;">&#40;</span> <span style="color: #000000;">4</span>, <span style="color: #000000;">5</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">local</span> i, j<br /><br />   <span style="color: #00C800;">for</span> i := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">4</span><br />      aData<span style="color: #000000;">&#91;</span> i <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#93;</span> := <span style="color: #ff0000;">'Prod-'</span> + Chr<span style="color: #000000;">&#40;</span><span style="color: #000000;">64</span>+i<span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">for</span> j := <span style="color: #000000;">2</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">5</span><br />         aData<span style="color: #000000;">&#91;</span> i <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span> j <span style="color: #000000;">&#93;</span> := <span style="color: #0000ff;">Round</span><span style="color: #000000;">&#40;</span> hb_Random<span style="color: #000000;">&#40;</span> <span style="color: #000000;">100</span>, <span style="color: #000000;">999</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">next</span> j<br />   <span style="color: #00C800;">next</span> i<br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">'TAHOMA'</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-12</span><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oBold <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">'TAHOMA'</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-12</span> BOLD<br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">700</span>,<span style="color: #000000;">300</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFont ;<br />      <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">'FWH 10.4 Group Totals'</span><br /><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> ;<br />      HEADERS <span style="color: #ff0000;">'Product'</span>, <span style="color: #ff0000;">'USA'</span>, <span style="color: #ff0000;">'Canada'</span>, <span style="color: #ff0000;">'UK'</span>, <span style="color: #ff0000;">'Spain'</span> ;<br />      ARRAY aData CELL LINES NOBORDER FASTEDIT FOOTERS ;<br />      <br />   AEval<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aCols</span>, <span style="color: #000000;">&#123;</span> |o| o:<span style="color: #000000;">nEditType</span> := EDIT_GET <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   AEval<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aCols</span>, <span style="color: #000000;">&#123;</span> |o| o:<span style="color: #000000;">nWidth</span> := <span style="color: #000000;">100</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br /><br />   WITH OBJECT oBrw<br />      <span style="color: #B900B9;">// Make Groups</span><br />      :<span style="color: #000000;">SetGroupHeader</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'Americas'</span>, <span style="color: #000000;">2</span>, <span style="color: #000000;">3</span>, oBold <span style="color: #000000;">&#41;</span><br />      :<span style="color: #000000;">SetGroupHeader</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'Europe'</span>,   <span style="color: #000000;">4</span>, <span style="color: #000000;">5</span>, oBold <span style="color: #000000;">&#41;</span><br />      :<span style="color: #000000;">lAllowColReGroup</span> := .t.  <span style="color: #B900B9;">// columns can be moved accross groups</span><br />      <span style="color: #B900B9;">// Group totals</span><br />      :<span style="color: #000000;">SetGroupTotal</span><span style="color: #000000;">&#40;</span>  <span style="color: #ff0000;">'Americas'</span>, <span style="color: #ff0000;">'Total'</span> <span style="color: #000000;">&#41;</span><br />      :<span style="color: #000000;">SetGroupTotal</span><span style="color: #000000;">&#40;</span>  <span style="color: #ff0000;">'Europe'</span>,   <span style="color: #ff0000;">'Total'</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #B900B9;">// Grand Total</span><br />      :<span style="color: #000000;">SetGroupTotal</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">'Americas_Total'</span>,  <span style="color: #ff0000;">'Europe_Total'</span> <span style="color: #000000;">&#125;</span>, <span style="color: #ff0000;">'Grand'</span> + CRLF + <span style="color: #ff0000;">'Total'</span>, AGGR_SUM, oBold <span style="color: #000000;">&#41;</span><br />   END<br /><br />   <span style="color: #B900B9;">// Set pictures, totals in footers</span><br />   AEval<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aCols</span>, <span style="color: #000000;">&#123;</span> |o| o:<span style="color: #000000;">cEditPicture</span> := <span style="color: #ff0000;">'99,999.99'</span>, ;<br />                            o:<span style="color: #000000;">nFooterType</span> := AGGR_SUM,     ;<br />                            o:<span style="color: #000000;">bOnChange</span> := <span style="color: #000000;">&#123;</span> || oBrw:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,oBrw:<span style="color: #000000;">RefreshFooters</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span><br />   oBrw:<span style="color: #000000;">Product</span>:<span style="color: #000000;">cFooter</span> := <span style="color: #ff0000;">'Total'</span><br /><br />   oBrw:<span style="color: #000000;">nStretchCol</span>     := <span style="color: #000000;">1</span><br />   oBrw:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br /><br />   <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont, oBold<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /> </div>[/code:2epbh03f] Regards Maurizio <!-- w --><a class="postlink" href="http://www.nipeservice.com">www.nipeservice.com</a><!-- w -->
xBrowse and national characters - bKeyChar method
We have in Poland few signs of alphabet more then in English language. To put it on qwerty keyboard we have to press ALT+letter simmilar to wanted char. example: ALT+A = &#260; (ASCII 165) In TSBrowse I used bKeyChar method oBRWR:bKeyChar:={|nKEY,nFLAG| JAKIRRCHAR(nKEY,nFLAG) } Method bKeyDown always have returned 65 Method bKeyChar returned 165 I tried to use bKeyChar with xBrowse, but for me it doesn't work. Is this possible to use this method with xBrowse? Regards Robert
xBrowse and national characters - bKeyChar method
Robert, CLASS TXBrowse is not processing bKeyChar, you may need to include it: [code:299g1a2e] METHOD KeyChar&#40; nKey &#41; CLASS TXBrowse if &#58;&#58;bKeyChar != nil Eval&#40; &#58;&#58;bKeyChar, nKey, nFlags &#41; endif &#46;&#46;&#46; [/code:299g1a2e]
xBrowse and national characters - bKeyChar method
Antonio I don't like to think about it every new version. Is it possible to put it permanently to next version of xBrowse and FWH? January is close to us <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->))) Robert
xBrowse and national characters - bKeyChar method
Robert, Yes, we already included it for FWH 8.01 <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
xBrowse and national characters - bKeyChar method
Thank You Robert
xBrowse and new blank row ( MySql )
Hi, Simply to add new record I was using dialog window with needful controls . But xBrowse , it seems , have possibilities to do that directly . Mine experience with xBrowse is in beginning , so I'm asking to share with a small sample how to add to xBrowse a new blank row and , validating it , insert it . Thanks in advance !
xBrowse and new blank row ( MySql )
Excuse my English, use google translator, not sure if this is what you want ... this example is billing, Greetings ... [code=fw:1w9ze55c]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">// EMPIEZA xBROWSE FACTURA...</span><br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">xBrowse</span> oBrw <span style="color: #0000ff;">ID</span> <span style="color: #000000;">100</span> <span style="color: #0000ff;">of</span> oDlg ;<br />      COLUMNS <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span>, <span style="color: #000000;">3</span>, <span style="color: #000000;">4</span>, <span style="color: #000000;">5</span>, <span style="color: #000000;">6</span>, <span style="color: #000000;">7</span> ;<br />      ARRAY aItems FASTEDIT LINES<br /><br /><span style="color: #B900B9;">// CONFIGURACION DEL xBROWSE</span><br />   WITH OBJECT oBrw<br />      :<span style="color: #000000;">nColDividerStyle</span> := LINESTYLE_BLACK<br />      :<span style="color: #000000;">nStretchCol</span>      := STRETCHCOL_LAST<br />      :<span style="color: #000000;">bRClicked</span> := <span style="color: #000000;">&#123;</span> || <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"pulsastes boton derecho..."</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />      :<span style="color: #000000;">lColDividerComplete</span> := .t.<br />      :<span style="color: #000000;">nHeaderHeight</span> := <span style="color: #000000;">30</span> <span style="color: #B900B9;">// ANCHO CABEZERA</span><br />      :<span style="color: #000000;">l2007</span> := .t.<br />      :<span style="color: #000000;">lFooter</span> := .t.<br />      :<span style="color: #000000;">lRecordSelector</span> := .f.<br />      :<span style="color: #000000;">lAllowColHiding</span> := .f.<br />      :<span style="color: #000000;">lAllowColSwapping</span> := .f.<br />      :<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;">nArrayAt</span> % <span style="color: #000000;">2</span> == <span style="color: #000000;">0</span>, <span style="color: #000000;">&#123;</span>CLR_BLACK, CLR_WHITE<span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span><span style="color: #000000;">0</span>, RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">203</span>, <span style="color: #000000;">226</span>, <span style="color: #000000;">254</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />      :<span style="color: #000000;">bKeyDown</span> := <span style="color: #000000;">&#123;</span>| nKey | teclado<span style="color: #000000;">&#40;</span> nKey, oBrw, aVar, aGet, oDlg <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #B900B9;">// CONTROLA VIRTUAL KEY</span><br />   END WITH<br /><br /><span style="color: #B900B9;">// COL.1 - CODIGO PRODUCTO</span><br />   WITH OBJECT 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><br />      :<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"CODIGO"</span><br />      :<span style="color: #000000;">nWidth</span>  := <span style="color: #000000;">100</span><br />      :<span style="color: #000000;">nDataStrAlign</span> := AL_LEFT<br />      :<span style="color: #000000;">bStrData</span> := <span style="color: #000000;">&#123;</span>|| IIF<span style="color: #000000;">&#40;</span> LEN<span style="color: #000000;">&#40;</span> aItems <span style="color: #000000;">&#41;</span> = <span style="color: #000000;">0</span>, SPACE<span style="color: #000000;">&#40;</span><span style="color: #000000;">10</span><span style="color: #000000;">&#41;</span> ,;<br />                            aItems<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nArrayAt</span>, <span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />      :<span style="color: #000000;">cEditPicture</span> := <span style="color: #ff0000;">"@!"</span><br /><br />        :<span style="color: #000000;">nEditType</span>    := EDIT_GET_BUTTON<br /><br />      :<span style="color: #000000;">bEditBlock</span> := <span style="color: #000000;">&#123;</span>|| leecodigo<span style="color: #000000;">&#40;</span> oQryInv, , <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"inv_codiarti"</span>, <span style="color: #ff0000;">"inv_nombrearti"</span><span style="color: #000000;">&#125;</span> ,;<br />                                    <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"Código"</span>, <span style="color: #ff0000;">"Nombre"</span><span style="color: #000000;">&#125;</span>, oBrw, aItems, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />      :<span style="color: #000000;">bEditValid</span> := <span style="color: #000000;">&#123;</span>| oGet | buscacodigo<span style="color: #000000;">&#40;</span> oGet:<span style="color: #000000;">value</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, oBrw, aItems ,;<br />                                    oQryInv, <span style="color: #ff0000;">"inv_codiarti"</span> ,;<br />                                    <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"inv_codiarti"</span>, <span style="color: #ff0000;">"inv_nombrearti"</span><span style="color: #000000;">&#125;</span> ,;<br />                                    <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"Código"</span>, <span style="color: #ff0000;">"Nombre"</span><span style="color: #000000;">&#125;</span>, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />        :<span style="color: #000000;">bOnPostEdit</span> := <span style="color: #000000;">&#123;</span> | oCol, xVal, nKey | <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> nKey <> VK_ESCAPE .and. !EMPTY<span style="color: #000000;">&#40;</span> xVal <span style="color: #000000;">&#41;</span> ,;<br />                                               <span style="color: #000000;">&#40;</span> oCol:<span style="color: #000000;">value</span> := xVal ,;<br />                                               oBrw:<span style="color: #000000;">SelectCol</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">3</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><br />      :<span style="color: #000000;">bLClickHeader</span> := <span style="color: #000000;">&#123;</span> || alert<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"pulsaste boton izq.sobre cabecera col."</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />      :<span style="color: #000000;">cToolTip</span> := <span style="color: #ff0000;">"usando ToolTips..."</span><br /><br />   END WITH<br /><br /><span style="color: #B900B9;">// COL.2 - NOMBRE/DESCRIPCION</span><br />   WITH OBJECT 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><br />      :<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"DESCRIPCION"</span><br />      :<span style="color: #000000;">nWidth</span>  := <span style="color: #000000;">200</span><br />      :<span style="color: #000000;">nDataStrAlign</span> := AL_LEFT<br />      :<span style="color: #000000;">bStrData</span> := <span style="color: #000000;">&#123;</span>|| IIF<span style="color: #000000;">&#40;</span> LEN<span style="color: #000000;">&#40;</span> aItems <span style="color: #000000;">&#41;</span> = <span style="color: #000000;">0</span>, SPACE<span style="color: #000000;">&#40;</span><span style="color: #000000;">10</span><span style="color: #000000;">&#41;</span> ,;<br />                            aItems<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nArrayAt</span>, <span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />      :<span style="color: #000000;">nEditType</span>      := EDIT_BUTTON <span style="color: #B900B9;">// EDIT_GET // EDIT_GET_LISTBOX</span><br /><br />   END WITH<br /><br /><span style="color: #B900B9;">// COL.3 - UNIDAD</span><br />   WITH OBJECT 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><br />      :<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"U/G/O"</span><br />      :<span style="color: #000000;">nWidth</span>  := <span style="color: #000000;">70</span><br />      :<span style="color: #000000;">cEditPicture</span> := <span style="color: #ff0000;">"@!"</span><br />      :<span style="color: #000000;">nDataStrAlign</span> := AL_CENTER<br />      :<span style="color: #000000;">bStrData</span>      := <span style="color: #000000;">&#123;</span>|| IIF<span style="color: #000000;">&#40;</span> LEN<span style="color: #000000;">&#40;</span> aItems <span style="color: #000000;">&#41;</span> = <span style="color: #000000;">0</span>, SPACE<span style="color: #000000;">&#40;</span><span style="color: #000000;">10</span><span style="color: #000000;">&#41;</span> ,;<br />                           aItems<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nArrayAt</span>, <span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />      :<span style="color: #000000;">cFooter</span>       := <span style="color: #ff0000;">"ITEMS =>"</span><br />      :<span style="color: #000000;">nFootStrAlign</span> := AL_RIGHT<br />        :<span style="color: #000000;">nEditType</span>     := EDIT_GET<br />      :<span style="color: #000000;">bEditWhen</span>     := <span style="color: #000000;">&#123;</span>|| <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> EMPTY<span style="color: #000000;">&#40;</span> aItems<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nArrayAt</span>, <span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span>, .f., .t. <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />        :<span style="color: #000000;">bOnPostEdit</span>   := <span style="color: #000000;">&#123;</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey <> VK_ESCAPE ,;<br />                                                 <span style="color: #000000;">&#40;</span> oCol:<span style="color: #000000;">value</span>:= xVal <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />   END WITH<br /><br /><span style="color: #B900B9;">// COL.4 - CANTIDAD</span><br />   WITH OBJECT 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><br />      :<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"CANTIDAD"</span><br />      :<span style="color: #000000;">nWidth</span>  := <span style="color: #000000;">70</span><br />      :<span style="color: #000000;">nDataStrAlign</span> := AL_RIGHT<br />      :<span style="color: #000000;">bStrData</span>      := <span style="color: #000000;">&#123;</span>|| IIF<span style="color: #000000;">&#40;</span> LEN<span style="color: #000000;">&#40;</span> aItems <span style="color: #000000;">&#41;</span> = <span style="color: #000000;">0</span>, SPACE<span style="color: #000000;">&#40;</span><span style="color: #000000;">10</span><span style="color: #000000;">&#41;</span> ,;<br />                        TRANSFORM<span style="color: #000000;">&#40;</span> aItems<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nArrayAt</span>, <span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span>, <span style="color: #ff0000;">"@E 9,999,999"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />      :<span style="color: #000000;">nFootStrAlign</span> := AL_RIGHT <span style="color: #B900B9;">// ALINEA DATA FOOTER</span><br />      :<span style="color: #000000;">lTotal</span>        := .t. <span style="color: #B900B9;">// PARA TOTALIZAR COL.</span><br />      :<span style="color: #000000;">nTotal</span>        := <span style="color: #000000;">0</span> <span style="color: #B900B9;">// PARA TOTALIZAR COL.</span><br />      :<span style="color: #000000;">nFooterType</span>   := AGGR_SUM <span style="color: #B900B9;">// PARA TOTALIZAR COL.</span><br />        :<span style="color: #000000;">nEditType</span>     := EDIT_GET<br />      :<span style="color: #000000;">bEditValid</span>    := <span style="color: #000000;">&#123;</span> | oGet, oCol | mayorqcero<span style="color: #000000;">&#40;</span> oGet:<span style="color: #000000;">value</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />        :<span style="color: #000000;">bOnPostEdit</span>   := <span style="color: #000000;">&#123;</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey <> VK_ESCAPE ,;<br />                                                 <span style="color: #000000;">&#40;</span> oCol:<span style="color: #000000;">value</span>:= xVal <span style="color: #000000;">&#41;</span> , <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />      :<span style="color: #000000;">bEditWhen</span>     := <span style="color: #000000;">&#123;</span>|| !EMPTY<span style="color: #000000;">&#40;</span> aItems<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nArrayAt</span>, <span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />   END WITH<br /><br /><span style="color: #B900B9;">// COL.5 - PVP</span><br />   WITH OBJECT 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><br />      :<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"COSTO"</span><br />      :<span style="color: #000000;">nWidth</span>  := <span style="color: #000000;">70</span><br />      :<span style="color: #000000;">nDataStrAlign</span> := AL_RIGHT<br />*      :<span style="color: #000000;">bStrData</span>      := <span style="color: #000000;">&#123;</span>|| IIF<span style="color: #000000;">&#40;</span> LEN<span style="color: #000000;">&#40;</span> aItems <span style="color: #000000;">&#41;</span> = <span style="color: #000000;">0</span>, SPACE<span style="color: #000000;">&#40;</span><span style="color: #000000;">10</span><span style="color: #000000;">&#41;</span> ,;<br />*                        TRANSFORM<span style="color: #000000;">&#40;</span> aItems<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nArrayAt</span>, <span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span>, <span style="color: #ff0000;">"@E 9,999,999.99"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />      :<span style="color: #000000;">bStrData</span>      := <span style="color: #000000;">&#123;</span>|| IIF<span style="color: #000000;">&#40;</span> LEN<span style="color: #000000;">&#40;</span> aItems <span style="color: #000000;">&#41;</span> = <span style="color: #000000;">0</span>, SPACE<span style="color: #000000;">&#40;</span><span style="color: #000000;">10</span><span style="color: #000000;">&#41;</span> ,;<br />                                 aItems<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nArrayAt</span>, <span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />      :<span style="color: #000000;">cEditPicture</span>  := <span style="color: #ff0000;">"@E 9,999,999.99"</span><br />      :<span style="color: #000000;">nFootStrAlign</span> := AL_RIGHT<br />        :<span style="color: #000000;">nEditType</span>     := EDIT_GET<br />      :<span style="color: #000000;">bEditBlock</span>   := <span style="color: #000000;">&#123;</span> || alert<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Seleccionar Varios Precios..."</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />      :<span style="color: #000000;">bEditValid</span>    := <span style="color: #000000;">&#123;</span> | oGet, oCol | mayorqcero<span style="color: #000000;">&#40;</span> oGet:<span style="color: #000000;">value</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />        :<span style="color: #000000;">bOnPostEdit</span>   := <span style="color: #000000;">&#123;</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey <> VK_ESCAPE ,;<br />                                                 <span style="color: #000000;">&#40;</span> oCol:<span style="color: #000000;">value</span> := xVal ,;<br />                                                   totalinea<span style="color: #000000;">&#40;</span> oBrw, aVar, aGet, aLote <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />      :<span style="color: #000000;">bEditWhen</span>     := <span style="color: #000000;">&#123;</span>|| !EMPTY<span style="color: #000000;">&#40;</span> aItems<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nArrayAt</span>, <span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />   END WITH<br /><br /><span style="color: #B900B9;">// COL.6 - % DESCUENTO</span><br />   WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">6</span><span style="color: #000000;">&#93;</span><br />      :<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"DESC"</span><br />      :<span style="color: #000000;">nWidth</span>  := <span style="color: #000000;">70</span><br />      :<span style="color: #000000;">nDataStrAlign</span> := AL_RIGHT<br />      :<span style="color: #000000;">bStrData</span>     := <span style="color: #000000;">&#123;</span>|| IIF<span style="color: #000000;">&#40;</span> LEN<span style="color: #000000;">&#40;</span> aItems <span style="color: #000000;">&#41;</span> = <span style="color: #000000;">0</span>, SPACE<span style="color: #000000;">&#40;</span><span style="color: #000000;">10</span><span style="color: #000000;">&#41;</span> ,;<br />                        TRANSFORM<span style="color: #000000;">&#40;</span> aItems<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nArrayAt</span>, <span style="color: #000000;">6</span><span style="color: #000000;">&#93;</span>, <span style="color: #ff0000;">"@E 999.99 %"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />      :<span style="color: #000000;">cFooter</span>      := <span style="color: #ff0000;">"SUB-TOTAL=>"</span><br />        :<span style="color: #000000;">nEditType</span>    := EDIT_GET<br />      :<span style="color: #000000;">bEditValid</span>   := <span style="color: #000000;">&#123;</span> | oGet, oCol | <span style="color: #00C800;">IF</span><span style="color: #000000;">&#40;</span> menorqcero<span style="color: #000000;">&#40;</span> oGet:<span style="color: #000000;">value</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ,;<br />                                            menorqcien<span style="color: #000000;">&#40;</span> oGet:<span style="color: #000000;">value</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>, .f. <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />        :<span style="color: #000000;">bOnPostEdit</span>   := <span style="color: #000000;">&#123;</span> | oCol, xVal, nKey | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> nKey <> VK_ESCAPE ,;<br />                                                 <span style="color: #000000;">&#40;</span> oCol:<span style="color: #000000;">value</span> := xVal ,;<br />                                                   totalinea<span style="color: #000000;">&#40;</span> oBrw, aVar, aGet, aLote <span style="color: #000000;">&#41;</span> ,;<br />                                                   addrow<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> , <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />      :<span style="color: #000000;">bEditWhen</span>    := <span style="color: #000000;">&#123;</span>|| !EMPTY<span style="color: #000000;">&#40;</span> aItems<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nArrayAt</span>, <span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> .and. ;<br />                           aItems<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nArrayAt</span>, <span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span> > <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span><br />   END WITH<br /><br /><span style="color: #B900B9;">// COL.7 - TOTAL LINEA</span><br />   WITH OBJECT oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">7</span><span style="color: #000000;">&#93;</span><br />      :<span style="color: #000000;">cHeader</span> := <span style="color: #ff0000;">"SUB-TOTAL"</span><br />      :<span style="color: #000000;">nWidth</span>  := <span style="color: #000000;">70</span><br />      :<span style="color: #000000;">nDataStrAlign</span> := AL_RIGHT<br />      :<span style="color: #000000;">bStrData</span>      := <span style="color: #000000;">&#123;</span>|| IIF<span style="color: #000000;">&#40;</span> LEN<span style="color: #000000;">&#40;</span> aItems <span style="color: #000000;">&#41;</span> = <span style="color: #000000;">0</span>, SPACE<span style="color: #000000;">&#40;</span><span style="color: #000000;">10</span><span style="color: #000000;">&#41;</span> ,;<br />                        TRANSFORM<span style="color: #000000;">&#40;</span> aItems<span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nArrayAt</span>, <span style="color: #000000;">7</span><span style="color: #000000;">&#93;</span>, <span style="color: #ff0000;">"@E 9,999,999.99"</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />      :<span style="color: #000000;">nFootStrAlign</span> := AL_RIGHT <span style="color: #B900B9;">// ALINEA DATA FOOTER</span><br />      :<span style="color: #000000;">lTotal</span>        := .t. <span style="color: #B900B9;">// PARA TOTALIZAR COL.</span><br />      :<span style="color: #000000;">nTotal</span>        := <span style="color: #000000;">0</span> <span style="color: #B900B9;">// PARA TOTALIZAR COL.</span><br />      :<span style="color: #000000;">nFooterType</span>   := AGGR_SUM   <span style="color: #B900B9;">// PARA TOTALIZAR COL.</span><br />      :<span style="color: #000000;">cToolTip</span> := <span style="color: #ff0000;">"Columna 7"</span><br /><br />   END WITH<br /><br />   oBrw:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /> </div>[/code:1w9ze55c] funcion addrow [code=fw:1w9ze55c]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">STATIC</span> PROCEDURE addrow<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// ADICIONO REGISTRO</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> LEN<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aArrayData</span> <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; oBrw:<span style="color: #000000;">GoBottom</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> oBrw:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">&#91;</span> oBrw:<span style="color: #000000;">nArrayAt</span>, <span style="color: #000000;">7</span><span style="color: #000000;">&#93;</span> > <span style="color: #000000;">0</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AADD<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aArrayData</span> ,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#123;</span> , , <span style="color: #ff0000;">"U"</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">ELSE</span><br />&nbsp; &nbsp; &nbsp; AADD<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aArrayData</span> ,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span> , , <span style="color: #ff0000;">"U"</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">SetPos</span><span style="color: #000000;">&#40;</span> , <span style="color: #000000;">1</span>, <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// MUEVE PUNTO A COL.1</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>; oBrw:<span style="color: #000000;">GoBottom</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>; oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">RETURN</span></div>[/code:1w9ze55c] funcion delrow [code=fw:1w9ze55c]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">STATIC</span> PROCEDURE delrow<span style="color: #000000;">&#40;</span> oBrw, aVar, aGet <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// ELIMINO REGISTRO</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> LEN<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aArrayData</span> <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MSGINFO</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"No hay Registro(s) para Eliminar..."</span>, oDatos:<span style="color: #000000;">cTitMsg</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">RETURN</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> MSGNOYES<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Seguro Desea ELIMINAR el Registro: "</span> + ;<br />&nbsp; &nbsp; &nbsp; ALLTRIM<span style="color: #000000;">&#40;</span> cValToChar<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nArrayAt</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: #ff0000;">" ?"</span>, oDatos:<span style="color: #000000;">cTitMsg</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">IF</span> oBrw:<span style="color: #000000;">nLen</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ADEL<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aArrayData</span>, oBrw:<span style="color: #000000;">nArrayAt</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ASIZE<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aArrayData</span>, oBrw:<span style="color: #000000;">nLen</span> - <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">GOTOP</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;netopagar<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">7</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nTotal</span>, aVar, aGet <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// CALCULA NETO PAGAR</span><br /><br /><span style="color: #00C800;">RETURN</span></div>[/code:1w9ze55c] funcion totalinea [code=fw:1w9ze55c]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">STATIC</span> PROCEDURE totalinea<span style="color: #000000;">&#40;</span> oBrw, aVar, aGet, aLote <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// TOTAL POR RENGLON CON Y SIN DESC.</span><br /><br /><br />*? aLote<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span>, aLote<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span>, aLote<span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span>, aLote<span style="color: #000000;">&#91;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span><br /><br /><span style="color: #B900B9;">// TOTAL = CANTIDAD * PRECIO</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nArrayAt</span>, <span style="color: #000000;">7</span><span style="color: #000000;">&#93;</span> := ;<br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nArrayAt</span>, <span style="color: #000000;">4</span><span style="color: #000000;">&#93;</span> * oBrw:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nArrayAt</span>, <span style="color: #000000;">5</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">// TOTAL = TOTAL - MTO.DESCUENTO</span><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nArrayAt</span>, <span style="color: #000000;">7</span><span style="color: #000000;">&#93;</span> := ;<br />&nbsp; &nbsp; &nbsp; &nbsp;oBrw:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nArrayAt</span>, <span style="color: #000000;">7</span><span style="color: #000000;">&#93;</span> - ;<br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nArrayAt</span>, <span style="color: #000000;">7</span><span style="color: #000000;">&#93;</span> * oBrw:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nArrayAt</span>, <span style="color: #000000;">6</span><span style="color: #000000;">&#93;</span> / <span style="color: #000000;">100</span> <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">// AGREGO DATOS DEL LOTE AL FINAL DEL REGISTRO</span><br />&nbsp; &nbsp;<span style="color: #00C800;">IF</span> LEN<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nArrayAt</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> < <span style="color: #000000;">8</span> .and. aLote <> <span style="color: #00C800;">NIL</span><span style="color: #B900B9;">//LEN( aLote ) > 0</span><br />&nbsp; &nbsp; &nbsp; AADD<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nArrayAt</span><span style="color: #000000;">&#93;</span>, aLote<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: #B900B9;">// cod.lote</span><br />&nbsp; &nbsp; &nbsp; AADD<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nArrayAt</span><span style="color: #000000;">&#93;</span>, aLote<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: #B900B9;">// fch.exp.</span><br />&nbsp; &nbsp; &nbsp; AADD<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nArrayAt</span><span style="color: #000000;">&#93;</span>, aLote<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: #B900B9;">// fch.ven.</span><br />&nbsp; &nbsp; &nbsp; AADD<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aArrayData</span><span style="color: #000000;">&#91;</span>oBrw:<span style="color: #000000;">nArrayAt</span><span style="color: #000000;">&#93;</span>, aLote<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: #B900B9;">// pvp</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">ENDIF</span><br /><br />&nbsp; &nbsp;oBrw:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;netopagar<span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">7</span><span style="color: #000000;">&#93;</span>:<span style="color: #000000;">nTotal</span>, aVar, aGet <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// CALCULA NETO PAGAR</span><br /><br /><span style="color: #00C800;">RETURN</span></div>[/code:1w9ze55c] funcion netopagar [code=fw:1w9ze55c]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">STATIC</span> PROCEDURE netopagar<span style="color: #000000;">&#40;</span> nSTotal, aVar, aGet <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// CALCULA NETO PAGAR</span><br /><span style="color: #B900B9;">//</span><br /><span style="color: #B900B9;">// aVar[3] -> % DESC.GENERAL</span><br /><span style="color: #B900B9;">// aVar[13]-> % IVA</span><br /><span style="color: #B900B9;">// aVar[14]-> MTO.DESC.SOBRE MTO.BRUTO</span><br /><span style="color: #B900B9;">// aVar[15]-> MTO.EXENTO</span><br /><span style="color: #B900B9;">// aVar[16]-> MTO.BRUTO-EXCENTO(sobre lo q se aplica IVA)</span><br /><span style="color: #B900B9;">// aVar[17]-> MTO.BRUTO</span><br /><span style="color: #B900B9;">// aVar[18]-> MTO.TOT.DESC.</span><br /><span style="color: #B900B9;">// aVar[19]-> MTO.IVA</span><br /><span style="color: #B900B9;">// aVar[20]-> MTO.NETO PAGAR</span><br /><span style="color: #B900B9;">//</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">LOCAL</span> nFor := <span style="color: #000000;">0</span><br /><br />&nbsp; &nbsp;aVar<span style="color: #000000;">&#91;</span><span style="color: #000000;">17</span><span style="color: #000000;">&#93;</span> := nSTotal <span style="color: #B900B9;">// MTO.SIN IVA NI DESCUENTO</span><br />&nbsp; &nbsp;aVar<span style="color: #000000;">&#91;</span><span style="color: #000000;">18</span><span style="color: #000000;">&#93;</span> := aVar<span style="color: #000000;">&#91;</span><span style="color: #000000;">14</span><span style="color: #000000;">&#93;</span> + <span style="color: #000000;">&#40;</span> aVar<span style="color: #000000;">&#91;</span><span style="color: #000000;">17</span><span style="color: #000000;">&#93;</span> * aVar<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;">100</span> <span style="color: #B900B9;">// MTO.DESCUENTO GENERAL</span><br />&nbsp; &nbsp;aVar<span style="color: #000000;">&#91;</span><span style="color: #000000;">16</span><span style="color: #000000;">&#93;</span> := aVar<span style="color: #000000;">&#91;</span><span style="color: #000000;">17</span><span style="color: #000000;">&#93;</span> - aVar<span style="color: #000000;">&#91;</span><span style="color: #000000;">18</span><span style="color: #000000;">&#93;</span> - aVar<span style="color: #000000;">&#91;</span><span style="color: #000000;">15</span><span style="color: #000000;">&#93;</span> <span style="color: #B900B9;">// MTO.SOBRE EL CUAL SE APLICA IVA(bruto-desc.-exce.)</span><br />&nbsp; &nbsp;aVar<span style="color: #000000;">&#91;</span><span style="color: #000000;">19</span><span style="color: #000000;">&#93;</span> := <span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> aVar<span style="color: #000000;">&#91;</span><span style="color: #000000;">17</span><span style="color: #000000;">&#93;</span>-aVar<span style="color: #000000;">&#91;</span><span style="color: #000000;">18</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> * aVar<span style="color: #000000;">&#91;</span><span style="color: #000000;">13</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> / <span style="color: #000000;">100</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// MTO.IVA SEGUN TASA ACTIVA</span><br />&nbsp; &nbsp;aVar<span style="color: #000000;">&#91;</span><span style="color: #000000;">20</span><span style="color: #000000;">&#93;</span> := <span style="color: #000000;">&#40;</span> aVar<span style="color: #000000;">&#91;</span><span style="color: #000000;">17</span><span style="color: #000000;">&#93;</span> - aVar<span style="color: #000000;">&#91;</span><span style="color: #000000;">18</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> + aVar<span style="color: #000000;">&#91;</span><span style="color: #000000;">19</span><span style="color: #000000;">&#93;</span> <span style="color: #B900B9;">// NETO A PAGAR</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">FOR</span> nFor := <span style="color: #000000;">14</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">20</span><br />&nbsp; &nbsp; &nbsp; aGet<span style="color: #000000;">&#91;</span>nFor<span style="color: #000000;">&#93;</span>:<span style="color: #0000ff;">REFRESH</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">NEXT</span><br /><br /><span style="color: #00C800;">RETURN</span></div>[/code:1w9ze55c]
xBrowse and new blank row ( MySql )
[quote="Rimantas":3vw54t8p]Hi, Simply to add new record I was using dialog window with needful controls . But xBrowse , it seems , have possibilities to do that directly . Mine experience with xBrowse is in beginning , so I'm asking to share with a small sample how to add to xBrowse a new blank row and , validating it , insert it . Thanks in advance ![/quote:3vw54t8p] Can be done, but a bit complex. Let us also keep in mind that this is not based on a phantom row concept but is based on appending a new physical record and later deleting it if not filled by the user. When the user tries to go past the last row, xbrowse evaluates oBrw:bPastEof. It is in this codeblock we need to write the code for creating a new row. Let me give here parts of the relevant code. I am assuming a DBF table but the logic can be applied to other tables also. ( Handling arrays is a lot more simple ) [code=fw:3vw54t8p]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">static</span>  nAppendRow  := <span style="color: #000000;">0</span> <span style="color: #B900B9;">// Empty when no row is being appended</span><br /><br />< .... your code <span style="color: #0000ff;">to</span> open <span style="color: #00C800;">data</span> and create xbrowe ... ><br /><br />oBrw:<span style="color: #000000;">bPastEof</span> := <span style="color: #000000;">&#123;</span> || AppendRow<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</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;">bOnChange</span> := <span style="color: #000000;">&#123;</span> || nAppendRow := <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span><br />  <span style="color: #B900B9;">// when the user enters a valid data in this key column, we consider the row as valid.</span><br /><br />oBrw:<span style="color: #000000;">bChange</span> := <span style="color: #000000;">&#123;</span> || OnChangeRow<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />< .... other code ....><br /><br /><span style="color: #B900B9;">//-------------</span><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> AppendRow<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">if</span> Empty<span style="color: #000000;">&#40;</span> nAppendRow <span style="color: #000000;">&#41;</span>   <span style="color: #B900B9;">// add only if no append is pending</span><br />   <br />      <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbAppend<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, nAppendRow := RecNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// similar code for mysql too</span><br />      oBrw:<span style="color: #000000;">GoBottom</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      oBrw:<span style="color: #000000;">GoLeftMost</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      oBrw:<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 />   <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><span style="color: #B900B9;">//------------</span><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> OnChamgeRow<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> nSaveRow<br /><br />   <span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">&#40;</span> nAppendRow <span style="color: #000000;">&#41;</span> .and. nAppendRow != <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> RecNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   <br />      nSaveRow    := <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> RecNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbGoTo<span style="color: #000000;">&#40;</span> nAppendRow <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">if</span> Empty<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> FieldGet<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>   <span style="color: #B900B9;">// or check for any other important field</span><br />         <span style="color: #B900B9;">// user did not enter any useful info in the record</span><br />         <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbDelete<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />         <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbGoTo<span style="color: #000000;">&#40;</span> nSaveRow <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />         oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">else</span><br />         <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbGoTo<span style="color: #000000;">&#40;</span> nSaveRow <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">endif</span><br />      nAppendRow     := <span style="color: #000000;">0</span>  <span style="color: #B900B9;">// Not any more in append mode</span><br />   <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><span style="color: #B900B9;">//------------</span><br /> </div>[/code:3vw54t8p] Once you understand the above comcept, you can implement this approach in any situation.
xBrowse and new blank row ( MySql )
[quote="nageswaragunupudi":17zgn7wk][quote="Rimantas":17zgn7wk]Hi, Simply to add new record I was using dialog window with needful controls . But xBrowse , it seems , have possibilities to do that directly . Mine experience with xBrowse is in beginning , so I'm asking to share with a small sample how to add to xBrowse a new blank row and , validating it , insert it . Thanks in advance ![/quote:17zgn7wk] Can be done, but a bit complex. Let us also keep in mind that this is not based on a phantom row concept but is based on appending a new physical record and later deleting it if not filled by the user. When the user tries to go past the last row, xbrowse evaluates oBrw:bPastEof. It is in this codeblock we need to write the code for creating a new row. Let me give here parts of the relevant code. I am assuming a DBF table but the logic can be applied to other tables also. ( Handling arrays is a lot more simple ) [code=fw:17zgn7wk]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">static</span>  nAppendRow  := <span style="color: #000000;">0</span> <span style="color: #B900B9;">// Empty when no row is being appended</span><br /><br />< .... your code <span style="color: #0000ff;">to</span> open <span style="color: #00C800;">data</span> and create xbrowe ... ><br /><br />oBrw:<span style="color: #000000;">bPastEof</span> := <span style="color: #000000;">&#123;</span> || AppendRow<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</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;">bOnChange</span> := <span style="color: #000000;">&#123;</span> || nAppendRow := <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span><br />  <span style="color: #B900B9;">// when the user enters a valid data in this key column, we consider the row as valid.</span><br /><br />oBrw:<span style="color: #000000;">bChange</span> := <span style="color: #000000;">&#123;</span> || OnChangeRow<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />< .... other code ....><br /><br /><span style="color: #B900B9;">//-------------</span><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> AppendRow<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">if</span> Empty<span style="color: #000000;">&#40;</span> nAppendRow <span style="color: #000000;">&#41;</span>   <span style="color: #B900B9;">// add only if no append is pending</span><br />   <br />      <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbAppend<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, nAppendRow := RecNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// similar code for mysql too</span><br />      oBrw:<span style="color: #000000;">GoBottom</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      oBrw:<span style="color: #000000;">GoLeftMost</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      oBrw:<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 />   <br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><span style="color: #B900B9;">//------------</span><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> OnChamgeRow<span style="color: #000000;">&#40;</span> oBrw <span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> nSaveRow<br /><br />   <span style="color: #00C800;">if</span> ! Empty<span style="color: #000000;">&#40;</span> nAppendRow <span style="color: #000000;">&#41;</span> .and. nAppendRow != <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> RecNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   <br />      nSaveRow    := <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> RecNo<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbGoTo<span style="color: #000000;">&#40;</span> nAppendRow <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">if</span> Empty<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> FieldGet<span style="color: #000000;">&#40;</span> <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>   <span style="color: #B900B9;">// or check for any other important field</span><br />         <span style="color: #B900B9;">// user did not enter any useful info in the record</span><br />         <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbDelete<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />         <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbGoTo<span style="color: #000000;">&#40;</span> nSaveRow <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />         oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">else</span><br />         <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">cAlias</span> <span style="color: #000000;">&#41;</span>-><span style="color: #000000;">&#40;</span> DbGoTo<span style="color: #000000;">&#40;</span> nSaveRow <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">endif</span><br />      nAppendRow     := <span style="color: #000000;">0</span>  <span style="color: #B900B9;">// Not any more in append mode</span><br />   <span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><span style="color: #B900B9;">//------------</span><br /> </div>[/code:17zgn7wk] Once you understand the above comcept, you can implement this approach in any situation.[/quote:17zgn7wk] Many thanks to you , Rao ! I'll try that . With best regards !
xBrowse and oBrw:ToExcel() to Rao
Hello Rao , When I have an xBrowse with a column :aEditListTxt and I need export :ToExcel() , the fields with :aEditListTxt are exported as a value and not with the field in :aEditListTxt [code=fw:33t6skkp]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br />REQUEST DBFCDX<br /><br /><span style="color: #00C800;">function</span> xbtest<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> aStates<br />   <span style="color: #00C800;">local</span> oDlg, oBrw, oFont<br /><br />   RDDSETDEFAULT<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"DBFCDX"</span> <span style="color: #000000;">&#41;</span><br /><br />   USE STATES SHARED<br />   aStates  := FW_DbfToArray<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   CLOSE STATES<br /><br />   USE CUSTOMER SHARED<br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</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;">700</span>,<span style="color: #000000;">400</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL <span style="color: #0000ff;">FONT</span> oFont<br /><br />   @ <span style="color: #000000;">20</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-20</span>,<span style="color: #000000;">-20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />      DATASOURCE <span style="color: #ff0000;">"CUSTOMER"</span> ;<br />      COLUMNS <span style="color: #ff0000;">"First"</span>, <span style="color: #ff0000;">"City"</span>, <span style="color: #ff0000;">"State"</span> ;<br />      CELL LINES NOBORDER FASTEDIT<br /><br />   WITH OBJECT oBrw<br />      :<span style="color: #000000;">nEditTypes</span>    := EDIT_GET<br />      WITH OBJECT :<span style="color: #000000;">State</span><br />         :<span style="color: #000000;">nEditType</span>     := EDIT_LISTBOX<br />         :<span style="color: #000000;">aEditListTxt</span>  := aStates<br />      END<br />      <span style="color: #B900B9;">//</span><br />      :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   END<br />   oDlg:<span style="color: #000000;">bStart</span> := <span style="color: #000000;">&#123;</span>|| oBrw:<span style="color: #000000;">ToExcel</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>  <br /><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;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /> </div>[/code:33t6skkp] I found a solution I wanted to ask Rao if it is possible to integrate it into xBrowse (if it is correct) [code=fw:33t6skkp]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br /><span style="color: #00C800;">METHOD</span> ClpRow<span style="color: #000000;">&#40;</span> lFullRow, aCols, lFormatted <span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> TXBrowse<br /><br />....<br /><br /><span style="color: #00C800;">if</span> lFullRow<br />      <span style="color: #00C800;">for</span> n := <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> Len<span style="color: #000000;">&#40;</span> aCols <span style="color: #000000;">&#41;</span><br />         <span style="color: #00C800;">if</span> lFormatted<br />            <span style="color: #00C800;">if</span> aCols<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">bStrData</span> == <span style="color: #00C800;">nil</span><br />               RetVal   += <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ValType<span style="color: #000000;">&#40;</span> u := aCols<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">'L'</span>, <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> u, <span style="color: #ff0000;">"True"</span>, <span style="color: #ff0000;">"False"</span> <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span> + Chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">9</span> <span style="color: #000000;">&#41;</span><br />            <span style="color: #00C800;">else</span><br />               RetVal += StrTran<span style="color: #000000;">&#40;</span> StrTran<span style="color: #000000;">&#40;</span> aCols<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">StrData</span>, CRLF, <span style="color: #ff0000;">" ; "</span> <span style="color: #000000;">&#41;</span>, Chr<span style="color: #000000;">&#40;</span><span style="color: #000000;">9</span><span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">' '</span> <span style="color: #000000;">&#41;</span> + Chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">9</span> <span style="color: #000000;">&#41;</span><br />            <span style="color: #00C800;">endif</span><br />         <span style="color: #00C800;">else</span><br />            <span style="color: #B900B9;">//-------------------------------------------------------------------------------------------</span><br />            <span style="color: #B900B9;">// My modi </span><br />      <br />            <span style="color: #00C800;">IF</span> HB_IsArray<span style="color: #000000;">&#40;</span>aCols<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">aEditListTXT</span> <span style="color: #000000;">&#41;</span> .and. len<span style="color: #000000;">&#40;</span>aCols<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">aEditListTXT</span> <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span> <br />               RetVal += cValToChar<span style="color: #000000;">&#40;</span> aCols<span style="color: #000000;">&#91;</span>n<span style="color: #000000;">&#93;</span>:<span style="color: #000000;">StrData</span> <span style="color: #000000;">&#41;</span>  + Chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">9</span> <span style="color: #000000;">&#41;</span><br />            <span style="color: #00C800;">ELSE</span> <br />               RetVal += aCols<span style="color: #000000;">&#91;</span> n <span style="color: #000000;">&#93;</span>:<span style="color: #000000;">ClpText</span> + Chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">9</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;">next</span><br />   <span style="color: #00C800;">else</span><br />      RetVal := ::<span style="color: #000000;">SelectedCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">ClpText</span><br />      <br />            <br />   <span style="color: #00C800;">endif</span><br /><br /><br />.... <br /><br /><br /><br /> </div>[/code:33t6skkp] Regards Maurizio
xBrowse and report problem
So far I have used fwh 12.08 and xHarbour build 1.2.1 now I just moved to a new version fwhh15.07. I use an application xBrowse and oBrw: report ("name" ...). With the transition to the new version Fivewin report no longer works. Program after the formation page just gets blocked. Please help. Regards, Milos
xBrowse and report problem
method report() is working for us. We can not comment unless we have a sample program which we can compile at our end and test where it fails.
xBrowse and report problem
This is code: [code=fw:16myjr7n]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">function</span> BrowRJ<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />         <span style="color: #00C800;">Local</span> oDlgBrow<br />     <span style="color: #00C800;">Private</span> oBrw,mPolje:=<span style="color: #ff0000;">"Bez filtera"</span>,mFilter,mRadFil:=<span style="color: #000000;">1</span>,oRadFil<br /><br />DBSelectArea<span style="color: #000000;">&#40;</span>cCompany+<span style="color: #ff0000;">"_RadJed"</span><span style="color: #000000;">&#41;</span><br />   OrdSetFocus<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"RadJed_naz"</span><span style="color: #000000;">&#41;</span><br /><br /> aStruct := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"RadJed_Id"</span>,<span style="color: #ff0000;">"C"</span>,<span style="color: #000000;">3</span>,<span style="color: #000000;">0</span><span style="color: #000000;">&#125;</span>,;<br />            <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"Naziv"</span>,<span style="color: #ff0000;">"C"</span>,<span style="color: #000000;">30</span>,<span style="color: #000000;">0</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><br /><br />   dbCreate<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"TEMPODE"</span>, aStruct <span style="color: #000000;">&#41;</span><br /><br /><br />      USE TEMPODE <span style="color: #00C800;">NEW</span><br /><br /><br />  nErr := oSql:<span style="color: #000000;">exec</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"SELECT * FROM "</span> + cRadJed,,.t.,,<span style="color: #ff0000;">"TempOde.dbf"</span><span style="color: #000000;">&#41;</span><br /><br />  <span style="color: #00C800;">if</span> nErr != <span style="color: #000000;">0</span><br />    <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Greška pri upitu"</span>,<span style="color: #ff0000;">"Greška"</span><span style="color: #000000;">&#41;</span><br />  <span style="color: #00C800;">endif</span><br />      <br />         <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlgBrow  <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"xPregled"</span>;<br />                <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"SPISAK RADNIH JEDINICA"</span><br />       <br /><br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">ID</span> <span style="color: #000000;">101</span> <span style="color: #0000ff;">ALIAS</span> <span style="color: #ff0000;">"TempOde"</span> ;<br />                <span style="color: #0000ff;">FONT</span> oFontBrw;<br />                <span style="color: #0000ff;">OF</span> oDlgBrow <br /><br />   oCol := oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   oCol:<span style="color: #000000;">AddResource</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"OFF"</span><span style="color: #000000;">&#41;</span><br />   oCol:<span style="color: #000000;">AddResource</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"ON"</span><span style="color: #000000;">&#41;</span><br />   oCol:<span style="color: #000000;">cHeader</span>   := <span style="color: #ff0000;">" "</span><br />   oCol:<span style="color: #000000;">bBmpData</span>  := <span style="color: #000000;">&#123;</span> || iif<span style="color: #000000;">&#40;</span> empty<span style="color: #000000;">&#40;</span>TempOde->Naziv<span style="color: #000000;">&#41;</span> ,<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 />   oCol:<span style="color: #000000;">oDataFont</span> := oFontBrw<br /><br />   oCol := oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   oCol:<span style="color: #000000;">bStrData</span>  := <span style="color: #000000;">&#123;</span> || RadJed_Id<span style="color: #000000;">&#125;</span><br />   oCol:<span style="color: #000000;">cHeader</span>   := <span style="color: #ff0000;">"Šifra"</span><br />   oCol:<span style="color: #000000;">nWidth</span>    := <span style="color: #000000;">40</span><br />   oCol:<span style="color: #000000;">bLClickHeader</span> = <span style="color: #000000;">&#123;</span> | nMRow, nMCol, nFlags, <span style="color: #00C800;">Self</span> | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nHeadBmpNo</span> == <span style="color: #000000;">2</span>, ::<span style="color: #000000;">nHeadBmpNo</span> := <span style="color: #000000;">1</span>, ::<span style="color: #000000;">nHeadBmpNo</span> := <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>,DBSelectArea<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"TempOde"</span><span style="color: #000000;">&#41;</span>,DBCREATEINDEX<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"TempOde"</span>,<span style="color: #ff0000;">"RadJed_Id"</span>,<span style="color: #000000;">&#123;</span>|| RadJed_Id<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">oBrw</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />   oCol:<span style="color: #000000;">oDataFont</span> := oFontBrw<br /><br />   oCol := oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   oCol:<span style="color: #000000;">bStrData</span>  := <span style="color: #000000;">&#123;</span> || Naziv<span style="color: #000000;">&#125;</span><br />   oCol:<span style="color: #000000;">cHeader</span>   := <span style="color: #ff0000;">"Odeljenje"</span><br />   oCol:<span style="color: #000000;">bLClickHeader</span> = <span style="color: #000000;">&#123;</span> | nMRow, nMCol, nFlags, <span style="color: #00C800;">Self</span> | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nHeadBmpNo</span> == <span style="color: #000000;">2</span>, ::<span style="color: #000000;">nHeadBmpNo</span> := <span style="color: #000000;">1</span>, ::<span style="color: #000000;">nHeadBmpNo</span> := <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>,DBSelectArea<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"TempOde"</span><span style="color: #000000;">&#41;</span>,DBCREATEINDEX<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"TempOde"</span>,<span style="color: #ff0000;">"Naziv"</span>,<span style="color: #000000;">&#123;</span>|| Naziv<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">oBrw</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />   oCol:<span style="color: #000000;">oDataFont</span> := oFontBrw<br /><br />   oBrw:<span style="color: #000000;">nMarqueeStyle</span>       := MARQSTYLE_HIGHLWIN7<br />   oBrw:<span style="color: #000000;">nColDividerStyle</span>    := LINESTYLE_BLACK<br />   oBrw:<span style="color: #000000;">lColDividerComplete</span> := .t.<br />   oBrw:<span style="color: #000000;">nHeaderLines</span>        := <span style="color: #000000;">1</span><br />   oBrw:<span style="color: #000000;">nFooterLines</span>        := <span style="color: #000000;">1</span><br />   oBrw:<span style="color: #000000;">nDataLines</span>          := <span style="color: #000000;">1</span><br />   oBrw:<span style="color: #000000;">lFooter</span>             := .t.<br />   oBrw:<span style="color: #000000;">SetRDD</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />       oBrw:<span style="color: #000000;">bRClicked</span> := <span style="color: #000000;">&#123;</span> | nRow, nCol | ShowPopup<span style="color: #000000;">&#40;</span> nRow, nCol, oDlgBrow, oBrw <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />     oBrw:<span style="color: #000000;">bLDblClick</span> = <span style="color: #000000;">&#123;</span> | nRow, nCol | TraRJ<span style="color: #000000;">&#40;</span>TempOde->RadJed_Id<span style="color: #000000;">&#41;</span>,oDlgBrow:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />     oBrw:<span style="color: #000000;">bKeyChar</span>   = <span style="color: #000000;">&#123;</span> | nKey, nFlags | <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span> nKey==VK_RETURN,<span style="color: #000000;">&#40;</span>TraRJ<span style="color: #000000;">&#40;</span>TempOde->RadJed_Id<span style="color: #000000;">&#41;</span>,oDlgBrow:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,<span style="color: #00C800;">NIL</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />        <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">RADIO</span> oRadFil <span style="color: #0000ff;">VAR</span> mRadFil <span style="color: #0000ff;">ID</span> <span style="color: #000000;">31</span>,<span style="color: #000000;">32</span> <span style="color: #0000ff;">OF</span> oDlgBrow;<br />                 <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">CHANGE</span> oFilter:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />        <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">COMBOBOX</span> oPolje <span style="color: #0000ff;">VAR</span> mPolje <span style="color: #0000ff;">ITEMS</span> <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"Bez filtera"</span>,<span style="color: #ff0000;">"RadJed_Id"</span>,<span style="color: #ff0000;">"Naziv"</span><span style="color: #000000;">&#125;</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">21</span> <span style="color: #0000ff;">OF</span> oDlgBrow<br /><br />        <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">GET</span> oFilter <span style="color: #0000ff;">VAR</span> mFilter <span style="color: #0000ff;">ID</span> <span style="color: #000000;">22</span> <span style="color: #0000ff;">OF</span> oDlgBrow;<br />             <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"@!"</span>;<br />                 <span style="color: #0000ff;">FONT</span> oFont <br /><br />           <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">23</span> <span style="color: #0000ff;">OF</span> oDlgBrow <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"xKljuc"</span> NOBORDER TOOLTIP <span style="color: #ff0000;">"Postavi filter"</span> ;<br />            <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span>PuniDbf<span style="color: #000000;">&#40;</span>mFilter,mPolje<span style="color: #000000;">&#41;</span>,iif<span style="color: #000000;">&#40;</span>mRadFil=<span style="color: #000000;">1</span>,<span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">GoTop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,oBrw:<span style="color: #0000ff;">Refresh</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>,<span style="color: #000000;">&#40;</span>oBrw:<span style="color: #0000ff;">Refresh</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><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br /><br />       <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">11</span> <span style="color: #0000ff;">OF</span> oDlgBrow;<br />            <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Izlaz"</span> <span style="color: #0000ff;">LEFT</span> <span style="color: #000000;">2007</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"   &Izlaz  "</span>;<br />            <span style="color: #0000ff;">ACTION</span> oDlgBrow:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />           <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> <span style="color: #0000ff;">ID</span> <span style="color: #000000;">17</span> <span style="color: #0000ff;">OF</span> oDlgBrow <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Stampac"</span> NOBORDER TOOLTIP <span style="color: #ff0000;">"Izbor štampa?a"</span> ;<br />            <span style="color: #0000ff;">ACTION</span> PrinterSetup<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />        <br />       <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">BTNBMP</span> oBtnSta <span style="color: #0000ff;">ID</span> <span style="color: #000000;">18</span> <span style="color: #0000ff;">OF</span> oDlgBrow ;<br />            <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Printer16"</span> <span style="color: #0000ff;">LEFT</span> <span style="color: #000000;">2007</span> <span style="color: #0000ff;">PROMPT</span> <span style="color: #ff0000;">"  &Štampaj  "</span>;<br />            <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span>oBrw:<span style="color: #000000;">Report</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"SPISAK RNIH JEDINICA"</span><span style="color: #000000;">&#41;</span>,oBrw:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>,oBrw:<span style="color: #000000;">GotFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />    <br />     <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlgBrow <span style="color: #0000ff;">CENTERED</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /> DBSelectArea<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"TempOde"</span><span style="color: #000000;">&#41;</span><br />DbCloseArea<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"TempOde"</span><span style="color: #000000;">&#41;</span><br /><br />DBSelectArea<span style="color: #000000;">&#40;</span>cCompany+<span style="color: #ff0000;">"_RadJed"</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> .t.<br /><br /> </div>[/code:16myjr7n] Regards, Miloš
xBrowse and report problem
We can build and run the above code exactly at our end, for want to rc file, dbfs and other functions used in the program. We therefore created a new prg file using your code to build the xbrowse and using dummy data similar to the dbf you have used. This is the code: [code=fw:2ftb3tzm]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Fivewin.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   field RadJed_ID, Naziv<br /><br />   <span style="color: #00C800;">local</span> aStruct, oBrw, oCol, oDlgBrow, oFontBrw<br /><br />   aStruct := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"RadJed_Id"</span>,<span style="color: #ff0000;">"C"</span>,<span style="color: #000000;">3</span>,<span style="color: #000000;">0</span><span style="color: #000000;">&#125;</span>,;<br />            <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"Naziv"</span>,<span style="color: #ff0000;">"C"</span>,<span style="color: #000000;">30</span>,<span style="color: #000000;">0</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><br /><br />   dbCreate<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"TEMPODE"</span>, aStruct <span style="color: #000000;">&#41;</span><br /><br />   USE TEMPODE <span style="color: #00C800;">NEW</span><br /><br /><span style="color: #B900B9;">/*<br />  nErr := oSql:exec("SELECT * FROM " + cRadJed,,.t.,,"TempOde.dbf")<br /><br />  if nErr != 0<br />    MsgInfo("Greška pri upitu","Greška")<br />  endif<br />*/</span><br /><br />   FW_ArrayToDbf<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"123"</span>, <span style="color: #ff0000;">"ABC"</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"234"</span>, <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"345"</span>, <span style="color: #ff0000;">"GHI"</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"456"</span>, <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   GO TOP<br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFontBrw <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"ARIAL"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlgBrow <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"SPISAK RADNIH JEDINICA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">460</span>,<span style="color: #000000;">300</span> <span style="color: #0000ff;">PIXEL</span><br /><br />   @ <span style="color: #000000;">40</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;">ALIAS</span> <span style="color: #ff0000;">"TempOde"</span> <span style="color: #0000ff;">OF</span> oDlgBrow NOBORDER<br /><br />   oCol := oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   oCol:<span style="color: #000000;">AddBmpFile</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\o</span>ff.bmp"</span> <span style="color: #000000;">&#41;</span><br />   oCol:<span style="color: #000000;">AddBmpFile</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\o</span>n.bmp"</span> <span style="color: #000000;">&#41;</span><br />   oCol:<span style="color: #000000;">cHeader</span>   := <span style="color: #ff0000;">" "</span><br />   oCol:<span style="color: #000000;">bBmpData</span>  := <span style="color: #000000;">&#123;</span> || iif<span style="color: #000000;">&#40;</span> empty<span style="color: #000000;">&#40;</span>TempOde->Naziv<span style="color: #000000;">&#41;</span> ,<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 />   oCol:<span style="color: #000000;">oDataFont</span> := oFontBrw<br /><br />   oCol := oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   oCol:<span style="color: #000000;">bStrData</span>  := <span style="color: #000000;">&#123;</span> || RadJed_Id<span style="color: #000000;">&#125;</span><br />   oCol:<span style="color: #000000;">cHeader</span>   := <span style="color: #ff0000;">"Šifra"</span><br />   oCol:<span style="color: #000000;">nWidth</span>    := <span style="color: #000000;">40</span><br />   oCol:<span style="color: #000000;">bLClickHeader</span> = <span style="color: #000000;">&#123;</span> | nMRow, nMCol, nFlags, <span style="color: #00C800;">Self</span> | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nHeadBmpNo</span> == <span style="color: #000000;">2</span>, ::<span style="color: #000000;">nHeadBmpNo</span> := <span style="color: #000000;">1</span>, ::<span style="color: #000000;">nHeadBmpNo</span> := <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>,DBSelectArea<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"TempOde"</span><span style="color: #000000;">&#41;</span>,DBCREATEINDEX<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"TempOde"</span>,<span style="color: #ff0000;">"RadJed_Id"</span>,<span style="color: #000000;">&#123;</span>|| RadJed_Id<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">oBrw</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />   oCol:<span style="color: #000000;">oDataFont</span> := oFontBrw<br /><br />   oCol := oBrw:<span style="color: #000000;">AddCol</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   oCol:<span style="color: #000000;">bStrData</span>  := <span style="color: #000000;">&#123;</span> || Naziv<span style="color: #000000;">&#125;</span><br />   oCol:<span style="color: #000000;">cHeader</span>   := <span style="color: #ff0000;">"Odeljenje"</span><br />   oCol:<span style="color: #000000;">bLClickHeader</span> = <span style="color: #000000;">&#123;</span> | nMRow, nMCol, nFlags, <span style="color: #00C800;">Self</span> | <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">nHeadBmpNo</span> == <span style="color: #000000;">2</span>, ::<span style="color: #000000;">nHeadBmpNo</span> := <span style="color: #000000;">1</span>, ::<span style="color: #000000;">nHeadBmpNo</span> := <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span>,DBSelectArea<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"TempOde"</span><span style="color: #000000;">&#41;</span>,DBCREATEINDEX<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"TempOde"</span>,<span style="color: #ff0000;">"Naziv"</span>,<span style="color: #000000;">&#123;</span>|| Naziv<span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span>, ::<span style="color: #000000;">oBrw</span>:<span style="color: #0000ff;">Refresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />   oCol:<span style="color: #000000;">oDataFont</span> := oFontBrw<br /><br />   oBrw:<span style="color: #000000;">nMarqueeStyle</span>       := MARQSTYLE_HIGHLWIN7<br />   oBrw:<span style="color: #000000;">nColDividerStyle</span>    := LINESTYLE_BLACK<br />   oBrw:<span style="color: #000000;">lColDividerComplete</span> := .t.<br />   oBrw:<span style="color: #000000;">nHeaderLines</span>        := <span style="color: #000000;">1</span><br />   oBrw:<span style="color: #000000;">nFooterLines</span>        := <span style="color: #000000;">1</span><br />   oBrw:<span style="color: #000000;">nDataLines</span>          := <span style="color: #000000;">1</span><br />   oBrw:<span style="color: #000000;">lFooter</span>             := .t.<br />   oBrw:<span style="color: #000000;">SetRDD</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>                   <span style="color: #B900B9;">// Remove this line. Superfluous and not desirable</span><br /><br />       oBrw:<span style="color: #000000;">bRClicked</span> := <span style="color: #000000;">&#123;</span> | nRow, nCol | ShowPopup<span style="color: #000000;">&#40;</span> nRow, nCol, oDlgBrow, oBrw <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />     oBrw:<span style="color: #000000;">bLDblClick</span> = <span style="color: #000000;">&#123;</span> | nRow, nCol | TraRJ<span style="color: #000000;">&#40;</span>TempOde->RadJed_Id<span style="color: #000000;">&#41;</span>,oDlgBrow:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />     oBrw:<span style="color: #000000;">bKeyChar</span>   = <span style="color: #000000;">&#123;</span> | nKey, nFlags | <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span> nKey==VK_RETURN,<span style="color: #000000;">&#40;</span>TraRJ<span style="color: #000000;">&#40;</span>TempOde->RadJed_Id<span style="color: #000000;">&#41;</span>,oDlgBrow:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,<span style="color: #00C800;">NIL</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />   oBrw:<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   @ <span style="color: #000000;">10</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Štampaj"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>,<span style="color: #000000;">15</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlgBrow <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">Report</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"SPISAK RNIH JEDINICA"</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 /><br />     <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlgBrow <span style="color: #0000ff;">CENTERED</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFontBrw<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> TraRJ<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;return <span style="color: #00C800;">nil</span><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> ShowPopup<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;return <span style="color: #00C800;">nil</span><br /> </div>[/code:2ftb3tzm] This is the screenshot of the browse: [url=https&#58;//imageshack&#46;com/i/exyTlRlhj:2ftb3tzm][img:2ftb3tzm]http&#58;//imagizer&#46;imageshack&#46;us/v2/xq90/537/yTlRlh&#46;jpg[/img:2ftb3tzm][/url:2ftb3tzm] Clicking on the button executes oBrw:Report( <name> ) Screen shot of Preview of Report [url=https&#58;//imageshack&#46;com/i/p5kduybEj:2ftb3tzm][img:2ftb3tzm]http&#58;//imagizer&#46;imageshack&#46;us/v2/xq90/905/kduybE&#46;jpg[/img:2ftb3tzm][/url:2ftb3tzm] You may please see that the oBrw:Report is working with your code. The above program can be compiled and tested independently on any computer.
xBrowse and report problem
We would also like to suggest the recommended way of writing the above code. [code=fw:2j9igs7u]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;field RadJed_ID, Naziv<br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aStruct, oBrw, oCol, oDlgBrow, oFontBrw<br /><br />&nbsp; &nbsp;aStruct := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"RadJed_Id"</span>,<span style="color: #ff0000;">"C"</span>,<span style="color: #000000;">3</span>,<span style="color: #000000;">0</span><span style="color: #000000;">&#125;</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"Naziv"</span>,<span style="color: #ff0000;">"C"</span>,<span style="color: #000000;">30</span>,<span style="color: #000000;">0</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;dbCreate<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"TEMPODE"</span>, aStruct <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;USE TEMPODE <span style="color: #00C800;">NEW</span><br /><br />&nbsp; &nbsp;FW_ArrayToDbf<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"123"</span>, <span style="color: #ff0000;">"ABC"</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"234"</span>, <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"345"</span>, <span style="color: #ff0000;">"GHI"</span> <span style="color: #000000;">&#125;</span>, <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"456"</span>, <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;GO TOP<br />&nbsp; &nbsp;<span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> RADJED_ID TAG <span style="color: #0000ff;">ID</span> &nbsp; &nbsp;<span style="color: #0000ff;">TO</span> TMP MEMORY<br />&nbsp; &nbsp;<span style="color: #0000ff;">INDEX</span> <span style="color: #0000ff;">ON</span> NAZIV &nbsp; &nbsp; TAG NAZIV <span style="color: #0000ff;">TO</span> TMP MEMORY ADDITIVE<br />&nbsp; &nbsp;SET ORDER <span style="color: #0000ff;">TO</span> TAG <span style="color: #0000ff;">ID</span><br />&nbsp; &nbsp;GO TOP<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFontBrw <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"ARIAL"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-14</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlgBrow <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"SPISAK RADNIH JEDINICA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">460</span>,<span style="color: #000000;">300</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">FONT</span> oFontBrw<br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">40</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;">ALIAS</span> <span style="color: #ff0000;">"TempOde"</span> <span style="color: #0000ff;">OF</span> oDlgBrow ;<br />&nbsp; &nbsp; &nbsp; COLUMNS <span style="color: #ff0000;">"EMPTY(NAZIV)"</span>, <span style="color: #ff0000;">"RADJED_ID"</span>, <span style="color: #ff0000;">"NAZIV"</span> ;<br />&nbsp; &nbsp; &nbsp; HEADERS <span style="color: #ff0000;">" "</span>, <span style="color: #ff0000;">"Sifra"</span>, <span style="color: #ff0000;">"Odeljenje"</span> ;<br />&nbsp; &nbsp; &nbsp; AUTOSORT FOOTERS LINES NOBORDER<br /><br />&nbsp; &nbsp;WITH OBJECT oBrw<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nMarqueeStyle</span> &nbsp; &nbsp; &nbsp; := MARQSTYLE_HIGHLWIN7<br />&nbsp; &nbsp; &nbsp; :<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;">SetCheck</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\o</span>ff.bmp"</span>, <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\o</span>n.bmp"</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bLDblClick</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= <span style="color: #000000;">&#123;</span> | nRow, nCol | TraRJ<span style="color: #000000;">&#40;</span>TempOde->RadJed_Id<span style="color: #000000;">&#41;</span>,oDlgBrow:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bKeyChar</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= <span style="color: #000000;">&#123;</span> | nKey, nFlags | <span style="color: #00C800;">if</span><span style="color: #000000;">&#40;</span> nKey==VK_RETURN,<span style="color: #000000;">&#40;</span>TraRJ<span style="color: #000000;">&#40;</span>TempOde->RadJed_Id<span style="color: #000000;">&#41;</span>,oDlgBrow:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>,<span style="color: #00C800;">NIL</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">bPopUp</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;:= <span style="color: #000000;">&#123;</span> || PopMenu<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;END<br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">10</span>,<span style="color: #000000;">10</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"Štampaj"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>,<span style="color: #000000;">15</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlgBrow <span style="color: #0000ff;">ACTION</span> <span style="color: #000000;">&#40;</span> oBrw:<span style="color: #000000;">Report</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"SPISAK RNIH JEDINICA"</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 /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlgBrow <span style="color: #0000ff;">CENTERED</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFontBrw<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> PopMenu<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oPop<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">MENU</span> oPop <span style="color: #0000ff;">POPUP</span> <span style="color: #000000;">2007</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"One"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Two"</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">MENUITEM</span> <span style="color: #ff0000;">"Three"</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">ENDMENU</span><br /><br /><span style="color: #00C800;">return</span> oPop<br /><br /><span style="color: #00C800;">static</span> <span style="color: #00C800;">function</span> TraRJ<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;return <span style="color: #00C800;">nil</span><br />&nbsp;</div>[/code:2j9igs7u]
xBrowse anomoly
I have noticed a very specific problem with xBrowse. This may be a new behavior in the latest version I create a browse ( perhaps with an array ), with headers and columns. If the first field is String but the content is numbers, it is somehow converting it to a decimal after perhaps 5 characters where it adds a period instead of the next character. It also can truncate the remaining data. I also see the strange truncating and improper sizing on other fields. Sizing of the fields was not accurate so I then specified the SIZE for each field in the command. Even so the decimal was still in place. I found it necessary to also add a PICTURE field to get it properly formatted. Here is an example of a BROWSE that finally worked properly. [code=fw:275hqh4h]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">// Display the browse</span><br />     <span style="color: #0000ff;">REDEFINE</span>  <span style="color: #0000ff;">XBROWSE</span> oLbx2 ;<br />      DATASOURCE oListOrders ;<br />      HEADERS <span style="color: #ff0000;">" Order "</span>, <span style="color: #ff0000;">" Vendor "</span>, <span style="color: #ff0000;">" Date "</span>, <span style="color: #ff0000;">" "</span> ;<br />      COLUMNS <span style="color: #ff0000;">"ordnum"</span>, <span style="color: #ff0000;">"ordcom"</span>, <span style="color: #ff0000;">"orddat"</span>, <span style="color: #ff0000;">" "</span> ;<br />      SIZES <span style="color: #000000;">150</span>, <span style="color: #000000;">300</span>, <span style="color: #000000;">100</span>  ;<br />      <span style="color: #0000ff;">PICTURE</span> <span style="color: #ff0000;">"#####"</span>, <span style="color: #ff0000;">"@!"</span>, <span style="color: #ff0000;">"99/99/99"</span>;<br />      <span style="color: #0000ff;">ID</span> <span style="color: #000000;">2100</span> <span style="color: #0000ff;">OF</span> oDlt ;<br />      <span style="color: #0000ff;">ON</span> DBLCLICK <span style="color: #000000;">&#40;</span>retval := .t., oDlt:<span style="color: #000000;">end</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> ;<br />      <span style="color: #0000ff;">MESSAGE</span> <span style="color: #ff0000;">"Type the beginning of the vendor, highlight the desired order, and Double Click, or select Accept"</span>  ;<br />      AUTOSORT <span style="color: #0000ff;">UPDATE</span> <br /> </div>[/code:275hqh4h] oListOrders is a DBF file and each record refers to a different purchase order. ORDNUM is a Character field of 10 characters ORDCOM is a Character field of about 30 characters. Without the picture statement, a value like "Advantage Fuel Storage and Delivery" would display as "Adfvan.very" ORDDAT is a Date field. I have handled the problem ( but not fixed the flaw that causes it ) but wonder if anyone else has seen similar behaviors. Also, it does not occur with every instance of Xbrowse ... A SECOND PROBLEM I am seeing, which was corrected previously, occurs with clicking on a row. In these same browses, if I have a list of 10 items, perhaps the last 3 or 4 will not respond to mouse clicks. However, if I use the arrow key to scroll down to them, they highlight fine. Thoughts on this would be appreciated. Again, it is not consistent across all uses of XBrowse. Tim
xBrowse anomoly
We tried to reproduce the problems you mentioned. [quote:3venljuv] I create a browse ( perhaps with an array ), with headers and columns. [/quote:3venljuv] But the code you reproduced is for TDatabase object. So we tested with both Array and TDatabase with the same data. This is our test program: [code=fw:3venljuv]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br />REQUEST DBFCDX<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aData, oDlg, oBrw, oFont<br /><br />&nbsp; &nbsp;SET CENTURY <span style="color: #0000ff;">ON</span><br /><br />&nbsp; &nbsp;BrowseArray<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;BrowseTDatabase<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> BrowseArray<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aData, oDlg, oBrw, oFont<br /><br />&nbsp; &nbsp;SET CENTURY <span style="color: #0000ff;">ON</span><br /><br />&nbsp; &nbsp;aData := ArrayData<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-15</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">620</span>,<span style="color: #000000;">350</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL <span style="color: #0000ff;">FONT</span> oFont ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">TITLE</span> FWVERSION + <span style="color: #ff0000;">" : Browse Array"</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">20</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-20</span>,<span style="color: #000000;">-20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; DATASOURCE aData COLUMNS <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span>, <span style="color: #000000;">3</span> ;<br />&nbsp; &nbsp; &nbsp; HEADERS <span style="color: #ff0000;">"Order"</span>, <span style="color: #ff0000;">"Vendor"</span>, <span style="color: #ff0000;">"Date"</span> ;<br />&nbsp; &nbsp; &nbsp; AUTOSORT CELL LINES NOBORDER<br /><br />&nbsp; &nbsp;WITH OBJECT oBrw<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nStretchCol</span> &nbsp; := <span style="color: #000000;">2</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;END<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> BrowseTDatabase<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oDbf, oDlg, oBrw, oFont<br /><br />&nbsp; &nbsp;SET CENTURY <span style="color: #0000ff;">ON</span><br /><br />&nbsp; &nbsp;oDbf &nbsp;:= OpenTDatabase<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-15</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">620</span>,<span style="color: #000000;">350</span> <span style="color: #0000ff;">PIXEL</span> TRUEPIXEL <span style="color: #0000ff;">FONT</span> oFont ;<br />&nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">TITLE</span> FWVERSION + <span style="color: #ff0000;">" : Browse TDatabase"</span><br /><br />&nbsp; &nbsp;@ <span style="color: #000000;">20</span>,<span style="color: #000000;">20</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">-20</span>,<span style="color: #000000;">-20</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />&nbsp; &nbsp; &nbsp; DATASOURCE oDbf COLUMNS <span style="color: #ff0000;">"ORDNUM"</span>, <span style="color: #ff0000;">"ORDCOM"</span>, <span style="color: #ff0000;">"ORDDAT"</span> ;<br />&nbsp; &nbsp; &nbsp; HEADERS <span style="color: #ff0000;">"Order"</span>, <span style="color: #ff0000;">"Vendor"</span>, <span style="color: #ff0000;">"Date"</span> ;<br />&nbsp; &nbsp; &nbsp; AUTOSORT CELL LINES NOBORDER<br /><br />&nbsp; &nbsp;WITH OBJECT oBrw<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nHeadStrAligns</span>:= AL_CENTER<br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">nStretchCol</span> &nbsp; := <span style="color: #000000;">2</span><br />&nbsp; &nbsp; &nbsp; :<span style="color: #000000;">CreateFromCode</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;END<br /><br />&nbsp; &nbsp;<span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span><br />&nbsp; &nbsp;<span style="color: #0000ff;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> ArrayData<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aData := ;<br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span> &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"0123456789"</span>, PadR<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Advantage Fuel Storage and Delivery"</span>, <span style="color: #000000;">35</span> <span style="color: #000000;">&#41;</span>, Date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> ;<br />&nbsp; &nbsp;, &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"1234567890"</span>, PadR<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Some other text in second line"</span>, <span style="color: #000000;">35</span> <span style="color: #000000;">&#41;</span>, &nbsp; Date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>- <span style="color: #000000;">1</span> <span style="color: #000000;">&#125;</span> ;<br />&nbsp; &nbsp;, &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"2345678901"</span>, PadR<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Some other text in third &nbsp;line"</span>, <span style="color: #000000;">35</span> <span style="color: #000000;">&#41;</span>, &nbsp; Date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>- <span style="color: #000000;">2</span> <span style="color: #000000;">&#125;</span> ;<br />&nbsp; &nbsp;, &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"3456789012"</span>, PadR<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Some other text in fourth line"</span>, <span style="color: #000000;">35</span> <span style="color: #000000;">&#41;</span>, &nbsp; Date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>- <span style="color: #000000;">3</span> <span style="color: #000000;">&#125;</span> ;<br />&nbsp; &nbsp;, &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"4567890123"</span>, PadR<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Some Fuel Storage and Delivery"</span>, <span style="color: #000000;">35</span> <span style="color: #000000;">&#41;</span>, &nbsp; Date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>- <span style="color: #000000;">4</span> <span style="color: #000000;">&#125;</span> ;<br />&nbsp; &nbsp;, &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"5678901234"</span>, PadR<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Some other text in sixth &nbsp;line"</span>, <span style="color: #000000;">35</span> <span style="color: #000000;">&#41;</span>, &nbsp; Date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>- <span style="color: #000000;">5</span> <span style="color: #000000;">&#125;</span> ;<br />&nbsp; &nbsp;, &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"6789012345"</span>, PadR<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Some other text &nbsp; seventh line"</span>, <span style="color: #000000;">35</span> <span style="color: #000000;">&#41;</span>, &nbsp; Date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>- <span style="color: #000000;">6</span> <span style="color: #000000;">&#125;</span> ;<br />&nbsp; &nbsp;, &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"7890123456"</span>, PadR<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Some other text in eighth line"</span>, <span style="color: #000000;">35</span> <span style="color: #000000;">&#41;</span>, &nbsp; Date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>- <span style="color: #000000;">7</span> <span style="color: #000000;">&#125;</span> ;<br />&nbsp; &nbsp;, &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"8901234567"</span>, PadR<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Some other text in nineth line"</span>, <span style="color: #000000;">35</span> <span style="color: #000000;">&#41;</span>, &nbsp; Date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>- <span style="color: #000000;">8</span> <span style="color: #000000;">&#125;</span> ;<br />&nbsp; &nbsp;, &nbsp;<span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"9012345678"</span>, PadR<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Advantage Fuel StorageDelivery"</span>, <span style="color: #000000;">35</span> <span style="color: #000000;">&#41;</span>, &nbsp; Date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>- <span style="color: #000000;">9</span> <span style="color: #000000;">&#125;</span> ;<br />&nbsp; &nbsp;<span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00C800;">return</span> aData<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> OpenTDatabase<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> aStruct &nbsp;:= ;<br />&nbsp; &nbsp;<span style="color: #000000;">&#123;</span> &nbsp;<span style="color: #000000;">&#123;</span> &nbsp;<span style="color: #ff0000;">"ORDNUM"</span>, &nbsp; <span style="color: #ff0000;">"C"</span>, &nbsp;<span style="color: #000000;">10</span>, &nbsp; <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span> ;<br />&nbsp; &nbsp;, &nbsp;<span style="color: #000000;">&#123;</span> &nbsp;<span style="color: #ff0000;">"ORDCOM"</span>, &nbsp; <span style="color: #ff0000;">"C"</span>, &nbsp;<span style="color: #000000;">35</span>, &nbsp; <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span> ;<br />&nbsp; &nbsp;, &nbsp;<span style="color: #000000;">&#123;</span> &nbsp;<span style="color: #ff0000;">"ORDDAT"</span>, &nbsp; <span style="color: #ff0000;">"D"</span>, &nbsp; <span style="color: #000000;">8</span>, &nbsp; <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span> ;<br />&nbsp; &nbsp;<span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;DBCREATE<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"TESTDATA"</span>, aStruct, <span style="color: #ff0000;">"DBFCDX"</span>, .T., <span style="color: #ff0000;">"DAT"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;FW_ArrayToDBF<span style="color: #000000;">&#40;</span> ArrayData<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;FW_CdxCreate<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;CLOSE DAT<br /><br /><span style="color: #00C800;">return</span> TDataBase<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">nil</span>, <span style="color: #ff0000;">"TESTDATA"</span>, <span style="color: #ff0000;">"DBFCDX"</span>, .T. <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br />&nbsp;</div>[/code:3venljuv] We did not use COLUMNWIDTHS or PICTURES clauses. XBrowse automatically calculated the widths correctly and displayed the data. We also did not face any problem with mouse clicks on the 9th or 10th row or any row for that matter. Browse Array: [url=https&#58;//imageshack&#46;com/i/povTlAwSp:3venljuv][img:3venljuv]https&#58;//imagizer&#46;imageshack&#46;com/v2/xq90/924/vTlAwS&#46;png[/img:3venljuv][/url:3venljuv] Browse TDatabase [url=https&#58;//imageshack&#46;com/i/pmFSYXbYp:3venljuv][img:3venljuv]https&#58;//imagizer&#46;imageshack&#46;com/v2/xq90/922/FSYXbY&#46;png[/img:3venljuv][/url:3venljuv] How can you help us to reproduce the problem?
xBrowse anomoly
Nages, As I said, it is not consistent. HOWEVER, also note my code uses resources and thus is a REDEFINE. I have never been able to get consistent display with @ x,y positioning on complex dialogs. I wish I could but it just never seems consistent to me, and every effort always seems to get jumbled. Here is the .RC line for this contol: CONTROL "",2100,"TxBrowse",WS_BORDER | WS_VSCROLL | WS_TABSTOP,10,10,430,230 Again, I use this same methodology over a hundred times, and it only happens in some instances. Thanks for looking at it.
xBrowse anomoly
[quote:1zlde1kd] HOWEVER, also note my code uses resources and thus is a REDEFINE. [/quote:1zlde1kd] [quote:1zlde1kd] Here is the .RC line for this contol: CONTROL "",2100,"TxBrowse",WS_BORDER | WS_VSCROLL | WS_TABSTOP,10,10,430,230 [/quote:1zlde1kd] Sure, let us test the above sample with resources, using exactly the same definition of the xbrowse. [code=fw:1zlde1kd]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br />REQUEST DBFCDX<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> aData, oDlg, oBrw, oFont<br /><br />   SET CENTURY <span style="color: #0000ff;">ON</span><br /><br />   BrowseArray<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   BrowseTDatabase<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> BrowseArray<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> aData, oDlg, oBrw, oFont<br /><br />   SET CENTURY <span style="color: #0000ff;">ON</span><br /><br />   aData := ArrayData<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-15</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"TEST"</span> <span style="color: #0000ff;">FONT</span> oFont ;<br />      <span style="color: #0000ff;">TITLE</span> FWVERSION + <span style="color: #ff0000;">" : Browse Array"</span><br /><br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">ID</span> <span style="color: #000000;">2100</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />      DATASOURCE aData COLUMNS <span style="color: #000000;">1</span>, <span style="color: #000000;">2</span>, <span style="color: #000000;">3</span> ;<br />      HEADERS <span style="color: #ff0000;">"Order"</span>, <span style="color: #ff0000;">"Vendor"</span>, <span style="color: #ff0000;">"Date"</span> ;<br />      AUTOSORT CELL LINES NOBORDER<br /><br />   WITH OBJECT oBrw<br />      :<span style="color: #000000;">nStretchCol</span>   := <span style="color: #000000;">2</span><br />   END<br /><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;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> BrowseTDatabase<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> oDbf, oDlg, oBrw, oFont<br /><br />   SET CENTURY <span style="color: #0000ff;">ON</span><br /><br />   oDbf  := OpenTDatabase<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">FONT</span> oFont <span style="color: #0000ff;">NAME</span> <span style="color: #ff0000;">"TAHOMA"</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">-15</span><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"TEST"</span> <span style="color: #0000ff;">FONT</span> oFont ;<br />      <span style="color: #0000ff;">TITLE</span> FWVERSION + <span style="color: #ff0000;">" : Browse TDatabase"</span><br /><br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">XBROWSE</span> oBrw <span style="color: #0000ff;">ID</span> <span style="color: #000000;">2100</span> <span style="color: #0000ff;">OF</span> oDlg ;<br />      DATASOURCE oDbf COLUMNS <span style="color: #ff0000;">"ORDNUM"</span>, <span style="color: #ff0000;">"ORDCOM"</span>, <span style="color: #ff0000;">"ORDDAT"</span> ;<br />      HEADERS <span style="color: #ff0000;">"Order"</span>, <span style="color: #ff0000;">"Vendor"</span>, <span style="color: #ff0000;">"Date"</span> ;<br />      AUTOSORT CELL LINES NOBORDER<br /><br />   WITH OBJECT oBrw<br />      :<span style="color: #000000;">nHeadStrAligns</span>:= AL_CENTER<br />      :<span style="color: #000000;">nStretchCol</span>   := <span style="color: #000000;">2</span><br />   END<br /><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;">RELEASE</span> <span style="color: #0000ff;">FONT</span> oFont<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> ArrayData<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> aData := ;<br />   <span style="color: #000000;">&#123;</span>  <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"0123456789"</span>, PadR<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Advantage Fuel Storage and Delivery"</span>, <span style="color: #000000;">35</span> <span style="color: #000000;">&#41;</span>, Date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> ;<br />   ,  <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"1234567890"</span>, PadR<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Some other text in second line"</span>, <span style="color: #000000;">35</span> <span style="color: #000000;">&#41;</span>,   Date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>- <span style="color: #000000;">1</span> <span style="color: #000000;">&#125;</span> ;<br />   ,  <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"2345678901"</span>, PadR<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Some other text in third  line"</span>, <span style="color: #000000;">35</span> <span style="color: #000000;">&#41;</span>,   Date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>- <span style="color: #000000;">2</span> <span style="color: #000000;">&#125;</span> ;<br />   ,  <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"3456789012"</span>, PadR<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Some other text in fourth line"</span>, <span style="color: #000000;">35</span> <span style="color: #000000;">&#41;</span>,   Date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>- <span style="color: #000000;">3</span> <span style="color: #000000;">&#125;</span> ;<br />   ,  <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"4567890123"</span>, PadR<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Some Fuel Storage and Delivery"</span>, <span style="color: #000000;">35</span> <span style="color: #000000;">&#41;</span>,   Date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>- <span style="color: #000000;">4</span> <span style="color: #000000;">&#125;</span> ;<br />   ,  <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"5678901234"</span>, PadR<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Some other text in sixth  line"</span>, <span style="color: #000000;">35</span> <span style="color: #000000;">&#41;</span>,   Date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>- <span style="color: #000000;">5</span> <span style="color: #000000;">&#125;</span> ;<br />   ,  <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"6789012345"</span>, PadR<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Some other text   seventh line"</span>, <span style="color: #000000;">35</span> <span style="color: #000000;">&#41;</span>,   Date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>- <span style="color: #000000;">6</span> <span style="color: #000000;">&#125;</span> ;<br />   ,  <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"7890123456"</span>, PadR<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Some other text in eighth line"</span>, <span style="color: #000000;">35</span> <span style="color: #000000;">&#41;</span>,   Date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>- <span style="color: #000000;">7</span> <span style="color: #000000;">&#125;</span> ;<br />   ,  <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"8901234567"</span>, PadR<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Some other text in nineth line"</span>, <span style="color: #000000;">35</span> <span style="color: #000000;">&#41;</span>,   Date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>- <span style="color: #000000;">8</span> <span style="color: #000000;">&#125;</span> ;<br />   ,  <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"9012345678"</span>, PadR<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Advantage Fuel StorageDelivery"</span>, <span style="color: #000000;">35</span> <span style="color: #000000;">&#41;</span>,   Date<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>- <span style="color: #000000;">9</span> <span style="color: #000000;">&#125;</span> ;<br />   <span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00C800;">return</span> aData<br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">function</span> OpenTDatabase<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #00C800;">local</span> aStruct  := ;<br />   <span style="color: #000000;">&#123;</span>  <span style="color: #000000;">&#123;</span>  <span style="color: #ff0000;">"ORDNUM"</span>,   <span style="color: #ff0000;">"C"</span>,  <span style="color: #000000;">10</span>,   <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span> ;<br />   ,  <span style="color: #000000;">&#123;</span>  <span style="color: #ff0000;">"ORDCOM"</span>,   <span style="color: #ff0000;">"C"</span>,  <span style="color: #000000;">35</span>,   <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span> ;<br />   ,  <span style="color: #000000;">&#123;</span>  <span style="color: #ff0000;">"ORDDAT"</span>,   <span style="color: #ff0000;">"D"</span>,   <span style="color: #000000;">8</span>,   <span style="color: #000000;">0</span> <span style="color: #000000;">&#125;</span> ;<br />   <span style="color: #000000;">&#125;</span><br /><br />   DBCREATE<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"TESTDATA"</span>, aStruct, <span style="color: #ff0000;">"DBFCDX"</span>, .T., <span style="color: #ff0000;">"DAT"</span> <span style="color: #000000;">&#41;</span><br />   FW_ArrayToDBF<span style="color: #000000;">&#40;</span> ArrayData<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />   FW_CdxCreate<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   CLOSE DAT<br /><br /><span style="color: #00C800;">return</span> TDataBase<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">nil</span>, <span style="color: #ff0000;">"TESTDATA"</span>, <span style="color: #ff0000;">"DBFCDX"</span>, .T. <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//----------------------------------------------------------------------------//</span><br /> </div>[/code:1zlde1kd] Resource file: [code=fw:1zlde1kd]<div class="fw" id="{CB}" style="font-family: monospace;"><br />TEST <span style="color: #0000ff;">DIALOG</span> <span style="color: #000000;">6</span>, <span style="color: #000000;">15</span>, <span style="color: #000000;">450</span>, <span style="color: #000000;">257</span><br /><span style="color: #0000ff;">STYLE</span> DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU<br />CAPTION <span style="color: #ff0000;">"TXBrowse demo"</span><br /><span style="color: #0000ff;">FONT</span> <span style="color: #000000;">8</span>, <span style="color: #ff0000;">"MS Sans Serif"</span><br /><span style="color: #000000;">&#123;</span><br /> CONTROL <span style="color: #ff0000;">""</span>,<span style="color: #000000;">2100</span>,<span style="color: #ff0000;">"TxBrowse"</span>,WS_BORDER | WS_VSCROLL | WS_TABSTOP,<span style="color: #000000;">10</span>,<span style="color: #000000;">10</span>,<span style="color: #000000;">430</span>,<span style="color: #000000;">230</span><br /><span style="color: #000000;">&#125;</span><br /> </div>[/code:1zlde1kd] Browse Array: [url=https&#58;//imageshack&#46;com/i/polMALhZp:1zlde1kd][img:1zlde1kd]http&#58;//imagizer&#46;imageshack&#46;us/v2/xq90/924/lMALhZ&#46;png[/img:1zlde1kd][/url:1zlde1kd] Browse TDatabase [url=https&#58;//imageshack&#46;com/i/pmFKDZxrp:1zlde1kd][img:1zlde1kd]http&#58;//imagizer&#46;imageshack&#46;us/v2/xq90/922/FKDZxr&#46;png[/img:1zlde1kd][/url:1zlde1kd] Creating these xbrowses either from source code or resources can not make such a difference as to produce the kind of behavior mentioned above.
xBrowse anomoly
On a thorough testing we can assure that XBrowse, on its own (i.e., without specifying PICTURE clauses) is not capable of producing such kind of results. However, it is possible if we assign a numeric picture clause to a column containing string values (whether numeric or alpha), due to some oversight or otherwise. For example, if we add these lines to the above browses. [code=fw:1w2ykbg3]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp; &nbsp; SIZES <span style="color: #000000;">150</span>, <span style="color: #000000;">300</span>, <span style="color: #000000;">100</span> &nbsp;;<br />&nbsp; &nbsp; &nbsp; PICTURES <span style="color: #ff0000;">"######."</span>,<span style="color: #ff0000;">"######."</span> &nbsp;;<br />&nbsp;</div>[/code:1w2ykbg3] this kind of result can appear. [url=https&#58;//imageshack&#46;com/i/pnt2lTs0p:1w2ykbg3][img:1w2ykbg3]http&#58;//imagizer&#46;imageshack&#46;us/v2/xq90/923/t2lTs0&#46;png[/img:1w2ykbg3][/url:1w2ykbg3]
xBrowse anomoly
I realize your small tests don't show it, but the problem continued and my clients were getting very upset. The behavior IS in xBrowse.prg ... Sometimes it is intepreting a Character data field as Numeric and applying a default picture to the column. The data is fine, and clearly type C. To correct the problem, where it pops up, I have to add a PICTURE clause to the browse. To save space I'm using "@!" which may annoy some with all characers capitalized, but it is far better than having the field displayed as 7 characters, and then a decimal point, with no trailing data. I've spent days testing to see if I can find any other cause. There is none. I should note that if the data row is shown on the browse, and the same data displayed in a field on the same screen, the GET field shows the full data, correctly. The browse shows the abbreviated data. For example: GET. Johnny Mustang home BROWSE. Johnny . Maybe someone can find the source of this issue. The databases are DBF, the display is by default in xbrowse, the build is with Harbor and MSVC 2019. Tim
xBrowse anomoly
There is also a problem with the latest version. When the last numerical column does not fit, it is not painted, even partially: <!-- m --><a class="postlink" href="https://ibb.co/84wDQcT">https://ibb.co/84wDQcT</a><!-- m --> But if you move the scroll, it is painted as you move: <!-- m --><a class="postlink" href="https://ibb.co/YNgqyF3">https://ibb.co/YNgqyF3</a><!-- m --> Thank you. I am using FW 20.02-
xBrowse anomoly
I'm still hoping for an answer on this.
xBrowse anomoly
[quote="TimStone":1xg3wuwk]Maybe someone can find the source of this issue. The databases are DBF, the display is by default in xbrowse, the build is with Harbor and MSVC 2019. Tim[/quote:1xg3wuwk] wich release have of xbrowse ? because here the Nages sample test run ok Per haps a good Idea use part of your dbf to see the real problem I say you also from your rel. of fwh to our there are over 6 modifications of xbrowse ( I saw on what new file )
xBrowse anomoly
Silvio, I am on the most recent version of FWH. ( 12.02 ). I use the most recent version of Microsoft Community ( 2019 updated last week ). I have seen all of the examples. The problem with them is they use specific data that does not always reflect what is stored in an actual, real world, database. So of course they work with perfect records. The question then becomes, what exactly does the xBrowse read to determine the default picture clause ? First record in the database ? First record in an indexed database ? Last record ? Something else ? Is the problem with xBrowse ? Since using a PICTURE clase when building the xBrowse command eliminates the problem, and it only occurs with the DEFAULT values automatically assigned by the xBrowse ( when no PICTURE is specified ) it would seem reasonable to say the error is caused by code in the xBrowse.prg itself. Tim
xBrowse anomoly
As noted, this problem occurs in various implementations of an xBrowse. I have asked, but received no replly, HOW ARE THE DEFAULT PICTURES DETERMINED. One can test with perfect data but customers may not always enter perfectly configured records. Clearly, the problem only occurs when xBrowse sets a default picture. Adding a Picture to the command line eliminates the problem. However, the only picture I can use for text that is simple is "@!" which forces everything to capitals and I don't like to do that. So, if you could PLEASE explain this request that has been pending since the end of 2019 I would appreciate so I can try and track down the problem. My clients are not happy ...
xBrowse anomoly
XBrowse provides default picture (oCol:cEditPicture) for columns with numeric values only and never for columns with character values. This is how it works. When XBrowse is created with this syntax: [code=fw:2c22ehz3]<div class="fw" id="{CB}" style="font-family: monospace;"><br />... <span style="color: #0000ff;">XBROWSE</span> .. DATASOURCE cAlias/oDatabase/oQry/oRecordSet/oRowSet ;<br />COLUMNS <span style="color: #ff0000;">"cCol1"</span>, <span style="color: #ff0000;">"cCol2"</span>, ... <span style="color: #ff0000;">"cColN"</span> ; <span style="color: #B900B9;">// or AUTOCOLS</span><br />...<br /> </div>[/code:2c22ehz3] By indicating the DATASOURCE in the command, we inform the XBrowse the source of data in advance before configuring the columns. This greatly helps xbrowse. When COLUMNS clause is used, xbrowse xbrowse knows which column is based on which field. XBrowse first reads the field structure of the datasource and then assigns oCol:cDataType, oCol:nDataLen, oCol:nDataDec on the basis of the corresponding field definition. Then, for numeric fields, (only numeric fields), assigns oCol:cEditPicture on the basis of nDataLen, nDataDec and the settings of FWNumFormat(). There is no question of assigning any oCol:cEditPicture to any character field. In the case of TDatabase and MariaRowSet, the picture clauses are decided even at the time of creation of the class. When XBrowse is created without COLUMNS clause: The columns are created separately either with ADD TO oBrw command or with oBrw:AddCol(). In this case, xbrowse can not map the columns to any field of the database. So, xbrowse on its own can not assign any pictures for any column. So, it is very unlikely that xbrowse by default assigns a numeric picture clause to a column with character value.
xBrowse anomoly
Tim, [quote:3jexz9g3]However, the only picture I can use for text that is simple is "@!" which forces everything to capitals and I don't like to do that.[/quote:3jexz9g3] Have you tried "@A"? This only allows characters of upper or lower case, and no symbols. James
xBrowse anomoly
James, I wish ... but sometimes they assign symbols ... not appropriate but they insist.
xBrowse anomoly
Nages, I use the COLUMN to define my browses. You will see that in the original example. I use data objects ( tDatabase ) so where would I look in there to see how it might be assigning the field type ? ( N instead of C ). This ALWAYS happens by taking a Character field and treating it like a Numeric even though the field doesn't have numbers. Also, it happens across different data files, and different column positions,
xBrowse anomoly
In that case, can you please do this small test? For the purpose of testing, please temporarily add this line of code in your program: [code=fw:2n37rkyr]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oBrw:<span style="color: #000000;">bRClicked</span> &nbsp;:= <span style="color: #000000;">&#123;</span> |r,c,f,o| <span style="color: #0000ff;">XBrowse</span><span style="color: #000000;">&#40;</span> o:<span style="color: #000000;">oDbf</span>:<span style="color: #000000;">aStruct</span>, o:<span style="color: #000000;">oDbf</span>:<span style="color: #000000;">ClassName</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />&nbsp;</div>[/code:2n37rkyr] Please run the program with this change and right click anywhere on the browse. You will see a browse of oDbf:aStruct. Can you please share a screenshot of this browse? This may give a clue for the problem.
xBrowse anomoly
Tim, I'm confused. You seem to want the picture to be "C" instead of "N" ? Then can't you just define the picture "@X"? X allows letters (upper and lower case), symbols, and numbers. James
xBrowse anomoly
The second and third field are the ones displayed in the browse. Note the third field is C 30 but later you see the picture 99999.99 [img:29crymre]https&#58;//imageshack&#46;com/i/pnQW26Htp[/img:29crymre] Again, this applies on different, but not all, databases. When it does occur, it is consistent. Adding a PICTURE clause to the command corrects the display problem you see here, so this only occurs with the default settings.
xBrowse anomoly
The picture clause "99999.99" in the 7th column of the field "SERVICE" is the cause of the problem. This picture clause corresponds to a numeric field with fieldlength 8 and fielddec 2. But this field is a character field. When TDatabase class opens a DBF, it copies DBSTRUCT() to oDbf:aStruct, extends the array and after examining each field stores (a) picture clause for numeric fields (only) in column 7, (b) index tag corresponding the field in column 8 and (c) readonly attribute (eg. datatypes +,=,etc) in column 11. For example, the index tag "EGLSGP" is stored in column 8 corresponding to the field "SYSTEM". Please confirm if this is the correct index tag. The programmer can change or assign a new picture clause to a field or find out the existing picture clause by calling [code=fw:3a2dozfl]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oDbf:<span style="color: #000000;">FieldPic</span><span style="color: #000000;">&#40;</span> <fieldname/fieldNo>, <span style="color: #000000;">&#91;</span>cNewPic<span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span> --> cPic<br />&nbsp;</div>[/code:3a2dozfl] When we create XBrowse for a TDatabase object, XBrowse calls oDbf:SetXBrowse(...) to configure the browse. In other words, it is TDatabase that actually configures the browse. While configuring, TDatabase sets oCol:cEditPicture same as the picture clause in column 7 of the corresponding field. In our case, TDatabase set the picture clause of 2nd column "Description" of xbrowse with "99999.99" because this is stored in the 7th column corresponding to the field "SERVICE". [u:3a2dozfl][b:3a2dozfl]We now need to find out how this picture clause is assigned by the class "TGROUPLIST" to a character field. [/b:3a2dozfl][/u:3a2dozfl] TDatabase, for sure, does not assign any picture clause to a character field. TGROUPLIST is a derived class, probably TGROUPLIST <-- TDATA <-- TDATABASE. We now need to find out where this picture clause came here in this chain of derivations. [b:3a2dozfl]First Step[/b:3a2dozfl]: Open this DBF directly with TDatabase [code=fw:3a2dozfl]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oDbf := TDatabase<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">nil</span>, <dbfname>, <yourRDD>, .t. <span style="color: #000000;">&#41;</span><br />XBROWSER oDbf:<span style="color: #000000;">aStruct</span><br />&nbsp;</div>[/code:3a2dozfl] Do we see any picture clause in the 7th column of the field "SERVICE"? Kindly check this and confirm. [b:3a2dozfl]Second Step:[/b:3a2dozfl] [code=fw:3a2dozfl]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oDbf := TData<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> <span style="color: #00C800;">nil</span>, <dbfname>, <yourRDD>, .t. <span style="color: #000000;">&#41;</span><br />oDbf:<span style="color: #000000;">Use</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />XBROWSER oDbf:<span style="color: #000000;">aStruct</span><br />&nbsp;</div>[/code:3a2dozfl] Do we see any picture clause in the 7th column of the field "SERVICE"? Kindly check this and confirm. [b:3a2dozfl]Third Step[/b:3a2dozfl]: [code=fw:3a2dozfl]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oDbf := TGroupList<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />XBROWSER oDbf:<span style="color: #000000;">aStruct</span><br />&nbsp;</div>[/code:3a2dozfl] Do we see any picture clause in the 7th column of the field "SERVICE"? Kindly check this and confirm. We await your reply.
xBrowse anomoly
Thank you. That gives me sufficient information to work with to find the source of this problem. Yes, I've run the tests, and now I can dig into it from there. Tim
xBrowse anomoly
[quote="TimStone":1vgqvwll]Thank you. That gives me sufficient information to work with to find the source of this problem. Yes, I've run the tests, and now I can dig into it from there. Tim[/quote:1vgqvwll] May we know if you found the solution? If so, can we expect you to share it with us?
xBrowse anomoly
I did not YET find an answer. I used a work around for the problem for now. I will post an answer when I find the source of the problem.
xBrowse array Error en argumento: TRANSFORM
Hola. TEngo definido mi xbrowse con array asi: [code=fw:3k9kn9do]<div class="fw" id="{CB}" style="font-family: monospace;">  ::<span style="color: #000000;">oBrw</span>:= TXBROWSE<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">new</span><span style="color: #000000;">&#40;</span>oDlg<span style="color: #000000;">&#41;</span><br /><br />      ::<span style="color: #000000;">cargarTemporales</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />      WITH OBJECT ::<span style="color: #000000;">oBrw</span><br />            :<span style="color: #000000;">bClrStd</span>    := <span style="color: #000000;">&#123;</span> || <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> ::<span style="color: #000000;">oBrw</span>:<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>, ;<br />                   <span style="color: #000000;">&#123;</span> CLR_BLACK, RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">191</span>, <span style="color: #000000;">219</span>, <span style="color: #000000;">255</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>, ;<br />                   <span style="color: #000000;">&#123;</span> CLR_BLACK, RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">204</span>, <span style="color: #000000;">255</span>, <span style="color: #000000;">255</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br />            :<span style="color: #000000;">bClrSel</span> := <span style="color: #000000;">&#123;</span>|| <span style="color: #000000;">&#123;</span> negro, nueve <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><br /><br />            :<span style="color: #000000;">nMarqueeStyle</span>   := <span style="color: #000000;">5</span><br />            :<span style="color: #000000;">nRowHeight</span>      := <span style="color: #000000;">19</span><br />            :<span style="color: #000000;">lRecordSelector</span> := .F.<br />            :<span style="color: #000000;">lColDividerComplete</span> := .f.<br />            :<span style="color: #000000;">nRowDividerStyle</span>:= <span style="color: #000000;">4</span><br />            :<span style="color: #000000;">nStretchCol</span> := STRETCHCOL_LAST<br />            :<span style="color: #000000;">nColDividerStyle</span>:=  <span style="color: #000000;">4</span><br />            :<span style="color: #000000;">lfastedit</span>:= .T.<br /><br />            WITH object :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span><br />               :<span style="color: #000000;">ceditPicture</span>:= <span style="color: #ff0000;">"99/99/9999"</span><br />               :<span style="color: #000000;">nHeadStrAlign</span>:= AL_CENTER<br />               :<span style="color: #000000;">oheaderfont</span>:= oFont1<br />               :<span style="color: #000000;">nWidth</span>:= <span style="color: #000000;">120</span><br />            END with<br /><br />            WITH object :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span><br />               :<span style="color: #000000;">ceditPicture</span>:= <span style="color: #ff0000;">"99/99/99"</span><br />               :<span style="color: #000000;">nHeadStrAlign</span>:= AL_CENTER<br />               :<span style="color: #000000;">ndataStrAlign</span>:= AL_LEFT<br />               :<span style="color: #000000;">oheaderfont</span>:= oFont1<br />               :<span style="color: #000000;">nWidth</span>:= <span style="color: #000000;">120</span><br />            END with<br /><br />            WITH object :<span style="color: #000000;">aCols</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#93;</span><br />               :<span style="color: #000000;">hide</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />            END WITH<br /><br />         END WITH<br /><br />         AEval<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aCols</span>,<span style="color: #000000;">&#123;</span>|o| o:<span style="color: #000000;">bRClickHeader</span> := <span style="color: #000000;">&#123;</span>|| <span style="color: #00C800;">NIL</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br />         AEval<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">aCols</span>, <span style="color: #000000;">&#123;</span> |oCol| oCol:<span style="color: #000000;">nEditType</span>   := EDIT_GET <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br />         ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">createfromresource</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">102</span><span style="color: #000000;">&#41;</span><br />...<br /><br /><span style="color: #00C800;">METHOD</span> cargarTemporales<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #00C800;">CLASS</span> T64<br /><br />   <span style="color: #00C800;">LOCAL</span> nItem<br /><br />   <span style="color: #00C800;">FOR</span> nItem:= <span style="color: #000000;">1</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">10</span><br />      AAdd<span style="color: #000000;">&#40;</span>::<span style="color: #000000;">aTemporales</span>, <span style="color: #000000;">&#123;</span>cTod<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span>, cTod<span style="color: #000000;">&#40;</span><span style="color: #ff0000;">""</span><span style="color: #000000;">&#41;</span>, <span style="color: #000000;">0</span><span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">NEXT</span> nItem<br /><br />   ::<span style="color: #000000;">oBrw</span>:<span style="color: #000000;">setarray</span><span style="color: #000000;">&#40;</span>::<span style="color: #000000;">Atemporales</span><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 /><br />   <span style="color: #00C800;">RETURN</span> <span style="color: #000000;">&#40;</span><span style="color: #00C800;">NIL</span><span style="color: #000000;">&#41;</span><br /><br /> </div>[/code:3k9kn9do] Y cuando ejecuto y quiero entrar a editar la celda me tira este error: [quote:3k9kn9do] Error description: Error BASE/1122 Error de argumento: TRANSFORM Args: [ 1] = U [ 2] = C 99/99/99 Stack Calls =========== Called from: => TRANSFORM(0) Called from: .\source\classes\TGET.PRG => TGET:NEW(250) Called from: .\source\classes\XBROWSE.PRG => TXBRWCOLUMN:EDIT(9953)[/quote:3k9kn9do] Que le pasa? gracias.
xBrowse array and move to a specific row
To All I am not a expert in arrays .. I have created an array with three elements and I have been able to get it sorted properly and been able to find a specific name in the array .. When I load the array after it has found my row .. xbrowse automatically goes to the top of the array and apparently 'moves' the record pointer. How can I move the record pointer to a specific row in xBrowse .. or not have xBrowse move the record pointer ? Here is my code .. sorry for my ignorance. Rick Lipkin [code=fw:19bp95wx]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oRsVendor := TOleAuto<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ADODB.Recordset"</span> <span style="color: #000000;">&#41;</span><br />oRsVendor:<span style="color: #000000;">CursorType</span>     := <span style="color: #000000;">1</span>        <span style="color: #B900B9;">// opendkeyset</span><br />oRsVendor:<span style="color: #000000;">CursorLocation</span> := <span style="color: #000000;">3</span>        <span style="color: #B900B9;">// local cache</span><br />oRsVendor:<span style="color: #000000;">LockType</span>       := <span style="color: #000000;">3</span>        <span style="color: #B900B9;">// lockoportunistic</span><br /><br />cSQL := <span style="color: #ff0000;">"SELECT * From Avendor Order by Lname,Fname"</span><br /><br /><span style="color: #00C800;">TRY</span><br />   oRsVendor:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> cSQL,xCONNECT <span style="color: #000000;">&#41;</span><br />CATCH oErr<br />   <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Error in Opening AVENDOR table"</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span>.F.<span style="color: #000000;">&#41;</span><br />END <span style="color: #00C800;">TRY</span><br /><br />aVendor := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00C800;">If</span> oRsVendor:<span style="color: #000000;">Eof</span><br /><span style="color: #00C800;">Else</span><br />   oRsVendor:<span style="color: #000000;">MoveFirst</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">Do</span> <span style="color: #00C800;">While</span> .not. oRsVendor:<span style="color: #000000;">Eof</span><br />      cName := <span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span>alltrim<span style="color: #000000;">&#40;</span>dencrypt<span style="color: #000000;">&#40;</span>oRsVendor:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Lname"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">", "</span>+;<br />                      alltrim<span style="color: #000000;">&#40;</span>dencrypt<span style="color: #000000;">&#40;</span>oRsVendor:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Fname"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" "</span>+;<br />                      alltrim<span style="color: #000000;">&#40;</span>dencrypt<span style="color: #000000;">&#40;</span>oRsVendor:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Mname"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+space<span style="color: #000000;">&#40;</span><span style="color: #000000;">45</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">1</span>,<span style="color: #000000;">45</span><span style="color: #000000;">&#41;</span><br /><br />      aLine := <span style="color: #000000;">&#123;</span> cName,;<br />                 dencrypt<span style="color: #000000;">&#40;</span>oRsVendor:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Active"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span><span style="color: #000000;">&#41;</span>,;<br />                 oRsVendor:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"AvendorEid"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#125;</span><br />      AAdd<span style="color: #000000;">&#40;</span> aVendor, aLine <span style="color: #000000;">&#41;</span><br />      oRsVendor:<span style="color: #000000;">MoveNext</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">Enddo</span><br /><br />   oRsVendor:<span style="color: #000000;">MoveFirst</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">Endif</span><br />                          <br />aSort<span style="color: #000000;">&#40;</span> aVendor,,, <span style="color: #000000;">&#123;</span> |x,y| x<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> < y<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />*<span style="color: #0000ff;">xBrowse</span><span style="color: #000000;">&#40;</span> aVendor <span style="color: #000000;">&#41;</span><br /><br />xLname := alltrim<span style="color: #000000;">&#40;</span>cLname<span style="color: #000000;">&#41;</span><br />*<span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span> xLname <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">If</span> Len<span style="color: #000000;">&#40;</span>aVendor<span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br />   nAt := Ascan<span style="color: #000000;">&#40;</span> aVendor, <span style="color: #000000;">&#123;</span>|aVal| aVal<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> = xLname <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span> nAt <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> Len<span style="color: #000000;">&#40;</span> aVendor <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">If</span> i = nAt<br />         <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Found"</span> <span style="color: #000000;">&#41;</span><br />         Exit<br />      <span style="color: #00C800;">Endif</span><br />   <span style="color: #00C800;">Next</span><br /><br /><span style="color: #00C800;">Endif</span><br /><br />lOk2   := .f.<br />xTITLE := <span style="color: #ff0000;">"Emp Browse "</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWndChild2 <span style="color: #0000ff;">MDICHILD</span>        ;<br />       <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">7</span>,<span style="color: #000000;">7</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">28</span>,<span style="color: #000000;">55</span>                 ;<br />       <span style="color: #0000ff;">MENU</span> BuildMenu<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>                  ;<br />       NOSYSMENU                         ;<br />       NOMINIMIZE                        ;<br />       NOZOOM                            ;<br />       <span style="color: #0000ff;">OF</span> oWind                          ;<br />       <span style="color: #0000ff;">TITLE</span> xTITLE<br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg2 <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"EMPBROW"</span> <span style="color: #0000ff;">OF</span> oWndChild2 ;<br />          <span style="color: #0000ff;">COLOR</span> RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">192</span>,<span style="color: #000000;">192</span>,<span style="color: #000000;">192</span><span style="color: #000000;">&#41;</span>, RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">62</span>,<span style="color: #000000;">104</span>,<span style="color: #000000;">130</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">xBROWSE</span> oLBX2               ;<br />       COLUMNS <span style="color: #000000;">1</span>,<span style="color: #000000;">2</span>                      ;<br />       HEADERS <span style="color: #ff0000;">"Serial Number"</span>          ;<br />       COLSIZES <span style="color: #000000;">200</span>,<span style="color: #000000;">165</span>                 ;<br />       ARRAY aVendor                    ;<br />       <span style="color: #0000ff;">ID</span> <span style="color: #000000;">111</span> <span style="color: #0000ff;">of</span> oDlg2                  ;<br />       AUTOSORT <span style="color: #0000ff;">AUTOCOLS</span> LINES CELL<br /><br />   oLbx2:<span style="color: #000000;">lHScroll</span> := .f. <span style="color: #B900B9;">// turn off horiz scroll bar</span><br />   oLbx2:<span style="color: #000000;">lRecordSelector</span> := .f.<br /><br />   *  oLbx2:<span style="color: #000000;">bClrRowFocus</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;">185</span>,<span style="color: #000000;">220</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 />   oLbx2:<span style="color: #000000;">nMarqueeStyle</span>   := MARQSTYLE_HIGHLROW<br /><br /><br /> </div>[/code:19bp95wx]
xBrowse array and move to a specific row
Rick, revisa el METHOD SetArray( aData, lAutoOrder, nColOrder, aCols, bOnSkip ) CLASS TXBrowse, saludos... <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: --> DEFAULT ::bGoTop := { || ::nArrayAt := Min( 1, Eval( ::bKeyCount ) ), Eval( ::bOnSkip, Self ) }, ; ::bGoBottom := { || ::nArrayAt := Eval( ::bKeyCount ), Eval( ::bOnSkip, Self ) }, ; ::bSkip := { | nSkip, nOld | ; If( nSkip == nil, nSkip := 1, ), ; nOld := ::nArrayAt, ; ::nArrayAt += nSkip, ; ::nArrayAt := Min( Max( ::nArrayAt, 1 ), Eval( ::bKeyCount ) ), ; Eval( ::bOnSkip, Self ), ; ::nArrayAt - nOld }, ; ::bBof := { || ::nArrayAt < 1 }, ; ::bEof := { || ::nArrayAt > Eval( ::bKeyCount ) }, ; ::bBookMark := { | n | If( n == nil, ::nArrayAt, ; ( ::nArrayAt := n, Eval( ::bOnSkip, Self ), n ) ) }, ; ::bKeyNo := ::bBookMark, ; ::bKeyCount := { || Len( ::aArrayData ) }
xBrowse array and move to a specific row
Mr Rick Please see this post: <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=25698">viewtopic.php?f=3&t=25698</a><!-- l -->
xBrowse array and move to a specific row
Rao Thank you for your solution .. For some reason in the attached code nAt returns the correct array row however when you tell xBrowse to goto that row .. you have to add 1 to nAt ? Rick Lipkin [code=fw:28t9pfc6]<div class="fw" id="{CB}" style="font-family: monospace;"><br />aVendor := <span style="color: #000000;">&#123;</span><span style="color: #000000;">&#125;</span><br /><br /><span style="color: #00C800;">If</span> oRsVendor:<span style="color: #000000;">Eof</span><br /><span style="color: #00C800;">Else</span><br />   oRsVendor:<span style="color: #000000;">MoveFirst</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">Do</span> <span style="color: #00C800;">While</span> .not. oRsVendor:<span style="color: #000000;">Eof</span><br />      cName := <span style="color: #0000ff;">substr</span><span style="color: #000000;">&#40;</span>alltrim<span style="color: #000000;">&#40;</span>dencrypt<span style="color: #000000;">&#40;</span>oRsVendor:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Lname"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">", "</span>+;<br />                      alltrim<span style="color: #000000;">&#40;</span>dencrypt<span style="color: #000000;">&#40;</span>oRsVendor:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Fname"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">" "</span>+;<br />                      alltrim<span style="color: #000000;">&#40;</span>dencrypt<span style="color: #000000;">&#40;</span>oRsVendor:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Mname"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>+space<span style="color: #000000;">&#40;</span><span style="color: #000000;">45</span><span style="color: #000000;">&#41;</span>,<span style="color: #000000;">1</span>,<span style="color: #000000;">45</span><span style="color: #000000;">&#41;</span><br /><br />      aLine := <span style="color: #000000;">&#123;</span> cName,;<br />                 dencrypt<span style="color: #000000;">&#40;</span>oRsVendor:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Active"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span><span style="color: #000000;">&#41;</span>,;<br />                 oRsVendor:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"AvendorEid"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#125;</span><br />      AAdd<span style="color: #000000;">&#40;</span> aVendor, aLine <span style="color: #000000;">&#41;</span><br />      oRsVendor:<span style="color: #000000;">MoveNext</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">Enddo</span><br /><br />   oRsVendor:<span style="color: #000000;">MoveFirst</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">Endif</span><br />                          <br />aSort<span style="color: #000000;">&#40;</span> aVendor,,, <span style="color: #000000;">&#123;</span> |x,y| x<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> < y<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />xLname := alltrim<span style="color: #000000;">&#40;</span>cLname<span style="color: #000000;">&#41;</span><br /><span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span> xLname <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">If</span> Len<span style="color: #000000;">&#40;</span>aVendor<span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br />   nAt := Ascan<span style="color: #000000;">&#40;</span> aVendor, <span style="color: #000000;">&#123;</span>|aVal| aVal<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> = xLname <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span> nAt <span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span> aVendor<span style="color: #000000;">&#91;</span>nAt<span style="color: #000000;">&#93;</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> <span style="color: #B900B9;">// correct row</span><br /><span style="color: #00C800;">Endif</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWndChild2 <span style="color: #0000ff;">MDICHILD</span>        ;<br />       <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">7</span>,<span style="color: #000000;">7</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">28</span>,<span style="color: #000000;">55</span>                 ;<br />       <span style="color: #0000ff;">MENU</span> BuildMenu<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>                  ;<br />       NOSYSMENU                         ;<br />       NOMINIMIZE                        ;<br />       NOZOOM                            ;<br />       <span style="color: #0000ff;">OF</span> oWind                          ;<br />       <span style="color: #0000ff;">TITLE</span> xTITLE<br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg2 <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"EMPBROW"</span> <span style="color: #0000ff;">OF</span> oWndChild2 ;<br />          <span style="color: #0000ff;">COLOR</span> RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">192</span>,<span style="color: #000000;">192</span>,<span style="color: #000000;">192</span><span style="color: #000000;">&#41;</span>, RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">62</span>,<span style="color: #000000;">104</span>,<span style="color: #000000;">130</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">xBROWSE</span> oLBX2               ;<br />       COLUMNS <span style="color: #000000;">1</span>,<span style="color: #000000;">2</span>                      ;<br />       HEADERS <span style="color: #ff0000;">"Name"</span>,                  ;<br />               <span style="color: #ff0000;">"Active"</span>                 ;<br />       COLSIZES <span style="color: #000000;">200</span>,<span style="color: #000000;">75</span>                  ;<br />       ARRAY aVendor                    ;<br />       <span style="color: #0000ff;">ID</span> <span style="color: #000000;">111</span> <span style="color: #0000ff;">of</span> oDlg2                  ;<br />       AUTOSORT <span style="color: #0000ff;">AUTOCOLS</span> LINES CELL<br /><br />...<br />...<br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg2 <span style="color: #0000ff;">NOWAIT</span> ;  <span style="color: #B900B9;">// It has to be NonModal --> NOWAIT clause</span><br />       <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">INIT</span> <span style="color: #000000;">&#40;</span> _GoToRow<span style="color: #000000;">&#40;</span> nAt,oLbx2 <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>;<br />       <span style="color: #0000ff;">VALID</span> <span style="color: #000000;">&#40;</span>!GETKEYSTATE<span style="color: #000000;">&#40;</span> <span style="color: #000000;">27</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>  <span style="color: #B900B9;">// do not allow esc key here</span><br /><br /><span style="color: #B900B9;">//-------------------</span><br /><span style="color: #00C800;">Static</span> Func _GoToRow<span style="color: #000000;">&#40;</span> nAt,oLbx2 <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">If</span> nAt > <span style="color: #000000;">0</span><br />   oLbx2:<span style="color: #000000;">nArrayAt</span> := oLbx2:<span style="color: #000000;">nRowSel</span> := nAt<span style="color: #000000;">+1</span>  <span style="color: #B900B9;">// add one to nAt to land on correct row</span><br />   oLbx2:<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 /><br /><span style="color: #00C800;">Return</span><span style="color: #000000;">&#40;</span><span style="color: #00C800;">nil</span><span style="color: #000000;">&#41;</span><br /><br /> </div>[/code:28t9pfc6]
xBrowse array and move to a specific row
Mr Rick Please build and check the sample I posted in the other topic.
xBrowse array and move to a specific row
Rao I built your example and it worked just fine .. I took out the ON INIT and used the "With Object" clause in my example and I came up with the same problem .. the result was out of sequence by one record .. Please do not fret on this as I have decided that 5k employee records just takes too long to load and build an array. I decided to leave the Lname field un-encrypted on my table .. everything else is all encrypted. It was just easier to manage .. don't know if this will be acceptable to the client ?? If not, I may just take another look at the array option or build a second table with Lname and relate it back to the Employee table with the primary key. Here is my code.. Thanks Rick Lipkin [code=fw:1m99k3ll]<div class="fw" id="{CB}" style="font-family: monospace;"><br />aSort<span style="color: #000000;">&#40;</span> aVendor,,, <span style="color: #000000;">&#123;</span> |x,y| x<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> < y<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br /><br />xLname := alltrim<span style="color: #000000;">&#40;</span>cLname<span style="color: #000000;">&#41;</span><br /><span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span> xLname <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">If</span> Len<span style="color: #000000;">&#40;</span>aVendor<span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br />   nAt := Ascan<span style="color: #000000;">&#40;</span> aVendor, <span style="color: #000000;">&#123;</span>|aVal| aVal<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span> = xLname <span style="color: #000000;">&#125;</span> <span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span> nAt <span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">msginfo</span><span style="color: #000000;">&#40;</span> aVendor<span style="color: #000000;">&#91;</span>nAt<span style="color: #000000;">&#93;</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 /><br /><span style="color: #00C800;">Endif</span><br /><br /><br />lOk2   := .f.<br />xTITLE := <span style="color: #ff0000;">"Emp Browse "</span><span style="color: #B900B9;">//+xDIST</span><br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWndChild2 <span style="color: #0000ff;">MDICHILD</span>        ;<br />       <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">7</span>,<span style="color: #000000;">7</span> <span style="color: #0000ff;">to</span> <span style="color: #000000;">28</span>,<span style="color: #000000;">55</span>                 ;<br />       <span style="color: #0000ff;">MENU</span> BuildMenu<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>                  ;<br />       NOSYSMENU                         ;<br />       NOMINIMIZE                        ;<br />       NOZOOM                            ;<br />       <span style="color: #0000ff;">OF</span> oWind                          ;<br />       <span style="color: #0000ff;">TITLE</span> xTITLE<br /><br />   <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg2 <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"EMPBROW"</span> <span style="color: #0000ff;">OF</span> oWndChild2 ;<br />          <span style="color: #0000ff;">COLOR</span> RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">192</span>,<span style="color: #000000;">192</span>,<span style="color: #000000;">192</span><span style="color: #000000;">&#41;</span>, RGB<span style="color: #000000;">&#40;</span><span style="color: #000000;">62</span>,<span style="color: #000000;">104</span>,<span style="color: #000000;">130</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">xBROWSE</span> oLBX2               ;<br />       COLUMNS <span style="color: #000000;">1</span>,<span style="color: #000000;">2</span>                      ;<br />       HEADERS <span style="color: #ff0000;">"Name"</span>,                  ;<br />               <span style="color: #ff0000;">"Active"</span>                 ;<br />       COLSIZES <span style="color: #000000;">200</span>,<span style="color: #000000;">75</span>                  ;<br />       ARRAY aVendor                    ;<br />       <span style="color: #0000ff;">ID</span> <span style="color: #000000;">111</span> <span style="color: #0000ff;">of</span> oDlg2                  ;<br />       AUTOSORT <span style="color: #0000ff;">AUTOCOLS</span> LINES CELL<br /><br />   oLbx2:<span style="color: #000000;">lHScroll</span> := .f. <span style="color: #B900B9;">// turn off horiz scroll bar</span><br />   oLbx2:<span style="color: #000000;">lRecordSelector</span> := .f.<br /><br />   *  oLbx2:<span style="color: #000000;">bClrRowFocus</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;">185</span>,<span style="color: #000000;">220</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 />   oLbx2:<span style="color: #000000;">nMarqueeStyle</span>   := MARQSTYLE_HIGHLROW<br /><br /><br />   WITH OBJECT oLbx2<br />      :<span style="color: #000000;">nArrayAt</span>      := nAt<br />      :<span style="color: #000000;">nRowSel</span>       := nAt<br />   END<br /><br /> </div>[/code:1m99k3ll] [url=http&#58;//imageshack&#46;us/photo/my-images/692/array1&#46;jpg/:1m99k3ll][img:1m99k3ll]http&#58;//img692&#46;imageshack&#46;us/img692/6003/array1&#46;jpg[/img:1m99k3ll][/url:1m99k3ll]
xBrowse array problem
Hi, i have been change my wbrowses to xbrowses and i have a error in one ocasion: This my xbrowse oBrw := TXBrowse():New( oDlg ) oBrw:nMarqueeStyle := MARQSTYLE_HIGHLROW oBrw:CreateFromResource( 109 ) oBrw:nColDividerStyle := 5 //LINESTYLE_BLACK // COLUNAS oBrw:lColDividerComplete := .T. oBrw:nHeaderHeight :=30 oBrw:nStretchCol := STRETCHCOL_LAST oBrw:bClrSel := {|| { Frente, Fundo } } oBrw:bClrSelFocus := {|| { Frente, Fundo } } oCol := oBrw:AddCol() oCol:cHeader := "CLI" oCol:nArrayCol := 1 oCol:nWidth := 30 oCol := oBrw:AddCol() oCol:cHeader := "Nº NOTA" oCol:nArrayCol := 2 oCol:nWidth := 80 My Add line: AADD( VetNotas, { NrAge , oCtoPar:NOTAS }) oBrw:SetArray( VetNotas ) I have a button to delete a element of array Adel(VetNotas,oBrw:nAt,.t.) But if the array have 2 elements the first deletes ok but the last give me a Array bound error. If i put oBrw:SetArray( VetNotas) next Adel the xbrowse hangs. Any sugestion? Thanks in advance.
xBrowse array problem
If you delete the last record, you might skip one record higher before deleting. Something like oBrw:Skip(-1) aDel(VetNotas, oBrw:nAt+1, .t.) aSize(Vetnotas, len(VetNotas)-1) (after deleting an element, you should resize your array)
xBrowse array problem
Not oBrw:nAt Please use oBrw:nArrayAt Adel(VetNotas,oBrw:nArrayAt,.t.) That is one major difference between wbrowse and xbrowse
xBrowse array problem
Thanks G. N. Rao. and Gilbert about xbrowse tips. Regards, Wanderson.
xBrowse as Excel behaviour
Hi, Is there a sample to set xBrowse as a Excel behaviour, including Av Pag to add a record, etc. Thanks <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
xBrowse as Excel behaviour
Can you please make your question more clear? As far as I know xbrowse is designed to behave like excel, particularly when fastedit is set to true. In other words, we can tell the users "if you know Excel, you know my software". I could not understand what you meant by " Av Pag " ? Can you please clarify what are you looking for?
xBrowse as Excel behaviour
Mr. Rao, How can xBrowse works as Excel behaviour, for example, when you press Enter a new line is created, etc?. Thank you
xBrowse as Excel behaviour
UKService, This code works with TWBrowse, but I haven't tried it with TXBrowse: oLbx:bKeydown := {|nKey,nFlags| ; IIF(nKey == VK_RETURN, ::edit(),)} You would have to add a record to the DBF, then refresh the browse. Replace ::edit() with your own function. Regards, James
xBrowse as Excel behaviour
By default, XBrowse mostly behaves like Excel when columns are Editable and FastEdit is enabled. Pressing any key enters edit mode with that key as the first key and if edit is exited with up or down arrow the cursor moves to the cell above or below the current cell like Excel. If only some columns are editable, the behavior is identical to Excel where some cells are protected. Cursor jumps to the next editable cell in both cases. Editable cell is the cell where oCol:nEditType > 0 and oCol:bEvalWhen is nil or evaluates to .t.. One difference betwen Excel and Xbrowse is that in Excel, pressing Enter key does not invoke edit but moves the cursor to the next column, whereas in XBrowse, by default, Enter key enters edit. F2 key invokes edit in Excel, where as this key is ignored in XBrowse. Even in this case, XBrowse can be set to mimic fully Excel behavior by setting [code=fw:6xqkdt3z]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oBrw:<span style="color: #000000;">lEnterKey2Edit</span> := .f.  <span style="color: #B900B9;">// ( default .t. )</span><br />oBrw:<span style="color: #000000;">lF2KeyToEdit</span>   := .t.  <span style="color: #B900B9;">// ( default .f. )</span><br /> </div>[/code:6xqkdt3z] With these settings, XBrowse behaves fully like Excel. There is another feature in Excel. We can enter "=400*20" to get 8000. By default this is not possible with XBrowse. But by setting [code=fw:6xqkdt3z]<div class="fw" id="{CB}" style="font-family: monospace;">oBrw:<span style="color: #000000;">lFormulaEdit</span> := .t. <span style="color: #B900B9;">// (default .f. ) </span></div>[/code:6xqkdt3z] we can enter formulae in XBrowse cells too, like we do in Excel. One difference between Excel and XBrowse is that Excel remembers the fomula forever but XBrowse evaluates the expression and stores the result, discarding the formula. Still this feature is very useful to the users who can enter simple calculations directly into the cells, instead of using calculator before entering into the cells. For automatically creating new rows, oBrw:bPastEof may be assigned with appropriate codeblock to instruct xbrowse what to do when the user is navigating past the eof. There are some samples in the samples folder explaining the usage. XBrowse is feature rich, but many of the features are not available to those who still use the very old way of programming like using oCol:bStrData.... ,etc.
xBrowse as record adding tool for data tables
Hello everyone; I'm guessing xbrowse could be used to add/edit records on a table. The problem is I don't want to [**CAN NOT**] append a blank record to a table to be edited. I would like to append a blank record to the xbrowse for editing without appending the blank record to the table. I can take care of appending the new record after modifications to the table at another event. If you are wondering... I can not append a blank record to a dbf table as it would violate a data integrity rule enforced by ADS SQL engine where a record can not have a blank primary key and a blank foreign key. Having said that, I'm guessing xbrowsing a dbf will allow me to add a blank record to the browse without adding it to the dbf. Does someone know how? Thank you, Reinaldo.
xBrowse as record adding tool for data tables
Dear Reinaldo But aesthetically you want to add in an xbrowse line, no ?, it can not be in a dialogue, right? Pero estéticamente quieres añadir en una linea del xbrowse, no?, no puede ser en un diálogo, verdad?
xBrowse as record adding tool for data tables
Cristobal -¿que tal? Espero que bien. Añadir el nuevo record con un dialogo sería una solución más común. Yo pensé en añadir una linea en blanco al xbrowse que pueda ser editada usando los mismos métodos del xbrowse. Pero cuando un XBROWSE está basado en un alias solo le puedo añadir una linea en blanco al xbrowse añadiendo un record en blanco a la tabla. Añadir un record en blanco a la tabla es no que no puedo ni quiero hacer. Ya que el xbrowse es tan popular y lo han trabajado tanto, he pensado que tal vez existe la posibilidad de añadir una linea en blanco sin añadir un record en blanco a la tabla. Tal vez creando un datarow() basado en un array y añadiendo al los rows del xbrowse. Si esto no fuese posible, entonces simplemente crearé un dialogo en el que el usuario pueda entrar los datos a ser añadidos. Saludos, Reinaldo.
xBrowse as record adding tool for data tables
Reinaldo, por aqui seguimos, como siempre, y tú qué tal? El tema de que por defecto añada un registro en blanco, entiendo los motivos por los que no quieres que lo haga, pero es Mr Rao el que te lo puede confirmar, pero en cuanto al tema de editar en un diálogo mira el method edit, bEdit de Xbrowse y sobre todo funcionar con oRow, a través de su clase TDataRow Seguro que hay algun ejemplo en el foro, por ejemplo <!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=6&t=33293&p=196231&hilit=tdatarow#p196195">viewtopic.php?f=6&t=33293&p=196231&hilit=tdatarow#p196195</a><!-- l -->
xBrowse as record adding tool for data tables
Reinaldo In my Invoice routine I use the down arrow to test for oRs:eof [code=fw:1mdyj9rd]<div class="fw" id="{CB}" style="font-family: monospace;"><br />           <span style="color: #B900B9;">// add a new record</span><br />          oLbxB:<span style="color: #000000;">bPastEof</span> = <span style="color: #000000;">&#123;</span>|| _AddNewRow<span style="color: #000000;">&#40;</span> oRsDetail,nRepairNumber,nAssignedTo,cLoc,oLbxB,<span style="color: #ff0000;">"Y"</span>,oRsRepair,<span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /> </div>[/code:1mdyj9rd] Then I fill in the blanks and add my primary key .. just kinda follow the flow .. not the logic.. Rick Lipkin [code=fw:1mdyj9rd]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #B900B9;">//----------------</span><br /><span style="color: #00C800;">Static</span> Func _AddNewRow<span style="color: #000000;">&#40;</span> oRsDetail,nRN,nTech,cLocation,oBrw,cAsk,oRsRepair,cReturn <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">Local</span> Saying,nEid,nLine,nUpdated<br /><br /><span style="color: #00C800;">If</span> empty<span style="color: #000000;">&#40;</span> cAsk <span style="color: #000000;">&#41;</span><br />   cAsk := <span style="color: #ff0000;">"Y"</span><br /><span style="color: #00C800;">Endif</span><br /><br /><span style="color: #00C800;">If</span> Empty<span style="color: #000000;">&#40;</span>cReturn<span style="color: #000000;">&#41;</span><br />   cReturn := <span style="color: #ff0000;">"ADD"</span><br /><span style="color: #00C800;">ENdif</span><br /><br /><br /><span style="color: #00C800;">If</span> cAsk = <span style="color: #ff0000;">"Y"</span><br /><br />   Saying := <span style="color: #ff0000;">"Do you wish to Add a New Record ?"</span><br />   <span style="color: #00C800;">If</span> MsgYesNo<span style="color: #000000;">&#40;</span> Saying <span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">Else</span><br />      oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">Return</span><span style="color: #000000;">&#40;</span>.f.<span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">Endif</span><br /><br /><span style="color: #00C800;">Endif</span><br /><br />nEid := _GenEid<span style="color: #000000;">&#40;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">If</span> nEid = <span style="color: #000000;">-1</span><br />   Saying := <span style="color: #ff0000;">"Error in Creating Unique EID for Repair Detail"</span><br />   <span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">&#40;</span> Saying <span style="color: #000000;">&#41;</span><br />   oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">Return</span><span style="color: #000000;">&#40;</span>.f.<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">Endif</span><br /><br />nLine := _GenLine<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">If</span> nLine = <span style="color: #000000;">-1</span><br />   Saying := <span style="color: #ff0000;">"Error in Creating Unique LINE for Repair Detail"</span><br />   <span style="color: #0000ff;">Msginfo</span><span style="color: #000000;">&#40;</span> Saying <span style="color: #000000;">&#41;</span><br />   oBrw:<span style="color: #000000;">SetFocus</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">Return</span><span style="color: #000000;">&#40;</span>.f.<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">Endif</span><br /><br /><span style="color: #B900B9;">// update the concurrent counter in repair header</span><br /><br />nUpdated := oRsRepair:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Updated"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span><br /><br /><span style="color: #00C800;">If</span> Empty<span style="color: #000000;">&#40;</span>nUpdated<span style="color: #000000;">&#41;</span><br />   nUpdated := <span style="color: #000000;">1</span><br /><span style="color: #00C800;">Else</span><br />   nUpdated++<br /><span style="color: #00C800;">Endif</span><br /><br />oRsRepair:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Updated"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> := nUpdated<br />oRsRepair:<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />oRsDetail:<span style="color: #000000;">AddNew</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"RepDetailEid"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>     := nEid<br />oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Unique Line"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>      := nLine<br />oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Repair Number"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>    := nRn<br /><br /><span style="color: #00C800;">If</span> cReturn = <span style="color: #ff0000;">"RETURN"</span><br />   oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Qty"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>              := <span style="color: #000000;">-1</span><br /><span style="color: #00C800;">Else</span><br />   oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Qty"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>              := <span style="color: #000000;">1</span><br /><span style="color: #00C800;">Endif</span><br /><br />oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Item Description"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> := space<span style="color: #000000;">&#40;</span><span style="color: #000000;">100</span><span style="color: #000000;">&#41;</span><br />oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Price"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>            := <span style="color: #000000;">0.00</span><br />oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Tech Number"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>      := nTech<br />oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Inventory Id"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>     := space<span style="color: #000000;">&#40;</span><span style="color: #000000;">50</span><span style="color: #000000;">&#41;</span><br />oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Inventory Type"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>   := space<span style="color: #000000;">&#40;</span><span style="color: #000000;">50</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">//"Labor"+space(45)</span><br />oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Cost"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>             := <span style="color: #000000;">0.00</span><br />oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Covered By Warranty"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> := .f.<br />oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Location"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>         := cLocation<br />oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Code"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>             := space<span style="color: #000000;">&#40;</span><span style="color: #000000;">25</span><span style="color: #000000;">&#41;</span><br />*oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Shipping Ref"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>     := space<span style="color: #000000;">&#40;</span><span style="color: #000000;">64</span><span style="color: #000000;">&#41;</span><br />oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Serial Number"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>    := space<span style="color: #000000;">&#40;</span><span style="color: #000000;">50</span><span style="color: #000000;">&#41;</span><br />oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"NoTax"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>            := <span style="color: #000000;">0</span><br />oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Warranty Provider"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> := space<span style="color: #000000;">&#40;</span><span style="color: #000000;">50</span><span style="color: #000000;">&#41;</span><br />*oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Quote Price"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>      := <span style="color: #000000;">0</span><br />oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"LockedDown"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>       := .f.<br />oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"IsSerial"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>         := .f.<br />oRsDetail:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"IsLabor"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span>          := .f.<br />oRsDetail:<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />oBrw:<span style="color: #0000ff;">ReFresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />oBrw:<span style="color: #000000;">nColSel</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">3</span><span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// move to part number on add</span><br />*__Keyboard<span style="color: #000000;">&#40;</span> Chr<span style="color: #000000;">&#40;</span> VK_RETURN <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><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><span style="color: #000000;">&#40;</span>.t.<span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//-------------------</span><br /><span style="color: #00C800;">Static</span> Func _GenEid<span style="color: #000000;">&#40;</span>nNum<span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">LOCAL</span> nRAND<br /><span style="color: #00C800;">LOCAL</span> oRs, cSQL, oERR<br /><br />oRs:= TOleAuto<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ADODB.Recordset"</span> <span style="color: #000000;">&#41;</span><br />oRs:<span style="color: #000000;">CursorType</span>     := <span style="color: #000000;">1</span>        <span style="color: #B900B9;">// opendkeyset</span><br />oRs:<span style="color: #000000;">CursorLocation</span> := <span style="color: #000000;">3</span>        <span style="color: #B900B9;">// local cache</span><br />oRs:<span style="color: #000000;">LockType</span>       := <span style="color: #000000;">3</span>        <span style="color: #B900B9;">// lockoportunistic</span><br /><br /><span style="color: #00C800;">Do</span> <span style="color: #00C800;">Case</span><br /><span style="color: #00C800;">Case</span> nNum = <span style="color: #000000;">1</span><br />   cSQL := <span style="color: #ff0000;">"SELECT RepDetailEid from [Repair Detail]"</span><br /><span style="color: #00C800;">Case</span> nNum = <span style="color: #000000;">2</span><br />   cSQL := <span style="color: #ff0000;">"SELECT InvoiceEid from [Invoice]"</span><br /><span style="color: #00C800;">Case</span> nNum = <span style="color: #000000;">3</span><br />   cSql := <span style="color: #ff0000;">"SELECT InvDetailEid from [Invoice Detail]"</span><br /><span style="color: #00C800;">Case</span> nNum = <span style="color: #000000;">4</span><br />   cSql := <span style="color: #ff0000;">"SELECT SerialEid from [SerialNumber]"</span><br /><span style="color: #00C800;">Case</span> nNum = <span style="color: #000000;">5</span><br />   cSql := <span style="color: #ff0000;">"SELECT LaborEid from [RoLabor]"</span><br /><span style="color: #00C800;">Case</span> nNum = <span style="color: #000000;">6</span><br />   cSql := <span style="color: #ff0000;">"SELECT PaymentEid from [Payments]"</span><br /><span style="color: #00C800;">Case</span> nNum = <span style="color: #000000;">7</span><br />   cSql := <span style="color: #ff0000;">"SELECT ScrapId from [UtilScrapHeap]"</span><br /><br /><span style="color: #00C800;">EndCase</span><br /><br /><br /><span style="color: #00C800;">TRY</span><br />   oRs:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> cSQL,xConnect <span style="color: #000000;">&#41;</span><br />CATCH oErr<br />      <span style="color: #00C800;">Do</span> <span style="color: #00C800;">Case</span><br />      <span style="color: #00C800;">Case</span> nNum = <span style="color: #000000;">1</span><br />         <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Error in Opening Repair Detail to Create Unique EID"</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">Case</span> nNum = <span style="color: #000000;">2</span><br />         <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Error in Opening Invoice to Create Unique EID"</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">Case</span> nNum = <span style="color: #000000;">3</span><br />         <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Error in Opening Invoice Detail to Create Unique EID"</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">Case</span> nNum = <span style="color: #000000;">4</span><br />         <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Error in Opening SerialNumber to Create Unique EID"</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">Case</span> nNum = <span style="color: #000000;">5</span><br />         <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Error in Opening RoLabor to Create Unique EID"</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">Case</span> nNum = <span style="color: #000000;">6</span><br />         <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Error in Opening Payments to Create Unique EID"</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">Case</span> nNum = <span style="color: #000000;">7</span><br />         <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Error in Opening UtilScrapHeap to Create Unique EID"</span> <span style="color: #000000;">&#41;</span><br /><br />      <span style="color: #00C800;">EndCase</span><br />      <span style="color: #00C800;">Return</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">-1</span><span style="color: #000000;">&#41;</span><br />END <span style="color: #00C800;">TRY</span><br /><br /><span style="color: #00C800;">DO</span> <span style="color: #00C800;">WHILE</span> .T.<br /><br />   nRAND := nRANDOM<span style="color: #000000;">&#40;</span><span style="color: #000000;">100000000</span><span style="color: #000000;">&#41;</span><br /><br />   <span style="color: #B900B9;">// 1 is reserved and 0 is a null key //</span><br /><br />   <span style="color: #00C800;">IF</span> nRAND = <span style="color: #000000;">1</span> .or. nRAND = <span style="color: #000000;">0</span> .or. nRAND = <span style="color: #00C800;">NIL</span><br />      LOOP<br />   <span style="color: #00C800;">ENDIF</span><br /><br />   <span style="color: #00C800;">IF</span> oRs:<span style="color: #000000;">eof</span><br />   <span style="color: #00C800;">ELSE</span><br />      oRs:<span style="color: #000000;">MoveFirst</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />      <span style="color: #00C800;">Do</span> <span style="color: #00C800;">Case</span><br />      <span style="color: #00C800;">Case</span> nNum = <span style="color: #000000;">1</span><br />         oRs:<span style="color: #000000;">Find</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"RepDetailEid = "</span>+ltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>nRand<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">Case</span> nNum = <span style="color: #000000;">2</span><br />         oRs:<span style="color: #000000;">Find</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"InvoiceEid = "</span>+ltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>nRand<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">Case</span> nNum = <span style="color: #000000;">3</span><br />      *   oRs:<span style="color: #000000;">Find</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"InvDetailEid = "</span>+ltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>nRand<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">Case</span> nNum = <span style="color: #000000;">4</span><br />         oRs:<span style="color: #000000;">Find</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"SerialEid = "</span>+ltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>nRand<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">Case</span> nNum = <span style="color: #000000;">5</span><br />         oRs:<span style="color: #000000;">Find</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"LaborEid = "</span>+ltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>nRand<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">Case</span> nNum = <span style="color: #000000;">6</span><br />         oRs:<span style="color: #000000;">Find</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"PaymentEid = "</span>+ltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>nRand<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">Case</span> nNum = <span style="color: #000000;">7</span><br />         oRs:<span style="color: #000000;">Find</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"ScrapId = "</span>+ltrim<span style="color: #000000;">&#40;</span>str<span style="color: #000000;">&#40;</span>nRand<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">EndCase</span><br /><br />   <span style="color: #00C800;">ENDIF</span><br /><br />   <span style="color: #00C800;">IF</span> oRs:<span style="color: #000000;">eof</span><br />      EXIT<br />   <span style="color: #00C800;">ELSE</span><br />      LOOP<br />   <span style="color: #00C800;">ENDIF</span><br /><br />   EXIT<br /><br /><span style="color: #00C800;">ENDDO</span><br /><br />oRs:<span style="color: #000000;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />oRs := <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span> nRAND <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//-------------------</span><br /><span style="color: #00C800;">Static</span> Func _GenLine<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">LOCAL</span> nRAND<br /><span style="color: #00C800;">LOCAL</span> oRs, cSQL, oERR<br /><br />oRs:= TOleAuto<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ADODB.Recordset"</span> <span style="color: #000000;">&#41;</span><br />oRs:<span style="color: #000000;">CursorType</span>     := <span style="color: #000000;">1</span>        <span style="color: #B900B9;">// opendkeyset</span><br />oRs:<span style="color: #000000;">CursorLocation</span> := <span style="color: #000000;">3</span>        <span style="color: #B900B9;">// local cache</span><br />oRs:<span style="color: #000000;">LockType</span>       := <span style="color: #000000;">3</span>        <span style="color: #B900B9;">// lockoportunistic</span><br /><br />cSQL := <span style="color: #ff0000;">"SELECT [Unique Line] from [Repair Detail] order by [Unique Line]"</span><br /><br /><span style="color: #00C800;">TRY</span><br />   oRs:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> cSQL,xConnect <span style="color: #000000;">&#41;</span><br />CATCH oErr<br />      <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Error in Opening Repair Detail to Create Unique LINE"</span> <span style="color: #000000;">&#41;</span><br />      <span style="color: #00C800;">Return</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">-1</span><span style="color: #000000;">&#41;</span><br />END <span style="color: #00C800;">TRY</span><br /><br /><span style="color: #00C800;">If</span> oRs:<span style="color: #000000;">Eof</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   nRand := <span style="color: #000000;">1</span><br /><span style="color: #00C800;">Else</span><br /><br />   oRs:<span style="color: #000000;">MoveLast</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   nRand := oRs:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"Unique Line"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span><span style="color: #000000;">+1</span><br /><br /><span style="color: #00C800;">Endif</span><br /><br />oRs:<span style="color: #000000;">CLose</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />oRs := <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #00C800;">Return</span><span style="color: #000000;">&#40;</span>nRand<span style="color: #000000;">&#41;</span><br /><br /> </div>[/code:1mdyj9rd]
xBrowse as record adding tool for data tables
Hey Rick! I kind-of would prefer not to generate a unique key unless the user clicks on save. If the user, never clicks on save I would also rather not have to deleted that "phantom" inserted record. BTW and this happens to be a frequently discussed theme: I generate sequential unique keys with an SQL stored procedure. So whenever any client connected to the database attempts to insert a new record, the next sequential key is generated. By client I mean web app, my own win32 apps, android, iOS or whatever (if ever). The beauty of the stored procedure is that it removes that part of the business logic to the database and away from my app. The database also has a referential integrity rule that rejects any insert attempt of a record missing a primary unique key among other things. The fun part is: my unique keys follow a pattern of two characters depending on the field being generated for followed by the last two digits of the year followed by a dash and then a sequenced number of up to n digits zero filled on the left. Every year the stored procedure "knows" it needs to restart a new sequence for that year. So a uniquely generated key by the stored procedure for the PropertyManagers table may look like: PM17-00003001. Next key during 2017 would be PM17-00003002 and so on. The first record inserted on this table on 2018, would be PM18-00000001. Whenever I get an email or phone call from a customer referencing CL17-00002520, I know he is speaking of a claim. If instead he is referencing EN17-00003328, I know he is referencing an encounter... If anyone is interested on the stored procedure code, I will gladly share it. It probably works the same for most SQL engines. I've always gathered new data to be inserted using a dialog. I was hoping for this particular small transactions tables where I store changes on section 8 portions assigned to the tenant, to use the very same xbrowse row edit capabilities. But that would require showing an empty line on xbrowse where that record really does not exist on the table. The line would only serve the purpose of allowing the user to input data. If saved, then I would execute the appropriate insert statement. I'm sure it can be done. Xbrowse is very versatile. I was hoping not having to follow that infinite source code. <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> Reinaldo.