problem xbrowse hash

problem xbrowse hash

Postby mastintin » Mon Oct 06, 2014 8:24 pm

this code throws me error when pressing the button. How do I reload the new data?
Code: Select all  Expand view

#include "FiveWin.Ch"
#include "xbrowse.ch"

//------------------------------------------------------------------//

function Main()

   local oDlg, oBrw
   local h := ReCreatehash()

  DEFINE DIALOG oDlg
 
   @ 15,5 XBROWSE oBrw SIZE -5,-5 PIXEL OF oDlg ;
      ARRAY h AUTOCOLS HEADERS 'Detail', 'Value' ;
      CELL LINES NOBORDER

   oBrw:nStretchCol  := 1
   oBrw:CreateFromCode()

   @ 1,5 button "refresh" ACTION obrw:setArray( Refreshhash() ) pixel
   
   ACTIVATE DIALOG oDlg CENTERED

return ( 0 )

//------------------------------------------------------------------//
 
 Function ReCreatehash()
local h := {=>}

   h["Age"]    := 45
   h["City"]   := 'NewYork'
   h["JoinDt"] := {^ 1997/12/21}
   h["First"]  := 'John'
   h["Last"]   := 'Abraham'
 
 Return h
 
 //------------------------------------------------------------------//
 
  Function Refreshhash()
local h := {=>}

   h["Age"]    := 48
   h["City"]   := 'Paris'
   h["JoinDt"] := {^ 1997/12/21}
   h["First"]  := 'Jose'
   h["Last"]   := 'Arias'
 
 Return h
 
 
User avatar
mastintin
 
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

Re: problem xbrowse hash

Postby Antonio Linares » Tue Oct 07, 2014 5:04 am

Manuel,

In xbrowse.prg line 4233 please make this change:

Code: Select all  Expand view
     if Len( aData ) > 0 .and. ValType( aData ) == 'H' .and. ;  // remove [ 1 ]
         ValType( ATail( aData ) ) == 'H' .and. lAddCols
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42098
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: problem xbrowse hash

Postby bpd2000 » Tue Oct 07, 2014 5:28 am

Rebuild require after change in xbrowse.prg ?
How to do that
Regards, Greetings

Try FWH. You will enjoy it's simplicity and power.!
User avatar
bpd2000
 
Posts: 153
Joined: Tue Aug 05, 2014 9:48 am
Location: India

Re: problem xbrowse hash

Postby Antonio Linares » Tue Oct 07, 2014 5:33 am

Dave,

The easiest way is to wait for a new FWH build from us.

In case that you need such change, to test it, simply add xbrowse.prg as another PRG of your app.

If you want to learn how to update your FWH libraries there are many explanations about it on these forums. If you don't find it, I can point you to an explanation.

Are you using Borland ? Are you using Harbour ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42098
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: problem xbrowse hash

Postby bpd2000 » Tue Oct 07, 2014 5:44 am

Antonio Linares wrote:Dave,
Are you using Borland ? Are you using Harbour ?

I am using Borland and Harbour, this is new experience for me
Regards, Greetings

Try FWH. You will enjoy it's simplicity and power.!
User avatar
bpd2000
 
Posts: 153
Joined: Tue Aug 05, 2014 9:48 am
Location: India

Re: problem xbrowse hash

Postby Antonio Linares » Tue Oct 07, 2014 5:47 am

Basically all you have to do is:

1. Compile the PRG using Harbour

2. Compile the resulting C file using bcc32 (check buildh.bat to see how this is done)

3. Replace the module in the library:

tlib.exe fiveh.lib -+ xbrowse.obj
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42098
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 32 guests