Reservation Nages Test with New Xbrowse

Reservation Nages Test with New Xbrowse

Postby Silvio.Falconi » Wed May 02, 2018 4:29 pm

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  Expand view  RUN
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.
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7076
Joined: Thu Oct 18, 2012 7:17 pm

Re: Reservation Nages Test with New Xbrowse

Postby nageswaragunupudi » Thu May 03, 2018 3: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
User avatar
nageswaragunupudi
 
Posts: 10662
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Reservation Nages Test with New Xbrowse

Postby Silvio.Falconi » Thu May 03, 2018 9: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
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 ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7076
Joined: Thu Oct 18, 2012 7:17 pm

Re: Reservation Nages Test with New Xbrowse

Postby nageswaragunupudi » Thu May 03, 2018 5:48 pm

Code: Select all  Expand view  RUN

  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
nageswaragunupudi
 
Posts: 10662
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Reservation Nages Test with New Xbrowse

Postby Silvio.Falconi » Fri May 04, 2018 5:32 pm

thanks now run
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7076
Joined: Thu Oct 18, 2012 7:17 pm

Re: Reservation Nages Test with New Xbrowse

Postby Silvio.Falconi » Mon May 07, 2018 7:43 am

Mr Rao,

I need a modify

I add on dbf a field called Tipo

Code: Select all  Expand view  RUN
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  Expand view  RUN


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

Re: Reservation Nages Test with New Xbrowse

Postby nnicanor » Thu May 10, 2018 1: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
nnicanor
 
Posts: 302
Joined: Fri Apr 23, 2010 4:30 am
Location: Colombia

Re: Reservation Nages Test with New Xbrowse

Postby Silvio.Falconi » Thu May 10, 2018 5:41 am

it is on forum
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7076
Joined: Thu Oct 18, 2012 7:17 pm

Re: Reservation Nages Test with New Xbrowse

Postby Silvio.Falconi » Mon May 14, 2018 5:34 pm

Rao I sent you a test
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7076
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 49 guests