On Fri, Mar 19, 2010 at 9:57 PM, Siep Korteling <s.korteling / gmail.com> wrote: > Reinhard Lange wrote: > >> >> def SplitCode(sCodeFile,sListFile) >> (...) >> What I need is to be able to pass the arguments to the function and call >> it. >> Do I need to: >> ./mycode.rb file1.txt file2.txt >> >> Thanks in advance for any help. > > Don't use a capitalized method name (see Aldric's suggestion); only > classes and constants are capitalized. > Passing arguments to the method is the same as in most languages: > > split_code("file1.txt", "file2.txt") Putting together the previous two suggestions, if you call your script as ./mycode.rb file1.txt file2.txt, then: split_code(ARGV[0], ARGV[1]) Jesus.