Page 1 of 1

FW 23.07 Xbrowse, Cargos rather than Cargo

PostPosted: Fri Aug 11, 2023 3:11 pm
by mauri.menabue
Good evening Mr Nages,

I would like to point out a small oversight in the XBROWSE program
Cargos instead of Cargo, as noted in the code snippet below.
The version of FWH is 23.07

Thank you

Code: Select all  Expand view
  for nFor := 1 to Len( ::aCols )
      if ( n := AScan( aStruct, { |a| a[ 1 ] == Upper( ::aCols[ nFor ]:cHeader ) } ) ) > 0
         if Empty( ::aCols[ nFor ]:cSortOrder )
            ::aCols[ nFor ]:cSortOrder    := aStruct[ n ][ 8 ]
            ::aCols[ nFor ]:cOrdBag       := ( cAlias )->( OrdBagName( ::aCols[ nFor ]:cSortOrder ) )
         endif
      elseif ( n := AScan( aStruct, { |a| a[ 1 ] == Upper( IfNil( ::aCols[ nFor ]:Cargo, "" ) ) } ) ) > 0
         if Empty( ::aCols[ nFor ]:cSortOrder )
            ::aCols[ nFor ]:cSortOrder    := aStruct[ n ][ 8 ]
            ::aCols[ nFor ]:cOrdBag       := ( cAlias )->( OrdBagName( ::aCols[ nFor ]:cSortOrder ) )
         endif

      endif

   next nFor

   ::Cargos    := nil     <------------------------------------------------------------------------------------------------- row 5823

   DEFAULT ::bSeek  := { |c,u| ( ::cAlias )->( ::RddIncrSeek( c, @u ) ) }

   if ( ::cAlias )->( DbInfo( DBI_SHARED ) )
      if ( ::cAlias )->( RddName() ) $ "DBFNTX,DBFCDX"
         ::bLock     := { || ( ::cAlias )->( If( DbInfo( DBI_ISFLOCK ) .or. DbRecordInfo( DBRI_LOCKED, RECNO() ), ;
                              .t., lLocked := DbrLock( RECNO() ) ) ) }
         ::bUnlock   := { || If( lLocked, ( ::cAlias )->( DbrUnlock( RECNO() ) ), nil ) }
      else
         ::bLock     := { || ( ::cAlias )->( DbrLock() ) }
         ::bUnlock   := { || ( ::cAlias )->( DbrUnlock() ) }
      endif
   endif

Re: FW 23.07 Xbrowse, Cargos rather than Cargo

PostPosted: Fri Aug 11, 2023 4:10 pm
by nageswaragunupudi
Code: Select all  Expand view
::Cargos := nil

is a shortcut for
Code: Select all  Expand view
AEval( ::aCols, { |o| o:Cargo := nil } )

Re: FW 23.07 Xbrowse, Cargos rather than Cargo

PostPosted: Fri Aug 11, 2023 5:12 pm
by mauri.menabue
Hi Nages,

however, this error is generated because ::Cargos is not defined

Application
===========
Path and name: d:\Zephir\NwCoge\Sigah.exe (32 bits)
Size: ********* bytes
Compiler version: Harbour 3.2.0dev (r2008190002)
FiveWin version: FWH 23.07
C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
Windows 10 64 Bits, version: 10.0, Build 22621

Time from start: 0 hours 0 mins 15 secs
Error occurred at: 11/08/2023, 19:00:11
Error description: Error BASE/1005 Message not found: TXBROWSE:CARGOS

Stack Calls
===========
Called from: .\source\function\HARBOUR.PRG => _CLSSETERROR( 247 )
Called from: prog\xBrowse.prg => TXBROWSE:_CARGOS( 12038 )
Called from: prog\xBrowse.prg => TXBROWSE:SETRDD( 5823 )
Called from: prog\xBrowse.prg => XBRWSETDATASOURCE( 18060 )
Called from: prog\xBrowse.prg => XBROWSENEW( 17873 )
Called from: \servizio\prog\StdGes.prg => STDGES:ACTIVATE( 1728 )
Called from: prog\GesFtt.prg => GESFTT( 226 )
Called from: prog\Main.prg => (b)BUILDMENU( 6741 )
Called from: .\source\classes\MENU.PRG => TMENU:COMMAND( 1557 )
Called from: .\source\classes\WINDOW.PRG => TWINDOW:COMMAND( 1162 )
Called from: .\source\classes\MDIFRAME.PRG => TMDIFRAME:COMMAND( 272 )
Called from: => TMDIFRAME:HANDLEEVENT( 0 )
Called from: .\source\classes\WINDOW.PRG => _FWH( 3693 )
Called from: => WINRUN( 0 )
Called from: .\source\classes\WINDOW.PRG => TMDIFRAME:ACTIVATE( 1118 )
Called from: prog\Main.prg => MAIN( 6404 )

System
======
CPU type: Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz 2592 Mhz
Hardware memory: 16221 megs

Free System resources: 90 %
GDI resources: 90 %
User resources: 90 %

Windows total applications running: 4
1 ATKOSD2,
2 Compila, d:\Zephir\NwCoge\Sigah.exe
3 DDE Server Window, C:\WINDOWS\System32\OLE32.DLL
4 GDI+ Window (AsusOSD.exe), C:\WINDOWS\WinSxS\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.22621.1778_none_9fab56ede2916b

Re: FW 23.07 Xbrowse, Cargos rather than Cargo

PostPosted: Fri Aug 11, 2023 6:43 pm
by nageswaragunupudi
I see. Looks like you are creating xbrowse without any columns.
Can I see the way you are creating the xbrowse? In this case.
Please share your code. Only the part how you are creating
We will see how to handle that situation and advise.

Re: FW 23.07 Xbrowse, Cargos rather than Cargo

PostPosted: Fri Aug 11, 2023 8:20 pm
by nageswaragunupudi
For now please make this change in your xbrowse.prg
Replace the line
Code: Select all  Expand view
::Cargos := nil

with
Code: Select all  Expand view
If !Empty( ::aCols ); ::Cargos := nil; endif