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.

DarkBASIC Professional Discussion / DBPCompiler.exe crash for no reason?

Author
Message
MASTER OF PUPPETS
22
Years of Service
User Offline
Joined: 9th Jun 2004
Location: Trapped Under Ice
Posted: 3rd Aug 2010 07:28 Edited at: 3rd Aug 2010 07:31
ok,
im getting the infamous "windows error report" pop up everytime i
attempt to compile my code.
the thing that gets me is that the code doesnt really even do
anything yet. I mostly just call out a whole bunch of global
statements(EX. GLOBAL CH_WEAP_INDEX AS INTEGER).
it was working fine then all of a sudden...."NOPE! THANKS FOR PLAYIN'!"

...anyway, is there a problem with too many variables being stored
in memory or something? i have 1gig ram so it doesn't make sense that
this would be the problem.

i went ahead and attached the whole project folder so you fellas can
compile it on your machines and give me some feedback. Does it run
or your machine? If so what are your specs? If not...what am i doing
wrong????

thanks

[EDIT]
I didn't realize that i crammed the text in this post to the left like that sorry.

metal is not music but a way of life...all hail to the reigning king METALLICA!!!
Hodgey
16
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 3rd Aug 2010 08:02
Hi, I think the problem is that you have globals inside your UDTs. When I deleted the global part of the declaration inside your UDTs, your program worked.

So instead of this


Try this


Hope this helps

A clever person solves a problem, a wise person avoids it - Albert Einstein
MASTER OF PUPPETS
22
Years of Service
User Offline
Joined: 9th Jun 2004
Location: Trapped Under Ice
Posted: 3rd Aug 2010 08:09 Edited at: 3rd Aug 2010 08:28
where would the global go in this?



it was working fine with the globals as they are then all of a sudden it wasn't. i'm at a loss so i will attempt to follow your advice and see if it works for me. thanks

[EDIT]

I just made a simple test program. it compiled fine with the globals in the "type" declaration.
i added a function to see if the "global" thing was even necessary and it returned my values accurately.

is the whole - placing "global" before your variables - thing outdated or redundant with the way i have set up the included files
in this project?

[EDIT AGAIN]

I removed all the "global"'s like you said and it runs fine.

in the test program that i uploaded, i can compile the code with "global" right before...

dim test(0) as test_type

so it looks like...

GLOBAL dim test(0) as test_type

is this the most effective way of doing this?
does it make all the internal variables of the "type" global?

THANKS SO MUCH!!!

metal is not music but a way of life...all hail to the reigning king METALLICA!!!
Hodgey
16
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 3rd Aug 2010 08:41
Yeah I just realized that I should have done a quick test to see if a type can have a global inside it and it seems to compile if a global is inside a type but I'd like to know why your program worked when I took out the globals inside the types.

Something to think about

Quote: "is the whole - placing "global" before your variables - thing outdated or redundant with the way i have set up the included files
in this project?
"

I think globals are only necessary when you are manipulating data with functions because functions have local variables. You seem to use subroutines which, from memory, don't require globals so you don't really need them.

A clever person solves a problem, a wise person avoids it - Albert Einstein
MASTER OF PUPPETS
22
Years of Service
User Offline
Joined: 9th Jun 2004
Location: Trapped Under Ice
Posted: 3rd Aug 2010 08:48
do you mean variables outside of an array would require "global"
look at my example file just above...

the function processes the return values without a "global"

and its an "#include(d)" type file so...
i don't know......ugh! just UGH!!! haha

metal is not music but a way of life...all hail to the reigning king METALLICA!!!
Clonkex
Forum Vice President
16
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 3rd Aug 2010 10:12
Hi guys,

On my machine (WinXP SP3) when I compile with this:

it works fine. I dunno what your problem is. Also I put my type declarations before loading any 3d models or images.

Clonkex

Making games is easy.....finishing them is a different matter.

Intel Core 2 Duo 2.8Ghz, Nvidia GeForce 9400 GT 512mb, 1gb ram.
MASTER OF PUPPETS
22
Years of Service
User Offline
Joined: 9th Jun 2004
Location: Trapped Under Ice
Posted: 3rd Aug 2010 10:23 Edited at: 3rd Aug 2010 10:25
look at the two uploads of mine. the first is my program with all the globals like you have them. It WAS working fine. Then, (because every 10 or so minutes i compulsively compile) i pressed F5 and got the "windows error report" referring to DBPCompiler.exe as the culprit.

[EDIT]

if you look at the code, you will see, it just about does nothing even if it compiled properly!
Like i said before, maybe its some sort of MEMORY OVERLOAD or something..
i dont know...

metal is not music but a way of life...all hail to the reigning king METALLICA!!!
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 3rd Aug 2010 12:43
I'm fairly sure typed variables are globals anyway, so you've probably confused the compiler by adding the unnecessary GLOBAL into the type definition. Also, GLOBAL is usually used for variable declarations not type definitions.

For example, the following code works fine - the variable var is automatically assumed to be global so the function myPrint() prints the values correctly.

MASTER OF PUPPETS
22
Years of Service
User Offline
Joined: 9th Jun 2004
Location: Trapped Under Ice
Posted: 3rd Aug 2010 13:17
ok gotcha.
My code is working now.
thanx guys

metal is not music but a way of life...all hail to the reigning king METALLICA!!!

Login to post a reply

Server time is: 2026-07-25 08:29:43
Your offset time is: 2026-07-25 08:29:43