Preventing an Event From Firing Twice


Sometimes an object's event will fire more than once. If this causes your code to run more than once, the following strategy will fix the problem. In your autoexec script add the following code.

dim global busy as L
busy = .f.

Then add this code at the top of the object's OnArrive event script.

if busy
end if
busy = .t.

When the user is leaving the object, add the following code to the OnDepart event script.

busy = .f.

This allows the user to return to the object later.

See Also