Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Obscure error with THIS.ADDPROPERTY in INIT

Status
Not open for further replies.

wgcs

Programmer
Mar 31, 2002
2,056
EC
I have a control, in a grid, which tries to pop-up another form so the user can select a value. This usually works! However, in certain (unknown) circumstances, this error is thrown from within the new form while that form is initializing a Timer control. The timer control has this code in it's .Init method:
Code:
THIS.AddProperty('nEventCount',0)
THIS.AddProperty('aEventList[1,2]','')

The error is #45 "Not a character expression"
I can't see how these addproperty functions could possibly throw that error, no matter What! I haven't been able to reproduce the problem, and this same form class (with the timer in it) is used in hundreds of other forms on thousands of computers... the error only happens with this one form being instantiated from within a textbox contained in a grid.

This is all the details of the error that is thrown:
Code:
Current Environment:        03/06/2005 11:32 AM
  OS():           Windows 5.01
  Version():      Visual FoxPro 08.00.0000.3117 EXE Support Library for Windows
  Procedure:      aasgridmonthviewwin.aasgridmonthviewwin.tmrdelayedactions.AddProperty
  Line():           0
  Error():          45
  Message():        Not a character expression.
  Message(1):       Not a character expression.
  SET('Defa')+CurDir():  C:\DOCUMENTS AND SETTINGS\ALL USERS\DOCUMENTS\
  Alias():          CGLOBALEXC (Order():DISPORD) (Dbf:C:\DOCUME~1\JONNIE\LOCALS~1\TEMP\M5LW00AW.TMP) (Rec:1/1 )
  Filter()  =
  On('Error')     =do errproc with sys(16),lineno(),error(),message(),message(1)
  set('Device')   =SCREEN

======================================================
Call Stack (assembled from Program(i) and sys(16,i):
  1) LOADER                          C:\PROGRAM FILES\ALL AMERICAN SPORTSWARE\GAME TIME\GTWIN.EXE
  2) GTW                             C:\PROGRAM FILES\ALL AMERICAN SPORTSWARE\GAME TIME\GTWIN.APP
  3) GTDIVWIZ.PGFWIZARD.PAGE5.CMDADDGLOBALEXCEPTION.CLICK  PROCEDURE GTDIVWIZ.PGFWIZARD.PAGE5.CMDADDGLOBALEXCEPTION.CLICK C:\PROGRAM FILES\SOURCE\GTWIN\GTDIV.VCT
  4) GTDIVWIZ.ADDGLOBALEXCEPTION     PROCEDURE GTDIVWIZ.ADDGLOBALEXCEPTION C:\PROGRAM FILES\SOURCE\GTWIN\GTDIV.VCT
  5) GTDIVWIZ.PGFWIZARD.PAGE5.GRDGLOBALEXC.COLUMN1.AASGRIDMONTHVIEW1.SHOWCAL  PROCEDURE GTDIVWIZ.PGFWIZARD.PAGE5.GRDGLOBALEXC.COLUMN1.AASGRIDMONTHVIEW1.SHOWCAL C:\PROGRAM FILES\SOURCE\AASGRID.VCT
  6) AASGRIDMONTHVIEWWIN.TMRDELAYEDACTIONS.INIT  PROCEDURE AASGRIDMONTHVIEWWIN.TMRDELAYEDACTIONS.INIT C:\PROGRAM FILES\SOURCE\AAS.VCT
  7) AASGRIDMONTHVIEWWIN.ERROR       PROCEDURE AASGRIDMONTHVIEWWIN.ERROR C:\PROGRAM FILES\SOURCE\AASGRID.VCT
  8) AASFORM.ERROR                   PROCEDURE AASFORM.ERROR C:\PROGRAM FILES\SOURCE\AAS.VCT
  9) ERRPROC                         ERRPROC.FXP
  10) GETLONGERRORMESSAGE             PROCEDURE GETLONGERRORMESSAGE ERRPROC.FXP

- Bill

Get the best answers to your questions -- See FAQ481-4875.
 
Could the problem be not the code in Init, but something that's getting set based on a Property Sheet entry?

Tamar
 
Thanks for the ideas.
Dave: The code that references aEventList was not yet tolerant of bad array values, so this conceivably could be the problem.. if the Call-stack is wrong about what routine throws the error.

Tamar: Hmmm. I don't know how to prove that isn't the cause of the problem... I just looked through the property sheets for classes:
aasForm (based on Form)
aasForm.tmrDelayedActions (this is the only contained control in aasForm, and is based on Timer)
aasGridMonthviewWin (this is based on aasForm)
aasGridMonthviewWin.cal (this is based on OleControl and contains a 'MSComCtl2.MonthView.2' ActiveX control)

And all the property settings look correct: None of them are variable references, and any that should be character, are.


I've added protection code on the type and existance where the properties are referenced, and TRY..CATCH on the AddProperty calls, so we can see if the problem goes away... when these changes finally get into production and onto customers' machines...

- Bill

Get the best answers to your questions -- See FAQ481-4875.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top