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 / Can anyone help with this code please : )

Author
Message
Chenak
23
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 5th Sep 2003 21:30 Edited at: 5th Sep 2003 21:31
Hi, im having trouble with this bit of code im working on, for some reason i can't get it to work in a function.

this is the code:



cheers

Once you start down the Dark Path, forever will it dominate your destiny...
CattleRustler
Retired Moderator
22
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 5th Sep 2003 21:35
shouldn't you be returning u#, not a#?

-RUST-
Chenak
23
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 5th Sep 2003 21:44 Edited at: 5th Sep 2003 21:47
D'OH

I think i've been working too long

EDIT: It still doesn't work though, it just returns 0

Once you start down the Dark Path, forever will it dominate your destiny...
CattleRustler
Retired Moderator
22
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 5th Sep 2003 21:47


-RUST-
BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 5th Sep 2003 22:27
if u#=<v#

should this be

if u#<=v#

CattleRustler
Retired Moderator
22
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 5th Sep 2003 22:42
yup

-RUST-
Chenak
23
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 6th Sep 2003 01:30 Edited at: 6th Sep 2003 01:32
Try the attached code. i think its a bug, the value wont increament constantly if it is a variable in a function but for some reason, an array can.

Once you start down the Dark Path, forever will it dominate your destiny...
CattleRustler
Retired Moderator
22
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 6th Sep 2003 01:49
not a bug, probably a Scope issue.
define your vars outside of the function (global)

then see if your function works

-RUST-
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 6th Sep 2003 02:00
Yes, saw this post and popped over to the bug forum. There's an explanation there of why I rejected it
Chenak
23
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 6th Sep 2003 02:17
Thanks

Once you start down the Dark Path, forever will it dominate your destiny...

Login to post a reply

Server time is: 2026-07-24 23:12:28
Your offset time is: 2026-07-24 23:12:28