我想找到我的劇本要等到用戶點擊回車鍵時使用if...end
`gets`not工作,如果... end`statement
input = 3
if input > 2
puts "input is greater than 2"
gets
puts "this shouldn't appear before I type ENTER"
end
這並不方式工作,我得到
$input is greater than 2
$this shouldn't appear before I type ENTER
我應該怎麼用,而不是gets
暫停腳本?
謝謝你的時間
,您在控制檯看什麼?或從一個文件? – 2013-02-08 11:36:16
代碼對我來說暫停。是否有更多的代碼? – 2013-02-08 11:47:26