FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Problem with Tplan : Cargo Error
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Problem with Tplan : Cargo Error
Posted: Mon Jul 01, 2019 10:23 AM


code error
Code (fw): Select all Collapse
pplication
===========
   Path and name: C:\Work\Errori\Fsdi_Plan\main.Exe (32 bits)
   Size: 3,676,672 bytes
   Compiler version: Harbour 3.2.0dev (r1904111533)
   FiveWin  version: FWH 19.05
   C compiler version: Borland/Embarcadero C++ 7.0 (32-bit)
   Windows version: 6.2, Build 9200 

   Time from start: 0 hours 0 mins 6 secs 
   Error occurred at: 01-07-2019, 12:19:12
   Error description: Error BASE/1005  No exported variable: CARGO
   Args:
     [   1] = U   
     [   2] = H   {=>}

Stack Calls
===========
   Called from:  => _CARGO( 0 )
   Called from: source\sample01.prg => SAMPLEPLAN:MOVERESERVATION( 537 )
   Called from: source\sample01.prg => (b)SAMPLEPLAN_BUILDPLANNING( 355 )
   Called from: Lib\Plan\tplan.prg => TPLANNING:LBUTTONUP( 702 )
   Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT( 1791 )
   Called from: Lib\Plan\tplan.prg => TPLANNING:HANDLEEVENT( 619 )
   Called from: .\source\classes\WINDOW.PRG => _FWH( 3546 )
   Called from:  => WINRUN( 0 )
   Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE( 1078 )
   Called from: source\main.prg => TAPPLICATION:ACTIVATE( 166 )
   Called from: source\main.prg => MAIN( 29 )




I need to insert Tplan into a Dialog
this Dialog id made with ::nStyle := nOR( WS_CHILD, 4 ) because it is create on WndMain

on thid Dialog I inser a Panel oPanelBook where I insert Tplan Obj as you can see on Picture

I have error when I wish move the bargraph or resize

I have problem on MoveReservation( oData, nRowId, oPlann ) and on
ResizeReservation( oData, nRowId, oPlann ) )



I have error on oData:CARGO

I not change anything on SamplePlan class (sample01.prg)
only I change ::oWnd := opanelBook

the source od the prg where I call SAMPLEPLAN CLASS

Code (fw): Select all Collapse
  


function Planning()
    local nSplit := VAL(GetPvProfString("Browse", "StSplit","102", oApp():cIniUser))
    Local oExBar //new
    local cDir     := oApp():cDbfPath


    IF oApp():oDlg != NIL
      IF oApp():nEdit > 0
         RETURN NIL
      ELSE
         oApp():oDlg:End()
         SysRefresh()
      ENDIF
   ENDIF


   oApp():oDlg := TFsdi():New(oApp():oWndMain)
   oApp():oDlg:cTitle := i18n('Booking Hotel')
   oApp():oDlg:SetColor(0,RGB(143,172,230))
   oApp():oWndMain:oClient := oApp():oDlg


    //pannel left
  oExBar := TPanel():New(0,0,oApp():oDlg:nBottom,nSplit, oApp():oDlg  )
  oExBar:SetColor(0,RGB(143,172,230))

  //pannel Booking
   oApp():oPanelBook  :=  TPanel():New(0,oExBar:nwidth+5,200, oApp():oDlg:nRight, oApp():oDlg  )
   oApp():oPanelBook:SetColor(0,CLR_WHITE)


    ACTIVATE DIALOG oApp():oDlg NOWAIT ;
      ON PAINT( oApp():oSplit:AdjClient()) ;
      ON INIT (BuildExplorerBar(oExBar,nSplit, oApp():oDlg,.t.," Prenotazioni")  ,;
               BuildSplitterV(oExBar)                          ,;
               oApp():oBook:=SamplePlan():New(oApp():oPanelBook,oApp:cDbfPath),;
               ResizeWndMain());
        VALID ( WritePProString("Book","Split",Ltrim(Str(oApp():oSplit:nleft/2)),oApp():cIniFile) ,; //save the split on inifile
               DbCloseAll(), oApp():oDlg := NIL, .t. )
               RETURN NIL




I have all these problem when I use Tdatabase
If I use normal dbf I not have all these problem
IF there is not problem on Tdtabase , How it's possibile I not have problem if I use normale exclusive dbf ?
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: Problem with Tplan : Cargo Error
Posted: Mon Jul 01, 2019 11:05 AM

Now I saw this
If I insert the dbfs on the root of exe it run ok and not make error ( cargo)
If I insert the dbf on a folder it make error ( cargo)

it's strange

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: Problem with Tplan : Cargo Error
Posted: Mon Jul 01, 2019 03:18 PM

what is your code for movereservation?
what is the code at line 495?

Regards



G. N. Rao.

Hyderabad, India
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Problem with Tplan : Cargo Error
Posted: Mon Jul 01, 2019 06:16 PM
Code (fw): Select all Collapse
  METHOD MoveReservation( oData, nRowId, oPlann ) CLASS SamplePlan

       local oItem := oData
       local cDescribe, cTooltip, nStatus

       ::oReserva:Seek( oItem:Cargo['INDICE'] )

       if oPlann:nDaysOffset != 0 .OR. oPlann:nRoomsOffset != 0
          cDescribe = oItem:cDescribe
          nStatus = oItem:Cargo['STATUS']
          oPlann:DeleteData( oItem, .F. )

          ::oReserva:CHECK_IN += oPlann:nDaysOffset //determina cuantos dias nos movimos
          ::oReserva:CHECK_OUT += oPlann:nDaysOffset //determina cuantos dias nos movimos
          ::oReserva:ROOMS_ID = nRowId
          ::oReserva:Save()
          ::oReserva:Commit()
          ::oRooms:Seek( nRowId )

          cTooltip  = "Elemento     : " + ::oRooms:NAME + CRLF
          cTooltip += "Numero       : " + ::oRooms:ID + CRLF
          cTooltip += "Ospite       : " + ::oReserva:GUEST + CRLF
          cTooltip += "Arrivo       : " + DToC( ::oReserva:CHECK_IN ) + CRLF
          cTooltip += "Partenza     : " + DToC( ::oReserva:CHECK_OUT )

          oData = oPlann:AddData( ::oReserva:ROOMS_ID,;
                              ::oReserva:CHECK_IN,;
                              ::oReserva:CHECK_OUT,;
                              cDescribe, cToolTip )
          oData:Cargo = {=>}
          oData:Cargo['STATUS'] = nStatus
          oData:Cargo['INDICE'] = ::oReserva:ROOMS_ID + DToS(::oReserva:CHECK_IN)
          oPlann:oLastData = NIL
       endif

    RETURN nil




line 495 oData:Cargo = {=>}



this afternoon I add a new data to samplePlan class

DATA cDbfPath init cFilePath(GetModuleFileName( GetInstance() )) + "Data\" // just for testing


Now it seem run ok



only on myapplication I not have the folder of archives = "data\"

but it is (year) \data\ the user can select the year

So i cannot Know the right folder

