Re: And I thought it would be easy ?? Dos program to a windows program ??
- Posted by Insolor Jan 18, 2011
- 1467 views
kinz said...
Selgor said...
Hello
Selgor here
Yes I am requesting help with the following
Old Dos program ...
See please one possible solution:
include dos_rescue.ew --- from the Insolor's package --- http://www.rapideuphoria.com/dosrescue2.zip include swfuncs.e include get.e object a,b,r,w r = 1 a = prompt_number(" Type num ",{}) b = prompt_number(" Type num ",{}) clear_screen() while r > 0 do r = a - b* floor(a/b) if r = 0 then exit end if a = b b = r end while puts(1,"The Greatest Common Denominator is ") ? b b = getc(0) --- press Enter instead of wait_key()
Works for me with eui.exe of 4.0. But Rob's dos_rescue.ew of lw doesn't force it to work with exw.exe of 3.1.1, sorry.
And it runs ok with exw.exe of 3.1.1 without includeing of dos_rescue.ew at all.
kinz
The correct solution is:
include dos_rescue.ew as dos_rescue --- from the Insolor's package --- http://www.rapideuphoria.com/dosrescue2.zip include get.e if dos_rescue:graphics_mode(18) then -- create GUI window, actually end if object a,b,r,w r = 1 -- a = prompt_number(" Type num ",{}) dos_rescue:puts(1," Type num ") a = value(dos_rescue:gets(0)) a = a[2] dos_rescue:puts(1,'\n') -- b = prompt_number(" Type num ",{}) dos_rescue:puts(1," Type num ") b = value(dos_rescue:gets(0)) b = b[2] dos_rescue:puts(1,'\n') dos_rescue:clear_screen() while r > 0 do r = a - b* floor(a/b) if r = 0 then exit end if a = b b = r end while dos_rescue:puts(1,"The Greatest Common Denominator is ") -- ? b dos_rescue:printf(1,"%d",b) w=dos_rescue:wait_key()
It works fine with exw.exe and euiw.exe both.