Discussion: whats the error here?
Afficher un message
Vieux 11/03/2008, 23h45   #1
Adam Akhtar
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut whats the error here?

My IDE (aptana rails) seems to complain about syntax with this code

def initialize(size=2)
@size = size
@template = {'1'=> [" # ", "@ @"," # ", "@ @", " # "],
'2'=>[" # ", "@ @"," # ", "@ @", " # "],
'3'=>[" # ", "@ @"," # ", "@ @", " # "],
'4'=>[" # ", "@ @"," # ", "@ @", " # "],
'5'=>[" # ", "@ @"," # ", "@ @", " # "],
'6'=>[" # ", "@ @"," # ", "@ @", " # "],
'7'=>[" # ", "@ @"," # ", "@ @", " # "],
'8'=>[" # ", "@ @"," # ", "@ @", " # "],
'9'=>[" # ", "@ @"," # ", "@ @", " # "],
'0'=>[" # ", "@ @"," # ", "@ @", " # "]}
@numrows = @template[0].length

end

def HorizontalBarPrint chr,segment

lcdchar = @template[chr][segment] #### DOESNT LIKE THIS BIT

end

end

Whats wrong with lcdchar = @template[chr][segment] ???

Is it because @template is a class variable and lcdchar is trying to
point to it thus allowing for the possibility of accesing the contents
of the class variable from outside of the class??? All i want to do is
to copy the contents to the variable lcdchar.

Anyone got any ideas?????
--
Posted via http://www.ruby-forum.com/.

  Réponse avec citation
 
Page generated in 0,07330 seconds with 9 queries