Page 2 of 2
Re: Xbrowse Builder having a strange error
Posted: Wed Jan 26, 2022 11:20 am
by Otto
Hello Marc,
I saw that. But I do not have the right structure for customer.
I changed forumsetup().
Best regards,
Otto
LOCAL_PATH := "c:\fwharb\samples\"
cLocal := "C:\fwharb\samples\"
and I changed
Code: Select all | Expand
function forumsetup()
local aFields:={}, aF2:={}
cFile = LOCAL_PATH + "brwsetup.dbf"
IF .NOT. FILE( cFile )
aFields := { { "BRWNAAM", "C", 15, 0 },;
{ "TOP", "N", 4, 0 },;
{ "LEFT", "N", 4, 0 },;
{ "BREED", "N", 4, 0 },;
{ "HOOGTE", "N", 4, 0 },;
{ "DATABASE", "C", 15, 0 },;
{ "RELATION", "C", 200, 0 },;
{ "INDEX", "C", 15, 0 },;
{ "INFO", "C", 250, 0 },;
{ "MASTER", "C", 10, 0 } }
DbCreate( cFile, aFields, "DBFCDX" )
use cFile NEW VIA "DBFCDX"
index on upper(brwnaam) tag code
append blank
brwsetup->brwnaam = "CUSTOMERS"
brwsetup->DATABASE = "CUSTOMER"
close brwsetup
endif
Re: Xbrowse Builder having a strange error
Posted: Wed Jan 26, 2022 11:48 am
by Marc Venken
I send the files (FB)
Re: Xbrowse Builder having a strange error
Posted: Wed Jan 26, 2022 4:59 pm
by Otto
Hello Marc,
I copied the files and I need to comment these two lines, then the source code will compile.
//

HeaderFonts := oBold
// :nHeadStrAligns := AL_CENTER
The program starts. Can you briefly explain how to use it?
Best regards,
Otto
Re: Xbrowse Builder having a strange error
Posted: Thu Jan 27, 2022 8:14 pm
by Marc Venken
If you click on customers, the program will crash (at least here it does) and that because of the 2 lines of code or lines 577
//aadd(aVeld,alltrim(tempXb->veld))
//aadd(aKop,alltrim(tempXb->brnaam))
aadd(aVeld,tempXb->veld)
aadd(aKop,tempXb->brnaam)
Do you have a crach ?
There error file is giving a other error : that I can't find. Only if I commend the 2 lines on 577 it gives no error ? Strange thing...
Time from start: 0 hours 0 mins 1 secs
Error occurred at: 27/01/2022, 21:08:31
Error description: Error BASE/1004 No exported method: VALUE
Args:
[ 1] = U
Stack Calls
===========
Called from: => VALUE( 0 )
Called from: demo.prg => STYLEBROWSE( 687 )
Called from: demo.prg => GETXBROWSER( 602 )
Called from: demo.prg => MARC_FOLDEREX( 451 )
Called from: demo.prg => (b)MAIN( 122 )
Re: Xbrowse Builder having a strange error
Posted: Fri Jan 28, 2022 7:44 am
by Otto
Good morning,
here is my test.
What are the next steps?
Best regards,
Otto

Re: Xbrowse Builder having a strange error
Posted: Fri Jan 28, 2022 8:54 am
by Marc Venken
Otto,
Can you try : around lines 577
Works here !
//aadd(aVeld,alltrim(tempXb->veld))
//aadd(aKop,alltrim(tempXb->brnaam))
aadd(aVeld,tempXb->veld)
aadd(aKop,tempXb->brnaam)
and
Error here !
aadd(aVeld,alltrim(tempXb->veld))
aadd(aKop,alltrim(tempXb->brnaam))
//aadd(aVeld,tempXb->veld)
//aadd(aKop,tempXb->brnaam)
Re: Xbrowse Builder having a strange error
Posted: Fri Jan 28, 2022 8:42 pm
by Otto
Marc,
I can't test this because my brwdetail is empty.
Best regards,
Otto
Code: Select all | Expand
netopen("brwdetail","Code","TempXb")
select tempXb
xbrowse("tempXb")
Re: Xbrowse Builder having a strange error
Posted: Fri Jan 28, 2022 10:53 pm
by Marc Venken
Just delete the dbf. The sample creates it again with data
brwdetail.dbf
Re: Xbrowse Builder having a strange error
Posted: Sat Jan 29, 2022 8:38 am
by Otto
Hello Marc,
You can't just TRIM the column name.
You then have a different name when you query it - a name that does not exist in your xBrowser and therefore the error.
You could maybe test with the column number instead of oBrw:oCol( cCol ).
Would you be so kind to repost your code after the changes. This seems a very interesting project. Congratulations and respect.
If you need more help, please let me know.
Best regards,
Otto
aBarget
FOR EACH cCol in aBarget
? cCol + "|" + str(len(cCol))
xbrowse(oBrw)
WITH OBJECT oBrw:oCol( cCol )

Re: Xbrowse Builder having a strange error
Posted: Sat Jan 29, 2022 10:22 am
by Marc Venken
Hi Otto,
I found the error !!
You pointed me in the right direction with the headernames that are not the same, so I noticed the folowing in the program.
The browse is auto-made correctly with the headers :
aadd(aVeld,alltrim(tempXb->veld))
aadd(aKop,alltrim(tempXb->brnaam))
BUT.... in the selection witch field should be editable and can be searched I did not used the alltrim function, so at that point the names are not the same.
Putting the alltrim insite, the problem is solved. GREAT and many Thanks.
if tempXb->sel_bar
aadd(aBrwGet,alltrim(tempXb->brnaam))
endif
if tempXb->sel_edit
aadd(aBrwEdit,alltrim(tempXb->brnaam))
endif
StyleBrowse(oBrw, aBrwGet, aBrwEdit ,cData ) // Pimping the browser with colors etc...
Re: Xbrowse Builder having a strange error (SOLVED)
Posted: Sat Jan 29, 2022 12:49 pm
by Otto
Hi Marc,
Glad I could help.
Would you be so kind to post the corrected code so that we can follow your work?
Best regards,
Otto
Re: Xbrowse Builder having a strange error (SOLVED)
Posted: Sun Jan 30, 2022 7:23 pm
by Marc Venken
Otto,
It is only these 2 lines of code that need to be changed. The ALLTRIM is needed.
if tempXb->sel_bar
aadd(aBrwGet,alltrim(tempXb->brnaam))
endif
if tempXb->sel_edit
aadd(aBrwEdit,alltrim(tempXb->brnaam))
endif
Re: Xbrowse Builder having a strange error (SOLVED)
Posted: Sun Jan 30, 2022 7:31 pm
by Marc Venken
We can shared code, ideas if you are interested in Xbrowse as a general Builder. I like the idea and it works great and is very time reducing in time of devellopment
I gonna try to put as much as possible in the dbf, so only changing the dbf is needed and not the code.