Looping through tables for checking?

I am trying to loop through a table of strings. For each index of the table, I want to make a check (if statement).
How would I go about doing this in lua?

Any help is appreciated :smiley:



local dict = {
	key = "val",
	name = "ok",
	isthing = "yes"
}

for k,v in pairs( dict ) do
	if v == "yes" then
		print( "do something" )
	end
end


[editline]22nd March 2015[/editline]

Or



local dict = {"val", "ok", "yes" }

for k,v in pairs( dict ) do
	if v == "yes" then
		print( "do something" )
	end
end


Thanks :smiley: