hey. im making a phone book program for class and i need help.
basicly im making a phone book program and 1 of the options i put is if the user wants to look up the persons info by whatever info they choose. such as if they wana look up someone whos name is bob. but they also have the option to search by last name, address, phone numbers..... so on. so the code to do that looks like this on my program
Quote:
if search="first name" then
put" whats the persons first name"
get search2
for decreasing i:friendnum..1
if search2=info(i).firstname then
infogive (i)
end if
end for
i want firstname in "info(i).firstname" to be changable. so if the user wants to search by there last name first name would change to the last name variable. so that i dont need to make a new if statement for each of the options they search by. problem is that when i type "info(i).option (option being a variable set by the user. so if they want to search by first name option would=firstname or by house number option would=homenum) it doesnt read option as a variable. is there any way to do it.
basicly i want it to act something like this should but wont act
Quote:
if search="first name" then
option:=firstname
elsif option="last name" then
option:=lastname
elsif option="home phone" then
option:=homenum
elsif option="cell phone" then
option:=homenum
end if
put "whats the persons ", option
get search2
for decreasing i:friendnum..1 %friendnum is the number of friends the user wants to enter in the phone book
if search2=info(i).option then
infogive (i)
end if
end for