Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
A very weird problem...
Message
From
04/12/1998 00:07:11
Chrita Lee
ProMOS Technology Inc.
Hsinchu, Taiwan
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
A very weird problem...
Miscellaneous
Thread ID:
00163956
Message ID:
00163956
Views:
48
Here is some method code of a class in VCX,
let's assume its name is mm_caller, mm_checker
is another method whose code is empty meanwhile.

with this
if .mm_checker()
? "OK"
else
? "Fail"
endif
endwith

And here is defined & overrided code of method
mm_checker in child class:

with this
local bb
bb = CreateObject("cc")
with bb
local aa
do form ff to aa
if empty(aa)
return .F.
endif

.dd = "Hi"
endwith
endwith

Now the weird behavior comes, when form ff indeed return
an empty aa, mm_checker will still *ALWAYS* return .T. to
mm_caller.

But it will return the correct .F. if you write code this
order:

with this
local aa
do form ff to aa
if empty(aa)
return .F.
endif

local bb
bb = CreateObject("cc")
with bb
.dd = "Hi"
endwith
endwith

Is this a problem or CreateObject() or a bug of VFP6?
(It's OK in VFP5) It took me nearly 3 hours to debug
this out...


Chris Lee
Next
Reply
Map
View

Click here to load this message in the networking platform