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 / Changing Variables In Functions

Author
Message
GameKit
21
Years of Service
User Offline
Joined: 6th Mar 2003
Location: USA, Staring Blankly at a Computer
Posted: 21st Aug 2003 04:22
I have been programming in DarkBASIC Classic for around 2 years now, but i only recently switched to DB Pro.
Does Anyone know why can't you change the values of global variables from inside a function?...I'm working on a 3-D(3-D with 2-D perspective) space combat game, and I need to change The Data Of An Array Depending On What Numbers I Put In The Function Brackets...Here Is The Skin And Bones (about 5%) of my space game (without any media)...The following code won't work and i can't figure out why other than what i just explained...



But This Code Works Fine And It's Almost exactly the same code as before...



Any Ideas/Solutions Would Be Appreciated, and Thanks In Advance...

Anyone Can Destroy...But Few Can Create...
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 21st Aug 2003 05:13
Works now! I think your main problem was trying to use floats as keys to the array which can only be integers. Also had to rename Type as Typ as Type is a reserved word.

The programmer formerly known as sonic
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 21st Aug 2003 05:14
Even the following fails:



The programmer formerly known as sonic
GameKit
21
Years of Service
User Offline
Joined: 6th Mar 2003
Location: USA, Staring Blankly at a Computer
Posted: 21st Aug 2003 07:35
Wow!!!...Thanks Spooky... It works perfectly now!!! I've been caught up on that for the past three days... but now it works... yay!!!...well...thanks again...

Anyone Can Destroy...But Few Can Create...

Login to post a reply

Server time is: 2024-11-25 04:54:15
Your offset time is: 2024-11-25 04:54:15