Hi,
Can someone tell me how to implement a "go to" kind of statement in
RUBY--GOTO, like in DOS or Windows scripts? If I do an "if" statement
for certain files in a directory, I want to "go to" other parts of the
program to execute certain stuff, kind of like a subroutine. In fact,
does RUBY have subroutines, or, does one simply use methods?
Hi,
Can someone tell me how to implement a "go to" kind of statement in
RUBY--GOTO, like in DOS or Windows scripts? If I do an "if" statement
for certain files in a directory, I want to "go to" other parts of the
program to execute certain stuff, kind of like a subroutine. In fact,
does RUBY have subroutines, or, does one simply use methods?
Thanks,
Peter
Hi Peter, "goto" is an ancient philosophical paradigm.
These type of subroutines were replaced with functions (defined by 'def'
in ruby), it looks like this: