Home > database >  How dynamic destruction userobject
How dynamic destruction userobject

Time:10-13

Ask a question

I now do a simple aircraft games, encounter a problem, when the shells to run to the top of the window, unable to make the shell object destruction

I define the shell as a userobject in the object ue_timer set in the shell per second mobile distance, I in this kind of error, tip no CloseUserObject this function, consult everybody, if the object is destroyed themselves

This.=this. Y y - 40
If (this. Y<=0) then
CloseUserObject (this)
End the if

CodePudding user response:

No closeuserobject userobject function,
Window dynamically create openuserobject, should also be closeuserobject on Windows,

In addition, the Suggestions to userobject records to be destroyed, the next window unified destroyed before the timer,

CodePudding user response:

reference 1st floor HXDZLQ response:
userobject closeuserobject function,
Window dynamically create openuserobject, should also be closeuserobject on Windows,

In addition, the Suggestions to record destroyed userobject, unified destroyed before the timer, the next window



Pb12.5 userobject closeuserobject function

CodePudding user response:

Try the destroy

CodePudding user response:

Low version of the pb, no closeuserobject uo, and your use case, uo is on the form, can be closed by a form, modify the code for:

The window of lw
Powerobject lpo

This.=this. Y y - 40
If (this. Y<=0) then
//getparent window
Do
Lpo=this. Getparent ()
If lpo. Typeof ()=window! Then
Lw=lpo
The exit
End the if
Loop while true
//CloseUserObject (this)
If isvalid (lw) then
Lw. Closeuerobject (this)
End the if
end if

CodePudding user response:

Upstairs is
Version about function







CodePudding user response:

My phone is now the lowest version PB7 (so below PB7 unclear). PB7 is closeuserobject.,
Irresponsible, I vaguely remember, there are closeuserobject PB6, in other words, openuserobject/closeuserobject, in pairs is, do you use to get openuserobject, should have closeuserobject this function,

Similar a few programs, I ever did, in fact do not need to destroy userobject, because doing so may consume more resources, you openuserobject an object, also need time and CLOSE it again, still need time, right?
In the existing computer, you wasted this memory, edge is not fraction,

Don't use, I put it hidden, to do a useless tag, the next need openuserobject never useful when face to find, to find, to create a new again.

This way, and the WEB server connection pool, and the general application of memory pool is the same,
They are all at the expense of a small amount of memory for a faster response time,
Of course, we PB programmer, rarely need to use memory pool their management shows, but implicitly

String ls_swap
.
Ls_swap="123"//application memory here
Ls_swap="1"//here in front of the multi-purpose two bytes marked as useless, actual or in the front of memory,

So you also use this kind of thing,

Does not guarantee that this play, in all cases to maintain the lowest consumption,
But since everyone to play, so on the introduction to the big, should be good,

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Of course, if you just want to try the function.
You can openuserobject, try closeuserobject,
  • Related