|
Как создать фоновый процесс без window?
|
|||
---|---|---|---|
#18+
Имеется приложение, в котором вызывается по таймеру (каждые 3 минуты)userobject, в котором выполняетя скрипт. Если вызывать userobject при открытом window - все нормально отрабатывает через заданные интервалы времени. Если вызывать userobject из app, не используя window вообще, то отрабатывает один раз и приложение закрывается. Как в РВ создать фоновый процесс не используя объекта типа window? ... |
|||
:
Нравится:
Не нравится:
|
|||
12.02.2004, 10:27 |
|
Как создать фоновый процесс без window?
|
|||
---|---|---|---|
#18+
У меня всё получилось: Приложение: $PBExportHeader$tst.sra forward global transaction sqlca global dynamicdescriptionarea sqlda global dynamicstagingarea sqlsa global error error global message message end forward global type tst from application end type global tst tst on tst.create appname = "tst" message = create message sqlca = create transaction sqlda = create dynamicdescriptionarea sqlsa = create dynamicstagingarea error = create error end on on tst.destroy destroy( sqlca ) destroy( sqlda ) destroy( sqlsa ) destroy( error ) destroy( message ) end on event open;nuo_tim my_uo my_uo = Create nuo_tim my_uo.Start(1) DO WHILE true Yield() If my_uo.ii_count > 10 Then Halt Close End If LOOP end event И сам объект: $PBExportHeader$nuo_tim.sru forward global type nuo_tim from timing end type end forward global type nuo_tim from timing end type global nuo_tim nuo_tim type variables int ii_count end variables event timer;integer li_FileNum li_FileNum = FileOpen("C:\EMPLOYEE.TXT", LineMode!, Write!, LockWrite!, Append!) If li_FileNum <= 0 Then Return FileWrite(li_FileNum, String(Today(), "dd.mm.yyyy hh:mm:ss:fff") + "~r~n") FileClose(li_FileNum) ii_count++ Return end event on nuo_tim.create call timing::create TriggerEvent( this, "constructor" ) end on on nuo_tim.destroy call timing::destroy TriggerEvent( this, "destructor" ) end on event constructor;ii_count = 0 end event ... |
|||
:
Нравится:
Не нравится:
|
|||
12.02.2004, 10:40 |
|
Как создать фоновый процесс без window?
|
|||
---|---|---|---|
#18+
Garyman888 , ответ прост, надо открыть невидимое окно. Вариант, предложенный Геннадичем - классический "в лоб". Его Код: plaintext 1.
просто жрёт CPU неизвестно зачем... ... |
|||
:
Нравится:
Не нравится:
|
|||
12.02.2004, 19:24 |
|
|
start [/forum/topic.php?fid=15&msg=32422126&tid=1339280]: |
0ms |
get settings: |
10ms |
get forum list: |
13ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
162ms |
get topic data: |
13ms |
get forum data: |
3ms |
get page messages: |
53ms |
get tp. blocked users: |
2ms |
others: | 15ms |
total: | 279ms |
0 / 0 |