Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Redefine THIS. error
Message
From
19/05/2021 15:55:29
 
 
To
19/05/2021 15:50:27
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
01680602
Message ID:
01680607
Views:
34
I checked the code and nothing obvious. I think when the instantiation fails the reference to the object remains. And then when the code tries to instantiate the second (or third) time, something is attempted to be "redefined". I did away with this attempt to instantiate the form 3 times. So, this will not be repeated.
Thank you.

>That are the values for aAppForms[nRow,3] and aAppForms[nRow,6]? it is possible one of these could the the 'THIS'?
>
>
>>>Hi,
>>>
>>>Do you know what would cause the error?
>>>
>>>cannot redefine THIS.
>>>
>>>
>>>TIA
>>
>>This is the code that caused the above error. Note that I am trying to create a reference to a window 3 times. What happens is the 1st time the actual error shows (dreaded ... error reading .... myprg.fxp)
>>
>>But on the 2nd and 3rd time, the error is "CANNOT REDEFINE THIS."
>>
>>Of course, I will remove this code that tries to instantiate the window 3 times. But I would to learn what causes it.
>>
>>Here is the code:
>>
>>FOR iTry = 1 TO 3
>>		
>>	*-- Start with No Problem
>>	lProblem = .F.
>>	TRY 
>>		aAppForms[nRow,5] = NEWOBJECT( aAppForms[nRow,3], aAppForms[nRow,6] )
>>	CATCH TO oError
>>		lProblem = .T.
>>		cCompName = GetEnv("COMPUTERNAME")
>>		TRY 
>>	 		STRTOFILE( TTOC(DATETIME()) + " Try: " + ALLTRIM(STR(iTry)) + " Failed to 
>>                    create NEWOBJECT() in OpenAppForm() Class: " + aAppForms[nRow,3] + " Lib: " + 
>>                    aAppForms[nRow,6]  + oError.message + CHR(13) + CHR(10), GetGlobal(2) + 
>>                   "create_object_problems.log", 1 )
>>	 	CATCH 
>>	 	ENDTRY 
>>	ENDTRY 
>>	IF lProblem
>>        	*-- Wait 2 seconds and then try again.
>>		INKEY(2)
>>		LOOP 
>>	ELSE 
>>		EXIT 			
>>	ENDIF 
>>ENDFOR 
>>
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform