Error Objects/6

Error Objects/6

Postby kronos911 » Sat Nov 05, 2005 11:02 am

I’m trying to brows a multidimensional array. I have seen the testarr?.prg files and have implemented the one in testarr5.prg. The problem is I get an error that I can’t find why.

Error.log
Code: Select all  Expand view  RUN
Application
===========
   Path and name: C:\APP\WIFT\WIFT.EXE (16 bits)
   Size:   367,744 bytes
   Max files handles permited: ( SetHandleCount() ) 255
   Time from start: 0 hours 0 mins 5 secs
   Error occurred at: 05/11/2005, 12:41:29
   Error description: Error Objects/6  No Exp. Method: TWBROWSE:DEFCONTROL

Stack Calls
===========
   Called from TWBROWSE:DEFCONTROL(0)
   Called from TBUTTON:NEW(0)
   Called from IFT_STATS(152)
   Called from (b)BUILDMENU(27)
   Called from TMENU:COMMAND(0)
   Called from TMDIFRAME:COMMAND(0)
   Called from TMDIFRAME:COMMAND(0)
   Called from TMDIFRAME:HANDLEEVEN(0)
   Called from WINRUN(0)
   Called from TMDIFRAME:ACTIVATE(0)
   Called from MAIN(28)

System
======
   CPU type: Pentium
   Hardware memory: 1536 megs

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

   Compiler version: Clipper (R) 5.2e Intl. (x216)  (1995.02.07)
   Windows and MsDos versions: 3.95, 5.0

   Windows total applications running: 4
      1 C:\WINDOWS\SYSTEM32\USER.EXE
      2 C:\APP\WIFT\WIFT.EXE
      3 C:\WINDOWS\SYSTEM32\MMSYSTEM.DLL
      4 C:\WINDOWS\SYSTEM32\WOWEXEC.EXE

Classes in use:
===============
     1 TFONT
     2 TWINDOW
     3 TCONTROL
     4 TICON
     5 TBRUSH
     6 TMDIFRAME
     7 TMENU
     8 TMENUITEM
     9 TMDICLIENT
    10 TMSGBAR
    11 TRECT
    12 TMSGITEM
    13 TTIMER
    14 TDIALOG
    15 TBITMAP
    16 TSAY
    17 TGET
    18 GET
    19 TBUTTON
    20 TMDICHILD
    21 TMETER
    22 TACCTABLE
    23 TWBROWSE
    24 TSCROLLBAR
    25 ERROR
    26 TSTRUCT

Memory Analysis
===============
   Static memory:
      data segment: 64k
      Initial size:       30560 bytes  (SYMP=32, Stack=9504, Heap=2056)
      PRG Stack:          34303 bytes
      48 Static variables: 672 bytes

   Dynamic memory consume:
      Actual  Value:    1273527 bytes
      Highest Value:    1280695 bytes



Procedure IFT_Stats()
Code: Select all  Expand view  RUN
PROCEDURE IFT_Stats()
  LOCAL nRecNo := RECNO(),;
        nIndexOrd := INDEXORD(),;
        nEkdo,;
        nMiEkdo,;
        nEkP,;
        nMiKeP
       
       
  PRIVATE nCounter, cMemoTxt, oStats, oStBrw, aTxtLines := {}

  oBrwsWin:Disable()

  COUNT TO nEkdo FOR BitOn(ADI_LOG,1)
  COUNT TO nMiEkdo FOR BitOff(ADI_LOG,1)
  nEkp := STR(((nEkdo/RECNO())*100),5,2)
  nMiEkp := STR(((nMiEkdo/RECNO())*100),5,2)


  AADD(aTxtLines, {"Çìåñïìçíßá     : ", DTOC(DATE()),""})
  AADD(aTxtLines, {"Óõíïëï ÖáêÝëùí : ", STRZERO(RECNO(),5,0),""})
  AADD(aTxtLines, {"Åêäïìåíåò      : ", STRZERO(nEkdo,5,0), nEkp + "%" + IIF(FOLDER->(ORDBAGNAME()) = "IFT_BAG3.CDX"," Óôï ôñÝ÷ïí öéëôñï","")})
  AADD(aTxtLines, {"Ìç Åêäïìåíåò   : ", STRZERO(nMiEkdo,5,0), nMiEkp + "%" + IIF(FOLDER->(ORDBAGNAME()) = "IFT_BAG3.CDX"," Óôï ôñÝ÷ïí öéëôñï","")})

  IF FOLDER->(ORDBAGNAME()) = "IFT_BAG3.CDX" .AND. !lHreFlt
    AADD(aTxtLines, {"","",""})
    AADD(aTxtLines, {"Åíåñãï Öéëôñï   ","",""})
    AADD(aTxtLines, {"Ãéá ôï/ôçí     : ", aFltLst1[1,2],""})
    AADD(aTxtLines, {"áðï : ", aFltLst1[1,1],""})
    AADD(aTxtLines, {"åùò : ", aFltLst1[3,1],""})
    AADD(aTxtLines, {"Ãéá ôï åôïò    :"," áðï "+ aFltLst1[2,1], "åùò " + aFltLst1[4,1]})
  ENDIF

  IF lHreFlt
    AADD(aTxtLines, {"","",""})
    AADD(aTxtLines, {"Åíåñãï Öéëôñï Õðáëëçëïõ  ","",""})
    AADD(aTxtLines, {"Ïíïìá           : ", aFltLst1[7,2],""})
    AADD(aTxtLines, {"Ãéá ôï äéÜóôçìá : ", ALLTRIM(aFltLst1[7,4]) + " " + aFltLst1[7,1],""})
  ENDIF

  nCounter := 1

  DEFINE DIALOG oStats;
    FROM 5,5 TO 20,70;
    TITLE OemToAnsi("ÁíáöïñÜ óõóôÞìáôïò");
    OF oBrwsWin

  @0.3, 0.3 LISTBOX oStBrw OF oStats;
    FIELDS aTxtLines[nCounter,1], aTxtLines[nCounter,2], aTxtLines[nCounter,3];
    SIZE 490,180 COLOR CLR_BLACK,CLR_WHITE
 
    oStBrw:bGoTop := {|| nCounter := 1}
    oStBrw:bGoBottom := {|| nCounter := EVAL(oStBrw:bLogicLen)}
    oStBrw:bSkip := {|nWant, nOld| nOld := nCounter, nCounter += nWant, nCounter := MAX(1, MIN( nCounter, EVAL(oStBrw:bLogicLen))), nCounter - nOld}
    oStBrw:bLogicLen := {|| LEN(aTxtLines)}
    oStBrw:cAlias := "Array"

// next line is 152
    @10,15 BUTTON OemToAnsi("ÅíôÜîåé") OF oStats ACTION (oStats:End()) SIZE 80,30
   
    SET FONT OF oStats TO oMainFont
  ACTIVATE DIALOG oStats ON INIT (oStats:SetColor( CLR_BLACK, CLR_HGRAY)) CENTER

  DBGOTO(nRecNo)
  oBrwsWin:Enable()
  oBrwsWin:aControls[1]:setfocus()
RETURN


I’ve tried moving the LISTBOX and all the oo calls into a separate procedure and run it with the ON INIT clause. Now one of 2 things happens then.
a) With the button the dialog displays, when you press the button the LISTBOX disappears but the dialog stays. It goes away only with the X box, the button is still there but nothing happens when you press it again.
b) The dialog box doesn’t show at all.

When I quote out the button line I get the dialog box (the LISTBOX is in the DEFINE DIALOG – ACTIVATE DIALOG loop)
What am I doing wrong I followed the coding of the testarr5.prg, which works fine when run. I’ll need to use this technique a couple more times in the app.
Thanks
kronos911
 
Posts: 37
Joined: Sat Oct 22, 2005 2:15 pm
Location: Greece

Postby Antonio Linares » Sat Nov 05, 2005 2:09 pm

Kronos,

Please generate the PPO file and check what you get for:

@10,15 BUTTON OemToAnsi("ÅíôÜîåé") OF oStats ACTION (oStats:End()) SIZE 80,30
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42120
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby kronos911 » Sat Nov 05, 2005 9:47 pm

PPO output for that line is
Code: Select all  Expand view  RUN
TButton():New( 10, 15, OemToAnsi("„¤«α¥œ "), oStats, {|| (oStats:End())}, 80, 30,,, .F., .F., .F.,, .F.,,, .F. )

Same error even without the () around the oStats:End() command
kronos911
 
Posts: 37
Joined: Sat Oct 22, 2005 2:15 pm
Location: Greece

Postby kronos911 » Sun Nov 06, 2005 1:03 am

Ok I found the error. The pre processor is a picky SOB.
Changing this
Code: Select all  Expand view  RUN
@0.3, 0.3 LISTBOX oStBrw OF oStats;
    FIELDS aTxtLines[nCounter,1], aTxtLines[nCounter,2], aTxtLines[nCounter,3];
    SIZE 490,180 COLOR CLR_BLACK,CLR_WHITE

Into this
Code: Select all  Expand view  RUN
@0.3, 0.3 LISTBOX oStBrw;
    FIELDS aTxtLines[nCounter,1], aTxtLines[nCounter,2], aTxtLines[nCounter,3];
    SIZE 490,180 COLOR CLR_BLACK,CLR_WHITE OF oStats

Solved all the problems. You say what gives hu. Well the PPO output for that line (not the error line as in the log but 5 lines up) was
Code: Select all  Expand view  RUN
oStBrw := OF := oStats := TWBrowse():New(….)

instead of
Code: Select all  Expand view  RUN
oStBrw := TWBrowse():New(….)

And I thought that the pre processor was smarter than that.
kronos911
 
Posts: 37
Joined: Sat Oct 22, 2005 2:15 pm
Location: Greece

Postby Antonio Linares » Sun Nov 06, 2005 5:00 am

It looks as a Clipper preprocessor bug.

Anyhow, good you found it :)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42120
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for CA-Clipper

Who is online

Users browsing this forum: No registered users and 4 guests

cron