2013-02-19 48 views
0

我有這樣的代碼:知道型式試驗之前在二郎山

    io:format("id retour: ~w\n",[Idretour]), 

我想知道的Idretour

的類型,因爲我想補充一下測試:if Idretour =:= 40 ->

可能是這條線可以幫助我們知道的類型Idretour

io:format("id retour: ~w\n",[Idretour]), 

回答

0

無論Idretour的類型如何,您都可以進行測試if Idretour =:= 40

我想你要找的是:

case Idretour of 
    Int when is_integer(Idretour) -> do_domething_with_int; 
    _ -> not_an_int 
end