123456789101112131415161718192021222324252627
#!/usr/bin/env ruby # $Id: test_scanw.rb,v 1.1 2003/03/22 22:55:00 t-peters Exp $ # # Test of the scanw function. Should really not be used in any serious curses # program. To use it, install scanf for ruby. # Copyright (C) 2003 Tobias Peters <t-peters@users.berlios.de> # # No warranties. Share and enjoy. require "ncurses" begin Ncurses.initscr Ncurses.mvaddstr(4, 19, "Give me a number: ") Ncurses.refresh num = [] Ncurses.scanw("%d", num) Ncurses.mvprintw(6, 19, "You gave: %d", num[0]) Ncurses.refresh sleep 1 ensure Ncurses.endwin end puts("You gave: #{num[0]}")
About Koders | Resources | Downloads | Support | Black Duck | Submit Project | Terms of Service | DMCA | Privacy Policy | Site Map| Contact Us
©2009 Koders is a trademark of Black Duck Software, Inc. Black Duck, Know Your Code and the Black Duck logo are registered trademarks of Black Duck Software, Inc. in the United States and other jurisdictions. All other trademarks are the property of their respective holders.