How do i call a specific list's element ?

Just starting out? Need help? Post your questions and find answers here.
User avatar
Primoz128
Enthusiast
Enthusiast
Posts: 212
Joined: Sat Sep 10, 2011 8:25 pm
Location: Slovenia

How do i call a specific list's element ?

Post by Primoz128 »

Code: Select all

NewList key$()
AddElement( key$() )
  key$() = "game maker"
AddElement( key$() )
  key$() = "pure basic"
AddElement( key$() )
  key$() = "workout"

NewMap response$()
response$("game maker") = "game maker response string"
response$("pure basic") = "pure basic response string"
response$("workout") = "workout response string"

; Now we gota also give new options... another map
ForEach key$()
  Debug key$()
Next

Debug response$( key$() ) ; Here i tried to insert this instead: key(1), but it errors... idk what to do
Well i do not know how to access specific list's element...

(ALSO: is there anyone that is willing to help from time to time on skype ? Forums sometimes don't answer a question)
User avatar
luis
Addict
Addict
Posts: 3895
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: How do i call a specific list's element ?

Post by luis »

http://www.purebasic.com/documentation/ ... ement.html

Code: Select all

SelectElement(key$(), 0)
Debug response$( key$() )
"Have you tried turning it off and on again ?"
User avatar
Primoz128
Enthusiast
Enthusiast
Posts: 212
Joined: Sat Sep 10, 2011 8:25 pm
Location: Slovenia

Re: How do i call a specific list's element ?

Post by Primoz128 »

Thanks a lot ^^. Seems like i completely forgot about this.
User avatar
skywalk
Addict
Addict
Posts: 4219
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: How do i call a specific list's element ?

Post by skywalk »

The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
Primoz128
Enthusiast
Enthusiast
Posts: 212
Joined: Sat Sep 10, 2011 8:25 pm
Location: Slovenia

Re: How do i call a specific list's element ?

Post by Primoz128 »

No i need a combination.
Post Reply