1. Translate and bind problems encountered
- Posted by FredRansom Sep 09, 2009
- 1122 views
The follow code worked fine with eui.exe, but neither euc.exe nor bind.bat were able to handle it. Interestingly it was the fastest execution at 16 seconds on my laptop.
-- code generated by Win32Lib IDE v1.0.4 Build July-06-2008 constant TheProgramType="exw" include Win32Lib.ew without warning without type_check -------------------------------------------------------------------------------- -- Window Window1 constant Window1 = createEx( Window, "Window1", 0, Default, Default, 400, 300, 0, 0 ) constant PushButton2 = createEx( PushButton, "PushButton2", Window1, 44, 24, 88, 28, 0, 0 ) constant EditText3 = createEx( EditText, "EditText3", Window1, 52, 88, 276, 20, 0, 0 ) --------------------------------------------------------- -------------------------------------------------------------------------------- procedure PushButton2_onClick (integer self, integer event, sequence params)--params is () atom sum atom beginning, ending sum = 0.0 beginning = time() for x = 0.0 to 10000.0 do sum = sum + cos(x) for y = 0.0 to 10000.0 do sum += sin(y) end for end for ending = time() setText (EditText3, sprintf("%d %g", {ending - beginning, sum})) end procedure setHandler( PushButton2, w32HClick, routine_id("PushButton2_onClick")) --------------------------------------------------------- WinMain( Window1,Normal )
2. Re: Translate and bind problems encountered
- Posted by mattlewis (admin) Sep 09, 2009
- 1109 views
The follow code worked fine with eui.exe, but neither euc.exe nor bind.bat were able to handle it. Interestingly it was the fastest execution at 16 seconds on my laptop.
What happens in each case? When I translate, I get an error about pixel not being supported. When I bind, I get a machine crash. Is this what happens for you?
Matt
3. Re: Translate and bind problems encountered
- Posted by ghaberek (admin) Sep 09, 2009
- 1120 views
The follow code worked fine with eui.exe, but neither euc.exe nor bind.bat were able to handle it. Interestingly it was the fastest execution at 16 seconds on my laptop.
What do you mean by "were able to handle it?" Did it result in a crash? an error? a circus, perhaps? Did it continue to fill the memory until there was no more?
This took 8 seconds for me in Euphoria 3.1.1 and 9 seconds in Euphoria 4.0.
Tip: When performing long operations in GUI programs, you should update the field periodically and call doEvents() to allow Windows to process messages.
-- code generated by Win32Lib IDE v1.0.4 Build July-06-2008 constant TheProgramType="exw" include Win32Lib.ew without warning without type_check -------------------------------------------------------------------------------- -- Window Window1 constant Window1 = createEx( Window, "Window1", 0, Default, Default, 400, 300, 0, 0 ) constant PushButton2 = createEx( PushButton, "PushButton2", Window1, 44, 24, 88, 28, 0, 0 ) constant EditText3 = createEx( EditText, "EditText3", Window1, 52, 88, 276, 20, 0, 0 ) --------------------------------------------------------- -------------------------------------------------------------------------------- procedure PushButton2_onClick (integer self, integer event, sequence params)--params is () atom sum atom beginning, duration, ending sum = 0.0 beginning = time() for x = 0.0 to 10000.0 do sum = sum + cos(x) for y = 0.0 to 10000.0 do sum += sin(y) end for duration = time() - beginning setText( EditText3, sprintf("%d %g", {duration, sum}) ) doEvents( 0 ) end for ending = time() setText( EditText3, sprintf("%d %g", {ending - beginning, sum}) ) end procedure setHandler( PushButton2, w32HClick, routine_id("PushButton2_onClick")) --------------------------------------------------------- WinMain( Window1,Normal )
HTH,
-Greg
4. Re: Translate and bind problems encountered
- Posted by jeremy (admin) Sep 09, 2009
- 1066 views
The follow code worked fine with eui.exe, but neither euc.exe nor bind.bat were able to handle it.
Fred, can you include the output of eui -version as well? That's helpful in us helping you figure out what's going on.
Jeremy
5. Re: Translate and bind problems encountered
- Posted by FredRansom Sep 10, 2009
- 996 views
With translate I get the pixel not supported error. With bind I get a lot of meaningless multiply defined identifier errors, but no machine crash.
6. Re: Translate and bind problems encountered
- Posted by FredRansom Sep 10, 2009
- 1023 views
I am sure that most of the time you are right about updating fields and doing events, however, this is a very simple program and there are no events to do during the loop. Also, repeatedly updating any field would completely defeat the purpose of the program.
7. Re: Translate and bind problems encountered
- Posted by FredRansom Sep 10, 2009
- 922 views
Here are some results from using eui on bench-3.exw:
16 16340.3
17 16340.3
These results are correct. Times can vary widely on MS Windows depending upon what else Windows is doing and Windows' slap-happy disc activities.
8. Re: Translate and bind problems encountered
- Posted by ne1uno Sep 11, 2009
- 957 views
With translate I get the pixel not supported error.
the devs are working on a real fix. to try it now, comment out any line in eu4/include/image.e that uses pixel() or get_pixel() then win32lib programs will translate.