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 / DIM thingy

Author
Message
Casper
21
Years of Service
User Offline
Joined: 8th Mar 2003
Location: Netherlands
Posted: 22nd Dec 2003 02:47
im a newbie to basic languages can u give me an example of how to make a dim array which is 40x40? because the in-program help is absolutely CRAP!
Emperor Baal
20
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 22nd Dec 2003 03:21 Edited at: 22nd Dec 2003 03:22
dim example_array(40,40)

example=0
for a=1 to 40
for b=1 to 40
inc example
example_array(a,b)=example
next b
next a

this will make a 40x40 array, example_array(1,1) will be 1 and example_array(40,40) will be 1600


Quote: "
Amd 2500+ | 1024mb pc2700 | A7N8X-X | Geforce4 ti 4200 128mb
"
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 22nd Dec 2003 04:43
dim example_array(39,39)

-RUST-

VB.NET makes me all goose-pimply!
Casper
21
Years of Service
User Offline
Joined: 8th Mar 2003
Location: Netherlands
Posted: 22nd Dec 2003 19:49
thx guys
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 24th Dec 2003 07:26
The difference between the two is that dimensioned arrays are actually base zero. So, 0 to 39 by 0 to 39 is a 40x40 array. Some folks prefer to work with 1 to 40 and use the larger size.
--
TAZ
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 24th Dec 2003 07:33
in general terms, programmers, especially those with a little "old school" in them, will swear by zero-based logic.

-RUST-

VB.NET makes me all goose-pimply! http://www.mod2software.com
Casper
21
Years of Service
User Offline
Joined: 8th Mar 2003
Location: Netherlands
Posted: 24th Dec 2003 21:45
erm i have another problem with loading and saving arrays

whenever i call the load array command the program crashes and says it cant find the saved array. But when i checked, the file IS there and i spelt the filename correctly in both the save and load array commands. Whats going on???
the_winch
21
Years of Service
User Offline
Joined: 1st Feb 2003
Location: Oxford, UK
Posted: 24th Dec 2003 22:48
Never really used the comands but I think you need to use them like

save array "file",array(0)
load array "file",array(0)

Ignore what it tells you in the help file use (0) not the actual number of elements in the array.

dbpro : p166mmx @ 233 : 256mb : sb 128pci : sis onboard
Casper
21
Years of Service
User Offline
Joined: 8th Mar 2003
Location: Netherlands
Posted: 25th Dec 2003 22:53
ok thx it works now.... why is the help so useless??? thats a pretty big oversight if u ask me..
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 26th Dec 2003 02:38
don't worry you'll find plenty more oversights in the current help for dbp

-RUST-

VB.NET makes me all goose-pimply! http://www.mod2software.com

Login to post a reply

Server time is: 2024-11-25 21:35:51
Your offset time is: 2024-11-25 21:35:51