ETk problem

Torbjorn Tornkvist tobbe@REDACTED
Fri Jan 21 08:16:59 CET 2000


> ...contains only [-0-9.] or other characters as well. I don't think this
> behaviour is very useful, but I could live with it if only I knew an
> Erlang function to test for being a number or for being a string. Is
> there such a function? ....

You can use guards, e.g:

  ....
  case tk:cmd(Entry, [get]) of
    I when integer(I) ->
      ....;
    L when list(L) ->
      ....
  end,
  ....


Cheers /Tobbe
--
Torbjörn Törnkvist , tel: +46 8 692 22 15 , fax: +46 8 654 70 71
Bluetail AB , Hantverkargatan 78 , SE-112 38 Stockholm , Sweden            
Email: tobbe@REDACTED , Web: http://www.bluetail.com/~tobbe



More information about the erlang-questions mailing list