Reservation Nages Test with New Xbrowse

Post Reply
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Reservation Nages Test with New Xbrowse

Post by Silvio.Falconi »

Dear Nages,

Do you remember your Reservation Test made with Xbrowse

Image



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

Code: Select all

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 ?
Last edited by Silvio.Falconi on Thu May 03, 2018 9:05 am, edited 1 time in total.
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Reservation Nages Test with New Xbrowse

Post by nageswaragunupudi »

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
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: Reservation Nages Test with New Xbrowse

Post by Silvio.Falconi »

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
Image

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 ?
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Reservation Nages Test with New Xbrowse

Post by nageswaragunupudi »

Code: Select all

 
  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
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: Reservation Nages Test with New Xbrowse

Post by Silvio.Falconi »

thanks now run
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: Reservation Nages Test with New Xbrowse

Post by Silvio.Falconi »

Mr Rao,

I need a modify

I add on dbf a field called Tipo

Code: Select all

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: Select all


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?
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
nnicanor
Posts: 296
Joined: Fri Apr 23, 2010 4:30 am
Location: Colombia

Re: Reservation Nages Test with New Xbrowse

Post by nnicanor »

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
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: Reservation Nages Test with New Xbrowse

Post by Silvio.Falconi »

it is on forum
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: Reservation Nages Test with New Xbrowse

Post by Silvio.Falconi »

Rao I sent you a test
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
Post Reply