3/27/2008

Define local function in Ruby

I will write code like procedural language with Ruby ;-)

Next codes are to define local function and to call it from main function.


  1. def OutputFile
  2. infile = open("filename")
  3. while line = infile.gets
  4. print line
  5. end
  6. end
  7. begin
  8. OutputFile()
  9. end

No comments: