--nextPart1349417.xmmVqDXbTi Content-Type: text/plain; charset so-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline quoth the fabsy: > Hey! > I have been trying to find a goto function in ruby.. > Like this: > > foo: bar > If blabla then GOTO foo Use a function: def foo #whatever foo does foo() if blabla or invert the test: foo() unless !blabla > Is there any command for exiting the app? Yeah: 'exit' > And how do I search ex a textfile for a certain word and delete it? Probably lots of ways. One would be to read the file to a string and use gsub(). See the String and IO docs http://www.whytheluckystiff.net/ruby/pickaxe/html/builtins.html > ------ > > if value == "2" > system('clear') > print "[Opening file..]\n\n" > r_file = File.open( "file", "a") #Wrote this so I wouldn't get an > error like "File doesn't exist". > r_file = File.open( "file", "r") > print "-----\n" > print r_file.read > print "-----" > print "\n" > system ('ruby note.rb') #is there anyway to restart or goto the > beginning of the script? > end > > ----- > > Thanks! -d -- darren kirby :: Part of the problem since 1976 :: http://badcomputer.org "...the number of UNIX installations has grown to 10, with more expected..." - Dennis Ritchie and Ken Thompson, June 1972 --nextPart1349417.xmmVqDXbTi Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.4 (GNU/Linux) iD8DBQBE4i6twPD5Cr/3CJgRAsa1AKCDi5jK7OCJ5CHOPDWILbVEPI//PQCgj/Lo 48iqhnjUfcSUDujbENkEuno 93 -----END PGP SIGNATURE----- --nextPart1349417.xmmVqDXbTi--