Another error
As You can see on datepick I have a Italian date while on tPlan Object I have the name of days in english language
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: Problem with Tplan : Cargo Error
Posted: Mon Jul 01, 2019 06:31 PM
Code (fw): Select all Collapse
          oData = oPlann:AddData( ::oReserva:ROOMS_ID,;

In this line, oPlann:AddData(..) is returning NIL and so, oData is NIL.
You need to check your Class SamplePlan.
Regards



G. N. Rao.

Hyderabad, India
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Problem with Tplan : Cargo Error
Posted: Tue Jul 02, 2019 08:08 AM
Nages,
the problem is not there .........

If I insert a new data on Class type
Code (fw): Select all Collapse
DATA cDbfPath init cFilePath(GetModuleFileName( GetInstance() ))  + "Data\"  // just for testing


all run ok , there is not error of cargo , all procedures run perfectly

But it is not my really folder on My application

the problem on my application I use a DATA oApp:cDbfPAth where I save the path od Dbf, sample "\2013\Data\"

when I use on BuildDbf method (of the class SamplePlan)

local cDir := oApp():cDbfPath
::oRooms := TDatabase():Open( nil, cDir+"ROOMS", "DBFCDX", .t. )

I have this error



I have all dbfs into .\2013\data and I cannot change the folder
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: Problem with Tplan : Cargo Error
Posted: Tue Jul 02, 2019 08:29 AM

Now I insert on Method New

::cDbfPath := GetIni( oApp():cIniFile, "Config", "DbfPath")

and seem to Found the dbfs

when I compile the source on my application

Before it show the plan then why I try to move or resize a bar I have the cargo error

it's incredible !!!!

I got demoralized, it's the same source code I didn't change anything, I just compiled it in my application, I didn't do anything else
I feel like a failure, I have been playing with these sources for days and I can't find the solution

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: Problem with Tplan : Cargo Error
Posted: Tue Jul 02, 2019 09:15 AM
THERE IS AN ERROR ON FIRST Please see BuildPlanning method

DEFINE PLANNING ::oPlann OF ::oWnd;
HEADER "Elementi/Giorni";
COLOR HEADER ( If( Dow( dDate ) == 1 .OR. Dow( dDate ) == 7, CLR_WHITE, ::nClrText ) );
COLOR CELL ::ColorData( oData ) ;
START DAY Date() - 5;
END DAY Date() + 5;
ON RIGHT SELECT oSelf:BuildPop( nRow, nCol, Self, dCheckIn, dCheckOut );
ON CAPTURE oSelf:MoveReservation(oData, nRowId, Self);
ON RESIZE DATA oSelf:ResizeReservation(oData, nRowId, Self) NOHALFDAY


BUT THE VARIABLE oData is not defined perhaps it can be a a data of the class ?

these errors there are only with tdatabase
instead if I Use RESERVA-> and ROOMS-> run ok
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: Problem with Tplan : Cargo Error
Posted: Tue Jul 02, 2019 11:48 AM
I understand that I have to give up, it means that I will use the tplan only in a large window as you can see in the figure even though I particularly don't like it because the end user would have the window of the program open and at the same time open the tplan.

Obviously, using tdatabase in share, you may perhaps not create erroneous reading files

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: Problem with Tplan : Cargo Error
Posted: Tue Jul 02, 2019 11:56 AM
I have all dbfs into .\2013\data and I cannot change the folder

Yes.
But not in "\2013\data\"
That is your mistake.
Regards



G. N. Rao.

Hyderabad, India
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Problem with Tplan : Cargo Error
Posted: Tue Jul 02, 2019 03:17 PM
Nages,

on Method New I add these lines

local cInifile := TakeOffExt( GetModuleFileName( GetInstance() ) ) + ".ini"

::cDbfPath := GetIni( cIniFile, "Config", "DbfPath")

this is the Main.ini
Code (fw): Select all Collapse
[Config]
YearPath=2013
PdfPath=.\2013\Pdf\
DbfPath=.\2013\Data\
ZipPath=.\2013\Zip\
DocPath=.\2013\Doc\
XLsPath=.\2013\Xls\
ImgPath=.\images\
TempImg=.\temp\



Now I trying a release on ::oWnd as yu can see on previous picture. It run ok
But I not like it , I not like an appkication where are many opened windows ....

But If I insert the samplePlan class into my Dialog ( oApp:oDlg) , into a Panel called oApp():oPanelBook I have the cargo errors
I not change any sources , the sources are the same, it is the sample class
only I changed ::= oApp():oPanelBook and rem the command to creare the window ::oWnd
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: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Problem with Tplan : Cargo Error
Posted: Tue Jul 02, 2019 03:40 PM

Silivo,

What Nages was referring to was the error message in a previous message of yours (above), shows the path without the leading period. Maybe you set it in your code somewhere which overrode your INI file?

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Problem with Tplan : Cargo Error
Posted: Tue Jul 02, 2019 03:53 PM
Rith it's possible.
Now I erased all and re-write a test

PPlan.prg
Code (fw): Select all Collapse
function Planning()
   local nSplit := VAL(GetPvProfString("Browse", "StSplit","102", oApp():cIniUser))
    Local oExBar //new
    local cDir     := oApp():cDbfPath

     IF oApp():oDlg != NIL
      IF oApp():nEdit > 0
         RETURN NIL
      ELSE
         oApp():oDlg:End()
         SysRefresh()
      ENDIF
   ENDIF


   oApp():oDlg := TFsdi():New(oApp():oWndMain)
   oApp():oDlg:cTitle := i18n('Booking Hotel')
   oApp():oDlg:SetColor(0,RGB(143,172,230))
   oApp():oWndMain:oClient := oApp():oDlg


 //pannel left
  oExBar := TPanel():New(0,0,oApp():oDlg:nBottom,nSplit, oApp():oDlg  )
  oExBar:SetColor(0,RGB(143,172,230))

  //pannel Booking
   oApp():oPanelBook  :=  TPanel():New(0,oExBar:nwidth+5,200, oApp():oDlg:nRight, oApp():oDlg  )
   oApp():oPanelBook:SetColor(0,CLR_WHITE)


   ACTIVATE DIALOG oApp():oDlg NOWAIT ;
      ON PAINT( oApp():oSplit:AdjClient()) ;
      ON INIT (BuildExplorerBar(oExBar,nSplit, oApp():oDlg,.t.," Prenotazioni")  ,;
               BuildSplitterV(oExBar)                          ,;
               oApp():oBook:=SamplePlan():New(),;
               ResizeWndMain());
        VALID ( WritePProString("Book","Split",Ltrim(Str(oApp():oSplit:nleft/2)),oApp():cIniFile) ,; //save the split on inifile
               DbCloseAll(),oApp():oBook:= NIL, oApp():oDlg := NIL, .t. )
               RETURN NIL



and I attached the samplePlan original changingn the ::ownd
and strange now run ok or seem run ok





I don't Know , this morning not run ok and made cargo error , this afternoon seem run ok... BOH!!!
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: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Problem with Tplan : Cargo Error
Posted: Tue Jul 02, 2019 04:04 PM

I was just looking at the TSPlan source (dated 6/26/19), you sent me, and I notice that you have oData defined as a class variable (::oData) and elsewhere you define it as a local (oData) and then pass it around to methods. The point of making something a class variable is that you don't need to pass it around, so everything should be ::oData. That may be the source of your CARGO error. If you have defined it as one type then are calling it as the other type (which may not have been defined yet) then you would get that error.

I would also suggest using a better name for oData--a name that reflects the real-world object that it represents.

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Problem with Tplan : Cargo Error
Posted: Tue Jul 02, 2019 04:40 PM

James,
I not make Tplan class , Daniel Garcia Gill is the Author

NOw I compiled the test of the tplan with the rest of the program that I am carrying out and when I went to test it again it gives me an error on odata: CARGO, I really am staco and I can't take it anymore ... I ask you to help me please !!!!

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