Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help Me And I Will Become Your Slave
#21
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
Reply
#22
>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.
Reply
#23
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!!
Reply
#24
EXACTLY which commands haven't you had yet? So then we can see what we can do for you.
Reply
#25
the command in Agamemnus' code Big GrinIM SHARED has not been taught to us
Reply
#26
you could easly look it up...
Reply
#27
look it up ?
Reply
#28
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.
Reply
#29
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. Smile
Reply
#30
ohh ok..lol im so stupidd!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)