module INI
def self.read(filename, variable)
File.open(filename).each{ |row|
if row =~ Regexp.new("^" + variable + "=.*$")
return row.scan(Regexp.new("^" + variable + "=(.*)$"))[0]
end
}
end
end
for i in 0..5
puts INI.read("hello/Hello.ini","hello" + i.to_s)
end
2 Ağustos 2007 Perşembe
Read from INI file
Subscribe to:
Kayıt Yorumları (Atom)
0 Comments:
Post a Comment