ruby for IBM terminal emulation

V

{ vidya }

hi,

I am not sure if this is the right address to send my question ..so.. !

Is Ruby language a good choice for a terminal emulation software with
an IBM mainframe ?
i have to convert and port a terminal emulator currently in "C" lang
for communicating with the IBM mainframe.
It is in the MSWindows OS platform and i want to port it to the
Gnu/Linux OS platform but will it work if the client has another OS/s?
Would Ruby be a better option to C++ ?
thanks for your time,

=====
{vidya}


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
 
D

daz

{ vidya } said:
hi,

I am not sure if this is the right address to send my question ..so.. !

Is Ruby language a good choice for a terminal emulation software with
an IBM mainframe ?
i have to convert and port a terminal emulator currently in "C" lang
for communicating with the IBM mainframe.
It is in the MSWindows OS platform and i want to port it to the
Gnu/Linux OS platform but will it work if the client has another OS/s?
Would Ruby be a better option to C++ ?
thanks for your time,


I'd guess that your "C" program is making use of the getch() function
(directy or indirectly).
Because this isn't available with all compilers, Ruby uses getchar()
which, under Win32, gets too much "help" from DOS (e.g. DOS echoes
the characters as you type but doesn't return the input until getchar()
sees end-of-line). I don't know *nix but I'm fairly sure this problem
isn't there.

So, a compiled-for-Win32 Ruby interpreter has this anomaly built-in.

You can work-around by checking the Ruby platform in a script and calling
Win32API but then you haven't got one script that will work for all.

I would look at how easy it might be to convert the Win32 bits to
more portable "C" and try ramming the prog. through a GNU compiler ?


Use Ruby for your next project :)


daz
 
H

Hal Fulton

daz said:
I'd guess that your "C" program is making use of the getch() function
(directy or indirectly).
Because this isn't available with all compilers, Ruby uses getchar()
which, under Win32, gets too much "help" from DOS (e.g. DOS echoes
the characters as you type but doesn't return the input until getchar()
sees end-of-line). I don't know *nix but I'm fairly sure this problem
isn't there.

So, a compiled-for-Win32 Ruby interpreter has this anomaly built-in.

Hmm, I think if you "grab" a character you don't get an echo.
You can work-around by checking the Ruby platform in a script and calling
Win32API but then you haven't got one script that will work for all.

This might be acceptable for him. Is Win32API a part of the
standard Ruby distribution on Windows? If so, the difference
should be imperceptible to the user.

Hal
 
H

Hal Fulton

This is based on one of the Win32API examples:
require 'Win32API'
getch = Win32API.new("crtdll", "_getch", [], 'L')

c = getch.Call
p 'END'
p c.chr

Displays "END" as soon as I press z (which isn't echoed),
then prints the result I requested ("z") and terminates.

So it's possible.

That is what I mean when I say "grabbing" a character. That's
not standard usage, it's just my personal slang.

Hal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,817
Latest member
AdalbertoT

Latest Threads

Top