[ruby-it] Blocchi e cicli

Massimo Arnaudo lavoro a massimo.arnaudo.name
Dom 21 Set 2008 19:53:24 CEST


Ciao a tutti,
lanciando il file ho un errore:

#!/usr/bin/env ruby

require 'pathname'

p = Pathname.new('c:\Download\\')
elenco_file = p.entries # passa all'array i valori della directory
elenco_file_txt = elenco_file.select {|entry| entry.to_s =~ /pdf/ }.sort
puts elenco_file_txt[0] # invia a video il risultato

contatore_file = 0
while elenco_file_txt[contatore_file] = nil {
        puts elenco_file_txt[contatore_file]
        contatore_file=contatore_file+1
        }
        print "non esistono file txt"
    end

SyntaxError: compile error
txt_to_ics_2.rb:20: syntax error, unexpected '{', expecting kDO_COND or
':' or '
\n' or ';'
txt_to_ics_2.rb:23: syntax error, unexpected '}', expecting $end
        from txt_to_ics_2.rb:23

Mi sapreste suggerire l'errore?

Grazie
Massimo
-- 
Posted via http://www.ruby-forum.com/.


More information about the Ml mailing list