Код: Выделить всё
alter interface RASHORD;
var fMy_var2,pil1:string;
katsoprnrec:comp;
sklorderrec:comp;
summat:double;
function funcSUM( price : double; kol : double ) : double; forward;
function funcSUM( price : double; kol : double ) : double;
{
funcSUM:=funcSUM+price*kol;
logstrtofile('summak.txt',funcSUM);
}
create view
(osum)
as select
sporder.rsrprice*sporder.kol,
sporder.*
from sporder;
create view v2 (summak) as select /*sporder.rsrprice*sporder.kol*/ funcSUM(sporder.rsrprice,sporder.kol) from SpSopr,SpOrder//,
where ((1==SpSopr.PrMc
and katsopr.nrec /*281474976821314*/== SpSopr.cSopr
and SpSopr.Nrec == SpOrder.cSpSopr
and 1==sporder.vidorder));
handleevent
cmInit:
{ inherited :: handleEvent(cmInit);
katsoprnrec:=katsopr.nrec;
sklorderrec:=sklorder.nrec;
summat:=0;
message(v2.summak);
cfsSetCurrentContainer('RASHORD.EDITORDERS.BRSPORDER');
var i: integer;
for (i:=0; i<2; i++)
{
cfsCreateObject('Column','BRSPORDER','osum',FALSE, fMy_var2);
cfsSetProp('osum','Visible',TRUE);
if (i =0)
{
cfsSetProp('osum','Visible', FALSE );
}
else
{
cfsSetProp('osum' , 'Visible', TRUE ) ;
}
cfsSetProp('osum' , 'Title' , 'Стоимость' ) ;
cfsSetProp('osum' , 'PrecisionVarName' , 'digitToch2');
cfsSetProp('osum' , 'PassiveFormat' , '[|-]366`666`666`666`666.88');
SetPrecisionGroup('digitToch2',2);
cfsSetProp('osum' , 'MaxLen', 18 );
cfsSetProp('osum','Protect',true);
cfsDestroyObject('c_BRSPORDER_SUMPRICE_Стоимость');
cfsSetCurrentContainer('RASHORD.PROSCINFO');
cfsCreateObject('PanelInputLine','PROSCINFO','summak',FALSE, pil1);
cfsSetProp('summak','Origin_X',100);
cfsSetProp('summak','Origin_Y',25);
cfsSetProp('summak' , 'Size_X',60);
cfsSetProp('summak' , 'Visible', TRUE );
cfsSetProp('summak' , 'Protect', False );
cfsSetProp('summak' , 'Skip', False );
}
cfsSetCurrentContainer('RASHORD.PROSCINFO');
cfsDestroyObject('i_PROSCINFO_TORDSTR');
cfsDestroyObject('i_PROSCINFO_ATTRVALP.VSTRING');
cfsDestroyObject('i_PROSCINFO_SFLDCOUNTANDSUM');
}
end;
end.
