arguments to the main function throught runhugs
Hello, I'm a student in Ouro Preto's University (Brazil) and I have a problem: How can I pass arguments to the main function throught runhugs? I'll need to use a string in the main function. How can I catch the string from command line? For example: runhugs main.hsx test Thank you. Thiago Braga.
Hi there, have a look at the getArgs IO action from the standard System module (http://haskell.org/onlinereport/system.html): foo$ cat runner.hs module Main where import System main = do ls <- getArgs print ls foo$ runhugs runner.hs test ["test"] foo$ hth --sigbjorn ----- Original Message ----- From: "thiagohb" <thiagohb@iceb.ufop.br> To: <hugs-bugs@haskell.org> Sent: Wednesday, February 19, 2003 11:03 Subject: arguments to the main function throught runhugs
Hello, I'm a student in Ouro Preto's University (Brazil) and I have a problem: How can I pass arguments to the main function throught runhugs? I'll need to use a string in the main function. How can I catch the string from command line?
For example: runhugs main.hsx test
Thank you. Thiago Braga.
participants (2)
-
Sigbjorn Finne -
thiagohb