Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 list selections
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
the_scott_mans




PostPosted: Tue Apr 01, 2003 9:27 pm   Post subject: list selections

I was just wondering if you had to do somthing special to listed like thing to be able to use the numbers as selections.

EX.

put "" : 14, "Electronics"
put "" : 14, "*************"
put ""
put ""
put "" : 14, "Xbox"
put "" : 14, "1.Games"
put "" : 14, "2.Controllers"
put ""
put ""
put "" : 14, "PS2"
put "" : 14, "3.Games"
put "" : 14, "4.Controller"
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Tue Apr 01, 2003 9:40 pm   Post subject: (No subject)

yes - arrays http://www.compsci.ca/bbs/viewtopic.php?t=366

in array, you can use a variable to get information from another variable without complex if statments. Just read the tutorial Wink
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
the_scott_mans




PostPosted: Tue Apr 01, 2003 10:11 pm   Post subject: (No subject)

so what exactly would i do. I have 17 items listed in my program

would i put

var name : array 1..17 of int


%then put

for i : 1..17
put name (i)
end for

and what exactly would this do i sort of get it
Tony




PostPosted: Tue Apr 01, 2003 10:18 pm   Post subject: (No subject)

well you input item names in there

name(1):=pen
name(2):=mouse
...

better to do it from an external file - we got a tutorial on that too Wink

then when making your selection, you just type the number:

put "pick"
get number

put "you picked ", name(number)
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
the_scott_mans




PostPosted: Tue Apr 01, 2003 10:37 pm   Post subject: (No subject)

I don't quite understand. Where exactly do you put


name(1):=pen
name(2):=mouse

and where is this turtorial
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: