devdaily home | apple | java | perl | unix | directory | blog

What this is

This file is included in the DevDaily.com "Ruby Source Code Warehouse" project. The intent of this project is to help you "Learn Ruby by Example" TM.

Other links

The source code

#!/usr/bin/env ruby

require "Win32/Console"

include Win32::Console::Constants
a = Win32::Console.new(STD_OUTPUT_HANDLE)

puts <<'EOF'
This is a simple
test of test to grab
from the console.
Hopefully this will work
easily and merrily.
This is a simple
test of test to grab
from the console.
Hopefully this will work
easily and merrily.
This is a simple
test of test to grab
from the console.
Hopefully this will work
easily and merrily.
EOF

x1 = a.ReadChar(10,10,10)
x2 = a.ReadAttr(10,10,10)
x3 = a.ReadRect(10,10,20,10)
puts "ReadChar .#{x1}."
puts x2.class, x2.size
print "ReadAttr ."
for i in x2
  print "#{i}|"
end
print "\nReadRect ."

i = 0
while i < x3.length-1
  print "#{x3[i]}"
  i += 2
end
print "\n          "
i = 1
while i < x3.length-1
  print "#{x3[i]}|"
  i += 2
end
print "\n"

#puts "read=",x1
#print "Attributes:",x2




Copyright 1998-2008 Alvin Alexander
All Rights Reserved.
 
devdaily.com is based in louisville, kentucky, and this web site is hosted by godaddy.com