Jump to content

table find


drk

Recommended Posts

Hi. I need help with "find a string in the table".

Here the code:

-- Anims by Ezz 
  
Anim            = { } 
Anim.__index    = Anim 
  
local validTypes = { 
    pulseOut        = true, 
    fadeIn          = true, 
    fadeOut         = true, 
    move            = true, 
    moveResize      = true 
} 
  
function Anim:Create ( aElem, aType, aTable ) 
    if ( validTypes [ aType ] ) then 
        outputChatBox ( "Passed statement" ) 
    end 
end 
  

If I use "if ( validTypes [ aType ] ) then" and I put "myAnim = Anim:Create ( myElem, pulseOut, { } )" or other thing in pulseOut it doesn't output nothing. If I put "if ( not validTypes [ aType ] ) then" when I put something who isn't in the table it output anyway.

Any help?

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...