Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / could someone please help me? (DBP)

Author
Message
crazeymark
20
Years of Service
User Offline
Joined: 3rd Nov 2003
Location:
Posted: 18th Mar 2007 05:05
Hi, I'm getting some strange things happen when i run my code. For some reason when i run my code the program closes itself with an "This program has encounterd an error and needs to be closed" error. i have checked my code many times and found a few bugs, corrected them and still i get this error. Dark Basic Pro will not hint at what is wrong. I ran my program in stepthrough mode to see if it would shed any light on the matter although it sadly didnt although for some reason its not going into some of my FOR loops.

here is the code i'm useing and sorry if its not to neat. I have also included my array maps at the end incase this makes any difrence.



If anyone can help i would be V greatful also i have attached the media used and the project files.

Attachments

Login to view attachments
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 18th Mar 2007 17:26
Lots of things wrong I'm afraid.

1.
Reason for crash is you are calling setup routine again and again in main loop. Very silly.

2.
When building Red stuff, you have missed # on variable Red_Start_Range

3.
When you gosub a label, do not put : on end of line. Should just be
gosub label

4.
FOR loops are completely wrong.

You have things like;
For B = Blue_Start_Range# to B = Blue_Total#
they should just be;
For B = Blue_Start_Range# to Blue_Total#

5.
Even worse, you cannot have OR commands in FOR loops like you have done;
For Bullet = Bullet_Start_Range# to bullet_stop#=1 or bullet=(bullet_start_range# + bullet_max#)

6.
Variables that will always be whole numbers, like object numbers, max ship numbers, etc should not be defined as fractional values (ie with a # on end). Should just use variables like Red_Start_Range, Ship_Max_Red, etc.

7.
Where you do =< is not standard way. Shoule be <=

8.
If at all possible, avoid using 3DS files, they are extremely buggy in DBPro and many users find they take ages to load or don't even load at all. Try and use .x or .dbo files instead.

Hopefully that will get you back on track

Boo!
crazeymark
20
Years of Service
User Offline
Joined: 3rd Nov 2003
Location:
Posted: 18th Mar 2007 18:30
thanks a ton for your help. i didnt notice alot of that stuff lol, i'll goto my backup copy before i started to "debug" it, since i changed alot of the things and according to your list i just made things worce. as for the setup in the main loop >.< i RELY didnt notice that. so again thanks a bunch i'm very greatfull and i hope you have a nice day

Login to post a reply

Server time is: 2024-09-25 19:26:09
Your offset time is: 2024-09-25 19:26:09