Order of the Butterfly
Posts: 301 from 2005/3/27
From: Poland, Zdzies...
Quote:
pOS wrote:
Even though E is one of my alltime favourite languages, i didn't use my E installation fpr quite some years.
It looks pretty cool for me as well. Recently I discovered an installhook,m module. It lets me the original, general MUI's while() loop left untouched.
Now I can invoke my funcs / procedures without MUIM_Application_ReturnID ald lots of CASEs in SWITCH loop.
I would like to play with time in AmigaE and I found a nice module softtimer_oo.m
There is a ready to compile example:
Code:
MODULE 'softtimer_oo'
PROC main() HANDLE
DEF x, y, st:PTR TO softtimer
NEW st.softtimer()
st.startTimer(4,500000) -> 4.5 seconds
st.waitForTimer() -> will wait the 4.5 secs
st.delay(60) -> delay one minute
FOR x:=0 TO 99
st.waitAndRestart(0,150000) -> make the loop go in constant speed
-> indemendent of the CPU!
FOR y:=0 TO 10000 -> do someting slow..
ENDFOR -> ..like texturemapping ;)
ENDFOR
st.startTimer(3)
REPEAT
ping() -> just something stupid for 3 seconds
UNTIL st.getTimerMsg()=TRUE
EXCEPT DO
SELECT exception
CASE ERR_DEV
WriteF('Could not open timer.device!n')
CASE ERR_TIMER
WriteF('Could not create timerrequest!n')
CASE ERR_MSGPORT
WriteF('Could not create mesport!n')
CASE ERR_NONE
END st ->>> stop timer and delete msg-ports!
DEFAULT
WriteF('Out of memory or something!n')
ENDSELECT
ENDPROC
PROC ping()
ENDPROC
I can't compile it, because I got an error message:
Code:
Ram Disk:> ecx HD1:Development/Examples/SoftTimerTest.e amigaos ddir=ram:
ECX 2.3.1 WIP (MorphOS,PPC) by Leif Salomonsson (c) 2002-2013.
ECX 2.3.1 WIP MorphOS,PPC.
Lexical and syntax analysis..
Targeting 'AmigaOS,68K' executable.
Parsing and generating..
ERROR: unknown method "softtimer"
Procedure: main
Line 5: NEW st.softtimer()
I'm sure this is not about the module path. I do have it in emodules:softtimer_oo.m
Why it don't recognize the softtimer object?
Mac mini G4@1,5GHz silent upgrade + Xerox Phaser 3140 + EPSON Perfection 1240U
Commodore C64C + 2 x 1541II + Datasette + SD-Box
I miss draggable screens... and do you? I know I'm in a minority unfortunately.