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 / Not letting me declare a Global, why?

Author
Message
Qqite
16
Years of Service
User Offline
Joined: 28th Feb 2010
Location: Florida, U.S.
Posted: 28th Dec 2010 20:54
I am adding gravity and jumping into me fps project, but it's not liking what I'm doing. Everything works fine if you take out all the code with gravity but when I try to compile it tells me and "Initialisation data '1' is incompatible at line 15 (Global gravity# = 1)

I am using Sparky's for collision



Ventures of the worlds around us are only limited by imagination.
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 28th Dec 2010 21:00
You need to declare it in the correct format. Since you use the # sign, that means the variable is a float. You need to give it a float variable, so declare it as 0.0

My signature is NOT a moderator plaything! Stop changing it!
Eminent
16
Years of Service
User Offline
Joined: 15th Jul 2010
Location:
Posted: 29th Dec 2010 05:33
How you do it is:
Global Variable as float = 1.00
Just in case you don't know.


Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 31st Dec 2010 11:38
You don't even need to use the 'As Float' if the variable ends with '#' as it's the sign for float.

My signature is NOT a moderator plaything! Stop changing it!

Login to post a reply

Server time is: 2026-07-18 07:31:54
Your offset time is: 2026-07-18 07:31:54