FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Reservation Nages Test with New Xbrowse
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Reservation Nages Test with New Xbrowse
Posted: Wed May 02, 2018 04:29 PM
Dear Nages,

Do you remember your Reservation Test made with Xbrowse





Now with the last xbrowse have errors (I have the December 2017 release)


Code (fw): Select all Collapse
Application
===========
   Path and name: C:\Work\errori\Reservation\test.Exe (32 bits)
   Size: 3,684,352 bytes
   Compiler version: Harbour 3.2.0dev (r1703231115)
   FiveWin  version: FWH 17.12
   C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
   Windows version: 6.1, Build 7601 Service Pack 1

   Time from start: 0 hours 0 mins 0 secs 
   Error occurred at: 05/02/18, 18:26:56
   Error description: Error BASE/1132  Bound error: array access
   Args:
     [   1] = A   { ... } length: 1
     [   2] = N   -1

Stack Calls
===========
   Called from: test.prg => LOADDATA( 25 )
   Called from: test.prg => MAIN( 13



how I can resolve it ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Reservation Nages Test with New Xbrowse
Posted: Thu May 03, 2018 03:40 AM

It works with xHarbour.
You can try and see.

In xHarbour, an array index can be -ve. This is not allowed in Harbour.

Example:
aData := { 1,2,3,4,5,6 }

In xharbour:
? aData[ -1 ] // 6
? aData[ -2 ] // 5

But this usage raises runtime error in Harbour.

To work with Harbour, we need to change aData[ -1 ] as ATail( aData ) or aData[ Len( aData ) ]
Please make these changes if you want to build with Harbour.

This has nothing to do with the version of FWH.

Regards



G. N. Rao.

Hyderabad, India
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Reservation Nages Test with New Xbrowse
Posted: Thu May 03, 2018 09:51 AM
Sorry Nages,

I change on habour with :

for n := 1 to 7
for i := 1 to NUM_TABLES
AAdd( aRes[ i ], Array( LastDayOM( dMonth ) + 1 ) )
AFill( aRes[ i ][ n ], .f. )
aRes[ i ][ n ][ 1 ] := cMonth( dMonth )
next i
dMonth := AddMonth( dMonth, 1 )
next n


and I have the same result


it is right or not ?

If I insert also a tooltip

:bToolTip := { | oBrw, nRow, nCol, nFlags | MyToolTip( oBrw, nRow, nCol, nFlags,aRes) }

when I click on one clumn it hide the other columns.... why ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Reservation Nages Test with New Xbrowse
Posted: Thu May 03, 2018 05:48 PM
Code (fw): Select all Collapse
 
  for n := 2 to 32
      WITH OBJECT oBrw:aCols[ n ]
         :cHeader    := LTrim( Str( n - 1 ) )
         :SetCheck( { 'c:\fwh\bitmaps\level1.bmp', 'c:\fwh\bitmaps\level2.bmp' } )
         :bCellToolTip := { |oCol| oCol:cHeader + " " + oBrw:aRow[ 1 ] + CRLF + If( oCol:Value, "TRUE", "FALSE" ) }
      END
   next
Regards



G. N. Rao.

Hyderabad, India
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Reservation Nages Test with New Xbrowse
Posted: Fri May 04, 2018 05:32 PM

thanks now run

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Reservation Nages Test with New Xbrowse
Posted: Mon May 07, 2018 07:43 AM
Mr Rao,

I need a modify

I add on dbf a field called Tipo

Code (fw): Select all Collapse
function CreateDBF()

   FIELD NUMTABLE

   local n, dStart
   local aCols := {  { 'NUMTABLE', 'N', 2, 0 }, ;
                            { 'TIPO', 'C', 1, 0 }, ;                  //TYPE OF ROOM    "O"  "H"  "C"  "T"
                            { 'DATAIN'  , 'D', 8, 0 }, ;
                            { 'DATAFIN' , 'D', 8, 0 }  }

   DbCreate( 'RESERVATION', aCols )

   USE RESERVATION
   INDEX ON NUMTABLE TAG NUMTABLE

   dStart   := AddMonth( BOY( Date() ), 2 ) // 1st March
    for n := 1 to 100 * NUM_TABLES
      APPEND BLANK
      FIELD->NUMTABLE      := HB_RandomInt( 1, NUM_TABLES )
      FIELD->DATAIN        := dStart + HB_RandomInt( 0, 200 )
      FIELD->DATAFIN       := FIELD->DATAIN + HB_RandomInt( 0, 5 )
      FIELD->TIPO          := IF(NUMTABLE=1, "O","H")
   next n
   CLOSE RESERVATION

   return nil


I have same numbers of tables but in different rooms.

TYPE OF ROOM "O" "H" "C" "T"

When I wish show reservation with room type "O" is ok

When i show the reservation on other rooms it make errors

on Load data function I tak eonly the type of table I select (ctipo)
Code (fw): Select all Collapse
static function LoadData(cTipo)

   local i, n, aRes  := Array( NUM_TABLES, 0 )
   local dMonth      := AddMonth( BOY( DATE() ), 2 ) //  1st March

   for n := 1 to 7
      for i := 1 to NUM_TABLES
         AAdd( aRes[ i ], Array( LastDayOM( dMonth ) + 1 ) )
         AFill( aRes[ i ][ n ], .f. )
         aRes[ i ][ n ][ 1 ]   := cMonth( dMonth )
      next i
      dMonth      := AddMonth( dMonth, 1 )
   next n


USE RESERVATION

 do while ! Eof()
      for n := FIELD->DATAIN to FIELD->DATAFIN
         IF FIELD->TIPO = cTipo // take the type of room selected 
            aRes[FIELD->NUMTABLE ][ Month( n ) - 2 ][ Day( n ) + 1 ] := .t.
         ENDIF
      next
   SKIP
   enddo


   CLOSE RESERVATION

return aRes


on ShowTables( aRes, NumOmb ) function
I erase tab control and I take on xbrowse the number of NUMTABLE (NumOmb)


oBrw:aArrayData := aRes[NumOmb]



How i can resolve?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 302
Joined: Fri Apr 23, 2010 04:30 AM
Re: Reservation Nages Test with New Xbrowse
Posted: Thu May 10, 2018 01:43 AM

Hi,

Can you share entire source code of this sample ?

Regards,

Nicanor Martinez M.
Auditoria y Sistemas Ltda.
MicroExpress Ltda.
FW + FWH + XHARBOUR + HARBOUR + PELLES C + XDEVSTUDIO + XEDIT + BCC + VC_X86 + VCC_X64 + MINGW + R&R Reports + FastReport + Tdolphin + ADO + MYSQL + MARIADB + ORACLE
nnicanor@yahoo.com
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Reservation Nages Test with New Xbrowse
Posted: Thu May 10, 2018 05:41 AM

it is on forum

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Reservation Nages Test with New Xbrowse
Posted: Mon May 14, 2018 05:34 PM

Rao I sent you a test

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com

Continue the discussion