Хотел завернуть в транзакцию. При добавлении вроде бы работает.
При удалении ошибка (Logout Alreade aktive (56) ...)
Код
Код: Выделить всё
ThisWindow.TakeCompleted PROCEDURE
ReturnValue BYTE,AUTO
! Start of "WindowManager Method Data Section"
! [Priority 3500]
Looped BYTE
! [Priority 8500]
! End of "WindowManager Method Data Section"
CODE
! Start of "WindowManager Method Executable Code Section"
! [Priority 1300]
LOOP
IF Looped
RETURN Level:Notify
ELSE
Looped = 1
END
! [Priority 4000]
IF SELF.Request<>ViewRecord
Logout(5,schet,opl)
sch:idsch = opl:idsch
GET(schet,sch:byidsch) !перечитать запись
IF errorcode() then stop(error()&'Get(schet)'&sch:idsch).
Case Self.Request
OF InsertRecord
IF opl:sumopl > (sch:itogo - sch:sumopl)
MESSAGE('Сумма оплаты больше суммы по счету! ')
opl:sumopl = (sch:itogo - sch:sumopl)
ReturnValue = Level:Fatal
ROLLBACK
RETURN ReturnValue
.
sch:sumopl = (sch:sumopl + opl:sumopl)
OF DeleteRecord
sch:sumopl = (sch:sumopl - opl:sumopl)
.
.
! Parent Call
ReturnValue = PARENT.TakeCompleted()
! [Priority 6500]
IF SELF.Request<>ViewRecord
Case Self.Response
OF 1
Put(schet)
IF errorcode() then stop(error()&'Put(schet)').
Commit
Else
ROLLBACK
.
.
RETURN ReturnValue
END
ReturnValue = Level:Fatal
! [Priority 8800]
! End of "WindowManager Method Executable Code Section"
RETURN ReturnValue
MESSAGE - почему не отражает полностью? В С 6.3 отражается правильно.
И еще вопрос: на Windows 7, 8 функция GetReg() ничего не возвращает.