Gamestudio Links
Zorro Links
Newest Posts
FXCM => AVA Trade Plugin???
by Martin_HH. 11/25/26 21:59
No connection to MT4
by Martin_HH. 11/23/26 06:38
MinMax function on History t6 file
by LucasJoshua. 11/21/26 14:28
What are you working on?
by rayp. 11/20/26 18:10
contractUpdate() is filtering if >2 rows
by mistery. 11/09/26 12:06
New Zorro version 3.15
by jcl. 11/09/26 09:24
Removing outliers from files
by jcl. 11/04/26 10:30
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 9,630 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EvanTJ, rht, MaliceTheMaker, Haitao_Ren, JimSimons
19250 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
while loop problem #415518
01/19/13 19:31
01/19/13 19:31
Joined: Feb 2012
Posts: 371
Dico Offline OP
Senior Member
Dico  Offline OP
Senior Member

Joined: Feb 2012
Posts: 371
hi all
i have a strange problem (i think ) in "while loop" and i cant fixed that

there is something strange .When i call functions contain the while loop more than once
the function become very fast , why ?

Re: while loop problem [Re: Dico] #415519
01/19/13 19:41
01/19/13 19:41
Joined: Oct 2008
Posts: 683
Germany
Ayumi Offline
User
Ayumi  Offline
User

Joined: Oct 2008
Posts: 683
Germany
Maybe, you should post the part of code

Re: while loop problem [Re: Ayumi] #415522
01/19/13 20:05
01/19/13 20:05
Joined: Feb 2012
Posts: 371
Dico Offline OP
Senior Member
Dico  Offline OP
Senior Member

Joined: Feb 2012
Posts: 371
this part of my code

Code:
function move_panel(PANEL* pnl)
{
   while(pnl)
   {
     pnl.pos_x += move_temp * time_step;
     wait(1);
   }
}



Code:
position_p = 10 * mouse_force.x; 
  accelerate(temp_move,position_p,1);


when i destroy pnl at runtime and recall it Again , i get it very fast

Last edited by Dico; 01/19/13 20:11.
Re: while loop problem [Re: Dico] #415524
01/19/13 20:20
01/19/13 20:20
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
because pnl doesn't get reset to NULL if you call ptr_remove
you need to destroy the function by your own

the double speed is because of gamestudio allocating behaviours
you don't get an invalid pointer but a pointer to your new PANEL

so the funtion runs twice


Visit my site: www.masterq32.de
Re: while loop problem [Re: MasterQ32] #415528
01/19/13 21:21
01/19/13 21:21
Joined: Feb 2012
Posts: 371
Dico Offline OP
Senior Member
Dico  Offline OP
Senior Member

Joined: Feb 2012
Posts: 371
thnks MasterQ32 , i put a condition in "while loop" and it works


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1