Xbrowse Builder having a strange error (SOLVED)

Re: Xbrowse Builder having a strange error

Postby Otto » Wed Jan 26, 2022 11:20 am

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 view  RUN

 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
 
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6342
Joined: Fri Oct 07, 2005 7:07 pm

Re: Xbrowse Builder having a strange error

Postby Marc Venken » Wed Jan 26, 2022 11:48 am

I send the files (FB)
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1442
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Xbrowse Builder having a strange error

Postby Otto » Wed Jan 26, 2022 4:59 pm

Hello Marc,
I copied the files and I need to comment these two lines, then the source code will compile.
// :oHeaderFonts := oBold
// :nHeadStrAligns := AL_CENTER

The program starts. Can you briefly explain how to use it?

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6342
Joined: Fri Oct 07, 2005 7:07 pm

Re: Xbrowse Builder having a strange error

Postby Marc Venken » Thu Jan 27, 2022 8:14 pm

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 )
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1442
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Xbrowse Builder having a strange error

Postby Otto » Fri Jan 28, 2022 7:44 am

Good morning,
here is my test.
What are the next steps?
Best regards,
Otto
Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6342
Joined: Fri Oct 07, 2005 7:07 pm

Re: Xbrowse Builder having a strange error

Postby Marc Venken » Fri Jan 28, 2022 8:54 am

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)
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1442
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Xbrowse Builder having a strange error

Postby Otto » Fri Jan 28, 2022 8:42 pm

Marc,

I can't test this because my brwdetail is empty.
Best regards,
Otto
Code: Select all  Expand view  RUN
  netopen("brwdetail","Code","TempXb")
      select tempXb
     
      xbrowse("tempXb")
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6342
Joined: Fri Oct 07, 2005 7:07 pm

Re: Xbrowse Builder having a strange error

Postby Marc Venken » Fri Jan 28, 2022 10:53 pm

Just delete the dbf. The sample creates it again with data
brwdetail.dbf
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1442
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Xbrowse Builder having a strange error

Postby Otto » Sat Jan 29, 2022 8:38 am

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 )

Image
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6342
Joined: Fri Oct 07, 2005 7:07 pm

Re: Xbrowse Builder having a strange error

Postby Marc Venken » Sat Jan 29, 2022 10:22 am

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...
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1442
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Xbrowse Builder having a strange error (SOLVED)

Postby Otto » Sat Jan 29, 2022 12:49 pm

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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6342
Joined: Fri Oct 07, 2005 7:07 pm

Re: Xbrowse Builder having a strange error (SOLVED)

Postby Marc Venken » Sun Jan 30, 2022 7:23 pm

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
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1442
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: Xbrowse Builder having a strange error (SOLVED)

Postby Marc Venken » Sun Jan 30, 2022 7:31 pm

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.
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1442
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 63 guests