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 / Help with Global Variable please !

Author
Message
Newbie5UK
19
Years of Service
User Offline
Joined: 13th Nov 2004
Location:
Posted: 27th Mar 2006 18:10
Hi,

Am am using a global variable which is declare at the start of my code:-

Global Time_Correction#

And defined as a varible in the main loop....

Time_Correction#=elapsed#/10

Problem is the variable seems to get ignored although it can be printed in the loop...

Question, do I need to declare the Global varibale differently ?

Not an Integer as the varible is typically 0.016 format etc..

Thx
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 27th Mar 2006 18:51
above the main loop

Global myVar As Float or Global myVar#

Do
...do stuff with myVar...
Loop

FREE Automatic file updates for your distributed Games and Apps - see Program Announcements Forum - DBP Demo
Newbie5UK
19
Years of Service
User Offline
Joined: 13th Nov 2004
Location:
Posted: 27th Mar 2006 19:19 Edited at: 27th Mar 2006 19:40
I tried that.... Don't understand what is happening... if I replace the variable which is generated in the loop with a fixed variable pre the Loop it works fine...

If I print the varaible during the loop I can see it changing but the calculation using it don't work... this is puzzling...
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 27th Mar 2006 21:52
post some code in code tags

FREE Automatic file updates for your distributed Games and Apps - see Program Announcements Forum - DBP Demo

Login to post a reply

Server time is: 2024-09-24 19:34:09
Your offset time is: 2024-09-24 19:34:09