Skip to content

Pass declared record key as parameter #602

Answered by hishamhm
PedroHase asked this question in Q&A
Discussion options

You must be logged in to vote

@PedroHase You can do something like this:

-- declare MP
global record MP
    record CallStrategyType
        -- what do call strategies have in common?
    end
    record CallStrategy
        BestEffort: CallStrategyType
        Precise: CallStrategyType
    end
    CreateEventTimer: function(eventName: string, timerInMS: number, strategy: MP.CallStrategyType): nil
end

-- test CreateEventTimer
MP.CreateEventTimer("testEvent", 1000, MP.CallStrategy.Precise)

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by PedroHase
Comment options

You must be logged in to vote
2 replies
@PedroHase
Comment options

@hishamhm
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants