Read-only archive of the All About Symbian forum (2001–2013) · About this archive

Agenda.opx use for NOKIA 9210i

6 replies · 1,939 views · Started 05 February 2004

Hello forum,

I'm writing a program to compare 2 agenda files (one usual and one backup). And I've 2 problems :

1- Task termination
When the usual file ("c:\system\data\calendar"😉 is in use (by calndar app), I obtain an error message (file in use). So I wrote a programme to stop the task using this file :

PROC stoptask😞taskfile$)
LOCAL previous&, idthread&
previous&=0
idthread&=SYTHREADIDFROMOPENDOC&😞taskfile$,previous&😉
IF idthread&=-1
RETURN
ENDIF
previous&=0
SYENDTASK&😞idthread&,0)
RETURN
ENDP

But unfortunately, the task doesn't stop, and I've have once the error message.

2- Agenda file reading
I can't success to read the agenda file (c:\system\data\calendar) to get each existing item caracteristics (start time, end time, start date, ...).

I use the following functions :

AgnOpen😞"c:\system\data\calendar"😉
entry&=AgnFirstEntry&:
AgnApGetStartTime😞entry&,....)
AgnApGetEndTime😞entry&,....)
and then
entry&=AgnNextEntry&:
.......

My calendar file is not empty (I use it in the calendar app), but AgnfirstEntry&: returns 0.

Could you help me to resolve these 2 problems ?

Thanks in advance,

Alain

>>PROC stoptask😞taskfile$)
LOCAL previous&, idthread&
previous&=0
idthread&=SYTHREADIDFROMOPENDOC&😞taskfile$,previous&😉
IF idthread& {*1}=-1
RETURN
ENDIF
previous&=0
SYENDTASK&{*2}😞idthread&,{*3})
RETURN
ENDP<<

{1*} - this should be 'previous&'.

{2*} - this only works if the thread at hand is able to receive shutdown messages (i.e. the softer way). If not, try SyKillTask&: (the harder way).

{3*} - put 'previous&' instead of the zero, then you can test 'previous&' if action was taken or not.

>>2- Agenda file reading
I can't success to read the agenda file (c:\system\data\calendar) to get each existing item caracteristics (start time, end time, start date, ...).<<

Perhaps when you have solved the first one, this second one will be easier. One step at a time.

cheers
Martin

Thanks very much for your answer.

Further to your indication, my first problem is solved. But not my second !

Effectively, when I use the following code :

stoptask😞"c:\system\data\calendar"😉
AgnOpen😞"c:\system\data\calendar"😉
entry&=AgnFirstEntry&:
...
...
AgnEnFree😞entry&😉
AgnClose:

the value entry& is always at 0 !

Do you have any idea about the reason of it ? I don't understand !

Thanks in advance for your help,

Best regards,

Alain

Hello Martin,

Thanks for your mail.

Because of bug of Agenda.opx on the 9210, I wrote a program to stop the calendar task before to use the other programm. I've implemented it on my 9210, it runs well. So after, I could use AgnOpen😞) in my other program without the KERNEL-EXEC 3 error.

I tried on simulator to use AgnFirstEntry&: but unsuccessfull ! Same thing with AgnNextEntry&😞). However my program runs well to add new events with AgnApSetStartTime😞) and AgnAdd&😞).

I'll try on the 9210. Perhaps, the simulator version of Agenda.opx have a problem on my computer.

I'll tell you the result of this test !

Best regards,

Alain

Hello Martin,

Thanks for your council. I've reported my problem to sourceforge. It seems that my problem is with a bug, because agenda.opx was initially written for symbian 5, and then translated in symbian 6.0.

Thanks for your help,

Best regards,

Alain