home *** CD-ROM | disk | FTP | other *** search
- {$$3220792584 }//Program www-runprogram
-
- table
- obj_polozky;
-
-
-
- {$I I_wbinet}
-
-
- procedure prepis_mn(id_obj,id_pol:integer;mn:real);
- /*********************************************************************/
-
- var
- numpol,i:integer;
- podminka: string[120];
- curs:cursor;
- u:untyped;
- irec:trecnum;
-
- begin
- podminka:="(id_dobj="+int2str(id_obj)+") AND (id_pol="+int2str(id_pol)+")";
- if not Open_sql_parts(curs, "*", "Obj_polozky", podminka, "") then
- begin
- Rec_cnt(curs,numpol);
- if numpol>0 then
- begin
- if ((mn>0) AND (mn<=1000)) then
- begin
- mn:=trunc(mn);
- curs[i].mnozstvi:=mn;
- end;
- end;
- close_cursor(curs);
- end;
- end;
-
-
- procedure RunProgram;
- /*********************************************************************/
- var
- varcount:short;
- varname,vl_hodnota,s:string[255];
- i,j,id_cenik,id_pol,id_obj:integer;
- mn:real;
-
- begin //1
- j:=1;
- varcount:=-1;
- if ( GetValue("objednavka",0,vl_hodnota) ) then
- begin //2
- id_obj:=str2int(vl_hodnota);
- varcount:=GetVarCount;
- if varcount<>-1 then
- for i:=0 to varcount-1 do
- begin //3
- if( GetVar(i,varname) ) then
- begin //4
- if( varname.="W_MNOZ" ) then
- begin //5
- id_pol:=str2int(strcopy(varname,7,strlength(varname)-6));
- if( GetVarValue(i,vl_hodnota) ) then
- begin //6
- mn:=str2real(vl_hodnota);
- if mn>0 then
- begin //7
- prepis_mn(id_obj,id_pol,mn);
- end; //7
- end; //6
- end; //5
- end; //4
- end; //3
- end //2
- else SetSTWError("chyba, vra¥te se zp∞t");
- end; //1
-
- begin
- end.
-