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 Discussion / Bug or not a bug?

Author
Message
Compton
22
Years of Service
User Offline
Joined: 4th Dec 2002
Location:
Posted: 26th Sep 2003 18:31
Hi,

I was kind of wondering if this was a bug. Today I was programming on a new game I'm making and had this value that had to be reset to zero. The value however was in a function. I spent about 2 hours trying to reset it over and over again, yet it wouldn't reset. It would however continue to count up, like I told it to. After menu entry however, and going back there it had to be reset to zero again. It wouldn't do that.

At first I did wanda=0 at the menu, then I tried it in the first of the screen in question, still no budge. Then I figured what the hell, I can also do it inside the header of the value like so:

function newspaper(text$,alex)
if alex=1 then wanda=wanda+15
if alex=2 then wanda=0
end function newspaper

That worked! Now, I wonder. Is it a bug or is it a safe call against a thinking mistake that could have made a booboo?

I can't imagine Lee not having a reason for this, what I ask you is the reason?



Think 'what is the reason'-Merovingian here
Compton
22
Years of Service
User Offline
Joined: 4th Dec 2002
Location:
Posted: 27th Sep 2003 16:39
So no one has an answer on this huh?
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 28th Sep 2003 07:53 Edited at: 28th Sep 2003 07:58
Dude, i doubt its a bug... id say its because of the way you've done your function...

Noone answered cos you had a problem then solved it then decided to post the fact that you had solved your own problem... think about it, who will post?

[EDIT]
It IS your function, your not settin the value of wanda out side of the function.. you are currently exporting the variable "newspaper" which apparently doesnt exist inside of the funtion (i am assuming this because that is the name of your function). For a variable's value that has been set INSIDE a function, to get its value from outside of the function you need to tell the function to export that variable ie your function should have at the end:

ENDFUNCTION wanda

wanda being the variable that is exported.
try this out and tell me if it works.

If Quizz's Are Quizzical, Then What Are Test's?

Login to post a reply

Server time is: 2025-05-20 14:39:06
Your offset time is: 2025-05-20 14:39:06