And I thought it would be easy ?? Dos program to a windows program ??

new topic     » topic index » view thread      » older message » newer message

Hello

Selgor here

Yes I am requesting help with the following

Old Dos program ...

 
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 
 
w=wait_key() 
 

and this is my feeble attempt

include win32lib.ew 
without warning 
 
constant Win = 
 
     create( Window, "Win", 0, 200, 100, 640,520, 0 ) 
 
 include swfuncs.e 
include get.e 
      object a,b,r,w 
 
procedure start_it(integer id, integer event, sequence parms) 
            	wPuts( {Win, 10, 10}, "Input a number") 
            wPuts({Win,10,50},"Input second number ") 
 
               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 
 
     ? b 
w= wait_key() 
end procedure 
setHandler(Win, w32HActivate, routine_id("start_it")) 
 
 
WinMain( Win, Normal) 
 
 

I cannot find an example for prompt_number in win32

The above draws a window
Then all else is dos32

In other words it does not work

How can I get a handle on this conversion stuff ??

Or do I just say ... "stuff it" .. which I do not want to do

I have lots more to convert

Any help appreciated

Cheers

Selgor

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu