i'm writing a method within the Akill class that cascades down 2 sql 
stmts inside some if and when stmts....but i get this when i added the 
last branch of if stmts: what happened note : ALL 'end' stmts are 
properly matched
>> class Akill
>>    def getusd(prem,cust,serv,scat,readit)
>>          cursor=@@conn.exec("<<a working sql stmt here>>>")
>>          k=Array.new
>>     while r=cursor.fetch() and k.size<3
>>          k.push(r)
>>     end
>>       cursor.close
>>       if k.size>0
>>        k.first
>>       else
?>          cursor=@@conn.exec("<<a working sql stmt here>>>")
>>          k=Array.new
>>           while r=cursor.fetch() and k.size<3
>>             k.push(r)
>>           end
>>          cursor.close
>>              if k.size>0
>>                 k.first
>>      else
?>             #get defaults of kwd=0,kvar=700,kwh=1500
?>             #else nil
?>                  case scat
>>                  when scat=='KWH' 1500
>>
Display all 459 possibilities? (y or n)
==                             SecurityError
===                            Signal
=~                             SignalException
ARGF                           SimpleDelegater
ARGV                           SimpleDelegator
Akill                          SingleForwardable
ArgumentError                  SizedQueue
Array                          StandardError
BEGIN                          String
Bignum                         Struct
Binding                        Symbol
CROSS_COMPILING                SyntaxError
Class                          SystemCallError
Comparable                     SystemExit
ConditionVariable              SystemStackError
Config                         TOPLEVEL_BINDING
Continuation                   TRUE
Data                           Tempfile
Date                           Thread
DateTime                       ThreadError
DelegateClass                  ThreadGroup
Delegater                      Time
Delegator                      TrueClass
--Mor>>  scat=='KVAR' 700
>>
Display all 459 possibilities? (y or n)
==                             SecurityError
===                            Signal
=~                             SignalException
ARGF                           SimpleDelegater
ARGV                           SimpleDelegator
Akill                          SingleForwardable
ArgumentError                  SizedQueue
Array                          StandardError
BEGIN                          String
Bignum                         Struct
Binding                        Symbol
CROSS_COMPILING                SyntaxError
Class                          SystemCallError
Comparable                     SystemExit
ConditionVariable              SystemStackError
Config                         TOPLEVEL_BINDING
Continuation                   TRUE
Data                           Tempfile
Date                           Thread
DateTime                       ThreadError
DelegateClass                  ThreadGroup
Delegater                      Time
Delegator                      TrueClass
--Mor>>  scat=='KWD' 0
>>
Display all 459 possibilities? (y or n)
==                             SecurityError
===                            Signal
=~                             SignalException
ARGF                           SimpleDelegater
ARGV                           SimpleDelegator
Akill                          SingleForwardable
ArgumentError                  SizedQueue
Array                          StandardError
BEGIN                          String
Bignum                         Struct
Binding                        Symbol
CROSS_COMPILING                SyntaxError
Class                          SystemCallError
Comparable                     SystemExit
ConditionVariable              SystemStackError
Config                         TOPLEVEL_BINDING
Continuation                   TRUE
Data                           Tempfile
Date                           Thread
DateTime                       ThreadError
DelegateClass                  ThreadGroup
Delegater                      Time
Delegator                      TrueClass
--MorDir                            TypeError
END                            UnboundMethod
ENV                            VERSION
EOFError                       Win32API
Enumerable                     ZeroDivisionError
Errno                          _
Exception                      __id__
Exception2MessageMapper        __send__
FALSE                          `
FalseClass                     abort
File                           alias
FileTest                       and
Fixnum                         at_exit
Float                          autoload
FloatDomainError               autoload?
Forwardable                    begin
GC                             binding
Gem                            bindings
Hash                           block_given?
IO                             break
IOError                        callcc
IRB                            caller
IndexError                     case
--More--Integer                        catch
--More--Interrupt                      cb
Kconv                          chomp
Kernel                         chomp!
LoadError                      chop
LocalJumpError                 chop!
Marshal                        chws
MatchData                      class
MatchingData                   clone
Math                           conf
Method                         context
Module                         cws
Mutex                          cwws
NIL                            def
NameError                      defined
NilClass                       display
NoMemoryError                  do
NoMethodError                  dup
NotImplementedError            else
Numeric                        elsif
OCI8                           end
OCIBind                        ensure
OCIBreak                       eql?
OCIContinue                    equal?
--More-->> d
>>              end
>>       end
>>     end
>> end
>> end
SyntaxError: compile error
(irb):182: syntax error
(irb):183: syntax error
(irb):184: syntax error
(irb):190: syntax error
        from (irb):190
        from ?:0
>>

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