Posts: 64
Threads: 11
Joined: Sep 2003
DIM SHARED city.amount%: city.amount% = 10
DIM SHARED price.to.city%(1 TO city.amount%, 1 TO city.amount%)
DIM SHARED city.name$(1 TO 2, 1 to city.amount%) '(2) is (0 TO 2)
didnt quite get that
city.name.from$ = UCASE$(city.name.from$)
city.name.to$ = UCASE$(city.name.to$)
that
IF city.name.from$ = temp$ THEN city.from% = j%
IF city.name.to$ = temp$ THEN city.to% = j%
and that
Posts: 3,368
Threads: 195
Joined: Jan 2003
>DIM SHARED city.amount%: city.amount% = 10
>DIM SHARED price.to.city%(1 TO city.amount%, 1 TO city.amount%)
>DIM SHARED city.name$(1 TO 2, 1 to city.amount%) '(2) is (0 TO 2)
SHARED means that the array is accessible in all subs and functions; it is global.
% added to a variable means it is an signed INTEGER, a number with a value from -32768 to 32767.
array1(10, 10) is an array with two dimensions from 0 to 10.
array1(4 TO 10, 4 TO 10) is an array with 2 dimensions from 4 to 10.
>city.name.from$ = UCASE$(city.name.from$)
>city.name.to$ = UCASE$(city.name.to$)
$ is a string variable. UCASE$ makes all the letters of what's inside it uppercase. This is necessary to compare the city names to your own list of city names. ("Bangladesh" should actually be "BANGLADESH"..)
>IF city.name.from$ = temp$ THEN city.from% = j%
>IF city.name.to$ = temp$ THEN city.to% = j%
This compares both of the cities and, if the city matches temp$, which is the city with index j%, it gets the current j% to later get:
price.to.city%(city.from%, city.to%)
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Posts: 64
Threads: 11
Joined: Sep 2003
yeah, it does work but theres still one problem
see, where ive been taught QB, all these commands have not been used and ppl get very suspicious if i use extra commands..
i know it sounds stupid but still we have been taught only :
DIM (a,b)
OPEN blah blah blah
INPUT #
CLOSE
Etc.
And of cource basic commands and loops
So i dont want to sound dumb or anything but i SERIOUSLY cant use the code uve givin!!
Posts: 1,845
Threads: 44
Joined: Aug 2002
EXACTLY which commands haven't you had yet? So then we can see what we can do for you.
Posts: 64
Threads: 11
Joined: Sep 2003
the command in Agamemnus' code
IM SHARED has not been taught to us
Posts: 269
Threads: 44
Joined: Oct 2002
you could easly look it up...
Posts: 64
Threads: 11
Joined: Sep 2003
Posts: 3,368
Threads: 195
Joined: Jan 2003
Yes....... click on the command...... then open up the help menu......
You can get rid of "shared" if you want to....
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Posts: 1,845
Threads: 44
Joined: Aug 2002
Yes, if you haven't been taught how to do SUBs and FUNCTIONs yet, you can just delete the 'SHARED' and the program will still work.
Posts: 64
Threads: 11
Joined: Sep 2003
ohh ok..lol im so stupidd!