So, I want to write some code so that the user cannot type in a city that is not in the city list, the city_list array is a one dimensional array of size 5 which values are A,B,C,D and E. So what I did was this
character, dimension(5) :: city_list
do i=1,5
city_list(i)= achar(i+64) !To give the array a,b,c values to its first five components
end do
character :: City1, ...
do while(ANY(City_list == City1) )
READ*, City1
PRINT*, "IT'S GOT TO BE A,B,C,D,E"
end do
So I used the ANY function that I saw in another post, but I can' get to use it well, it doesn't seem to do what I asked it to do