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 / Choosing the highest / lowest number from many

Author
Message
Quel
17
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 30th Aug 2010 15:58
I don't think - but i hope - i'm gonna ever be able to help people here with very Dark Basic specific stuff, but i currently had a little task i needed this code for, and i'm happy i can finally put something here other than asking for help. Hope it helps anybody ever in the future.

So i guess this is rather for beginners, but a helpful little piece, if you have a bunch of data stored like this way:

'dim numbers(100)'
'numbers(1)=random number'
'numbers(2)=random number'
'numbers(3)=random number'
'.....'

You can get the highest and the lowest with this short code.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 30th Aug 2010 22:04
That doesn't work - you've got a typo. You have nums(t) in one place and nums#(t) in another.

The basic idea works though.
Quel
17
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 31st Aug 2010 00:08
Yeah, i rushed it out from my game, and checked it many times, but this is me i can't help it... sorry.

Anyway, this may help some think about the code, and not just copy it in...
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 31st Aug 2010 00:37
Good point.

Login to post a reply

Server time is: 2026-07-23 12:09:46
Your offset time is: 2026-07-23 12:09:46