Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
BUG: skip the Assign destroy object or fire a C5 crash
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00893546
Message ID:
00893822
Views:
25
What's happening is an issue with the call stack which is created by the manner in which you've written the code. You insert a RETURN if the object's are equal.
PROCEDURE myobject_assign
  LPARAMETERS myObject
  IF m.THIS.myObject = m.myObject
    RETURN && Here's the problem
  ENDIF
  * here exists code that i want skip if      
  m.THIS.myObject=m.myObject
ENDPROC
You may be doing this simply because
m.This.myObject <> m.myObject
Doesn't work. It doesn't work because initially This.myObject is NULL. Any comparison where one value is null never results in a .T. or .F. value, it only results as null. Due to this you must take null into account in your code. The problem completely goes away by taking this into account
PROCEDURE myobject_assign
  LPARAMETERS myObject
  IF ISNULL(This.myobject) OR m.THIS.myObject <> m.myObject
    THIS.myObject = m.myObject
  ENDIF
ENDPROC
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform