the following code works using 2 1-dimensional arrays, as requested:
dim cities$(6)
dim populations(6)
for x = 1 to 6
read cities$(x)
read populations(x)
next x
do
cls
city1 = 0 : city2 = 0
for x = 1 to 6
set cursor 0,(x*20)
print x,") ",cities$(x)," = " ,populations(x)
next x
print
print "Combine Populations:"
while city1 < 1 or city1 > 6
input "City 1? ",city1
endwhile
while city2 < 1 or city2 > 6 or city2 = city1
input "City 2? ",city2
endwhile
print
totalpop = populations(city1) + populations(city2)
print "Combined Populations for " ,cities$(city1), " & ", cities$(city2), ": ",totalpop
print
input "press <enter> to continue",enter$
loop
data "London", 750000, "Cairo", 7500000, "Mexico City", 8700000
data "Tokyo", 12800000, "Sydney", 4100000, "New York City", 8200000
note how the 2 arrays are
DIMed (a little different from how you were going about it) and how the 2 arrays are filled by reading 2 data statements per loop. ie, how they coincide with eachother.
good luck!
edit: ACK! it worked before i pasted it. will be back with working code ASAP.
edit2: <shrugs> now it's working. i musta pasted it wrong
Virtual Nomad
AMD XP 1800+ (~1.6 Ghz) / 1.5 GB RAM
ATI Radeon 8700LE 128 MB / Windows XP