Re: [Wtr-general] hi, Is there a GOTO function for watir

2007-03-28 Thread Paul Carvalho

No.

Read this important article : http://en.wikipedia.org/wiki/Spaghetti_code

Please rethink how you structure your code.  I *highly* recommend taking a
course on Programming Concepts and Design if you haven't done any formal
structured programming/scripting in a *long* time.

GOTO's bad.  Very, very bad.  =P

Good luck!  Cheers.


On 28/03/07, Maloy kanti debnath [EMAIL PROTECTED] wrote:


hi,

IS there any function which is simlar like VB 6.0 GOTO so
that we can say
if condition
goto line 8
else
goto line 20
end


thanks
Maloy

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

[Wtr-general] hi, Is there a GOTO function for watir

2007-03-27 Thread Maloy kanti debnath
hi,

IS there any function which is simlar like VB 6.0 GOTO so that 
we can say 
if condition
goto line 8
else
goto line 20
end


thanks
Maloy
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] hi, Is there a GOTO function for watir

2007-03-27 Thread Chris McMahon
On 3/28/07, Maloy kanti debnath [EMAIL PROTECTED] wrote:
 hi,

 IS there any function which is simlar like VB 6.0 GOTO so 
 that we can say
 if condition
 goto line 8
 else
 goto line 20
 end

GOTO is not a very good way to do such things.  Try using methods:

###
conditional = yes

#def/end is one method
def method_eight
  puts this is not line 8
end

def method_twenty
  puts this is not line 20
end

if conditional == yes
  method_eight  #invoke method_eight above
  conditional = no
end

if conditional == no
  method_twenty
end
###
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general