From: Hal Fulton Date: 2003-09-01T03:51:49+09:00 Subject: Re: ruby for IBM terminal emulation daz wrote: > "{ vidya }" wrote: > > >>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. 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