Gamestudio Links
Zorro Links
Newest Posts
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,454 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19058 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Crash while counting #282099
07/30/09 11:42
07/30/09 11:42
Joined: Jul 2008
Posts: 170
Germany, near Mainz
Nicotin Offline OP
Member
Nicotin  Offline OP
Member

Joined: Jul 2008
Posts: 170
Germany, near Mainz
Hello, I have an odd problem. While starting my level the programm sometimes crashes and sometimes not. This is the part that seem to cause the crash:
Code:
while(count < street_count)//warte bis alle registriert sind
		{
			count = 0;
			for(i=0;i<street_count;i++)
			{
				if(streets[i]!=NULL)
				{
					 diag("\n");diag("Check8.");diag(str_for_num(NULL,i));
					count++;
				}
			}
			wait(1);
		}


Streets[] is an ENTITY* array of 1000 and streetcount is 406
the end of my diag file is

Quote:

...
Check8.373
Check8.374
Check8.375
Check8.376
Check8.377
Check8.378
Check8.379
Check8.380
Check8.381
Check8.382
Check8.383
Check8.384
Check8.385
Check8.386
Check8.387
Check8.388
Check8.389
Check8.390
Check8.391
Check8.392
Check8.393
Check8.394
Check8.395
Check8.396
Check8.397
Check8.398
Check8.399
Check8.400
Check8.401
Check8.402
Check8.403
Check8.404


everytime it crashes, it crashes at this point. But like I sayed, this happens just sometimes



Re: Crash while counting [Re: Nicotin] #282111
07/30/09 12:21
07/30/09 12:21
Joined: Dec 2002
Posts: 616
Austria
Stromausfall Offline
User
Stromausfall  Offline
User

Joined: Dec 2002
Posts: 616
Austria
Originally Posted By: Nicotin
Hello, I have an odd problem. While starting my level the programm sometimes crashes and sometimes not. This is the part that seem to cause the crash:
Code:
while(count < street_count)//warte bis alle registriert sind
		{
			count = 0;
			for(i=0;i<street_count;i++)
			{
				if(streets[i]!=NULL)
				{
					 diag("\n");diag("Check8.");diag(str_for_num(NULL,i));
					count++;
				}
			}
			wait(1);
		}




I don't understand, for what you need the while loop, as there should be no difference between the first and the second iteration of it. I think that
Code:
for(i=0;i<street_count;i++)
			{
				if(streets[i]!=NULL)
				{
					 diag("\n");diag("Check8.");diag(str_for_num(NULL,i));
				}
			}


should work just the same.
Regarding your problem, did you try the following :
Code:
for(i=0;i<street_count;i++)
			{
				if(streets[i]!=NULL)
				{
					 diag("\n");diag("Check8.");diag(str_for_num(NULL,i));
				}
wait(1);
			}


Because maybe the problem is that you try to do too much in a frame/cycle.
Could you also post the text of the error message ?


get the C# wrapper:
for A7.85.4 and A8.30.4, Version 2.3.9
at http://acknexwrapper2.matthias-auer.net/ or visit the thread
Re: Crash while counting [Re: Stromausfall] #282112
07/30/09 12:30
07/30/09 12:30
Joined: Jul 2008
Posts: 170
Germany, near Mainz
Nicotin Offline OP
Member
Nicotin  Offline OP
Member

Joined: Jul 2008
Posts: 170
Germany, near Mainz
The sense in the double loop is that I have models with actions. Firat they get counted "street_count" so I have 406 models total. Now I let them register in the ENTITY* streets[1000] array. The double loop now "waits" untill all models are registerd. So it checks all the streets in the for statement. This as long as all streets are registerd.

But there is no error message and the acklog.txt ends with the snipped I posted before. So no error, nothing.

Anyway, looks like this was the solution. I added the wait(1); in the for loop and now it seems to work. So thank you very much!



Re: Crash while counting [Re: Nicotin] #282117
07/30/09 12:37
07/30/09 12:37
Joined: Dec 2002
Posts: 616
Austria
Stromausfall Offline
User
Stromausfall  Offline
User

Joined: Dec 2002
Posts: 616
Austria
cool, no problem ^^


get the C# wrapper:
for A7.85.4 and A8.30.4, Version 2.3.9
at http://acknexwrapper2.matthias-auer.net/ or visit the thread
Re: Crash while counting [Re: Stromausfall] #282122
07/30/09 12:50
07/30/09 12:50
Joined: Jul 2008
Posts: 170
Germany, near Mainz
Nicotin Offline OP
Member
Nicotin  Offline OP
Member

Joined: Jul 2008
Posts: 170
Germany, near Mainz
Okay, it just happend again. At the same snipped.

At least it don't happen that often anymore

Last edited by Nicotin; 07/30/09 13:10.


Re: Crash while counting [Re: Nicotin] #282133
07/30/09 13:32
07/30/09 13:32
Joined: Dec 2002
Posts: 616
Austria
Stromausfall Offline
User
Stromausfall  Offline
User

Joined: Dec 2002
Posts: 616
Austria
that's really strange, maybe the problem lies in another part of the code smirk


get the C# wrapper:
for A7.85.4 and A8.30.4, Version 2.3.9
at http://acknexwrapper2.matthias-auer.net/ or visit the thread
Re: Crash while counting [Re: Stromausfall] #282134
07/30/09 13:44
07/30/09 13:44
Joined: Jul 2008
Posts: 170
Germany, near Mainz
Nicotin Offline OP
Member
Nicotin  Offline OP
Member

Joined: Jul 2008
Posts: 170
Germany, near Mainz
Yeah, I'll keep my eyes open. But I only can imagine that the problem is in there.
Hrm but there were so many bugy that I couldn't even imagine, that wouldn't supprise me now^^




Gamestudio download | chip programmers | 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