|
returns true if TextField in Record contains defined string |
|
str |
search string |
Namer |
Record with big text field |
|
global
procedure SearchItemRn(record RcVc RepSpec)
begin
record INVc INr;
record LetVc Letr;
boolean TrHs,testf;
string 255 tstr;
integer cnt, rw;
cnt = 0;
rw = 1;
StartReportJob(USetStr(13500));
if (nonblank(RepSpec.f1)) then begin
switch (RepSpec.ArtMode) begin
case 0:tstr = USetStr(13501) & RepSpec.f1;
case 1:tstr = USetStr(13502) & RepSpec.f1;
case 2:tstr = USetStr(13503) & RepSpec.f1;
case 3:tstr = USetStr(13504) & RepSpec.f1;
case 4:tstr = USetStr(13505) & RepSpec.f1;
case 5:tstr = USetStr(13506) & RepSpec.f1;
end;
Header(rw,tstr,1);
rw = rw + 1;
end;
EndHeader;
if (blank(RepSpec.f1)) then begin
goto LSearchItemRn;
end;
SetRepCol(2,90);
SetRepCol(3,300);
StartFormat(15);
OutString(0,0,USetStr(13507),false);
OutString(2,0,USetStr(13508),false);
OutString(3,0,USetStr(13509),false)
OutString(1,0,USetStr(13510),true);
EndFormat;
Gray_Divider(0,1);
TrHs = true;
while (LoopMain(INr,1,TrHs)) begin
if (TrHs) then begin
testf = false;
RecordNew(Letr);
if (RepSpec.ArtMode == 0) or (RepSpec.ArtMode == 1) then begin
AddToText(INr.Code,Letr);
end;
if (RepSpec.ArtMode == 0) or (RepSpec.ArtMode == 2) then begin
AddToText(INr.Name,Letr);
end;
if (RepSpec.ArtMode == 0) or (RepSpec.ArtMode == 3) then begin
AddToText(INr.Group,Letr);
end;
if (RepSpec.ArtMode == 0) or (RepSpec.ArtMode == 4) then begin
AddToText(INr.AlternativeCode,Letr);
end;
if (RepSpec.ArtMode == 0) or (RepSpec.ArtMode == 5) then begin
AddToText(INr.UPrice1,Letr);
end;
if (StringInText(RepSpec.f1,Letr)) then begin
testf = true;
end;
if (INr.Terminated == 1) then begin
testf = false;
end;
if (testf) then begin
StartFormat(15);
OutString(0,"DblINVc",INr.Code,false);
OutString(2,0,INr.Name,false);
OutString(3,0,INr.Group,false);
OutString(1,0,INr.UPrice1,true);
EndFormat;
cnt = cnt + 1;
end;
end;
end;
Gray_Divider(0,1);
StartFormat(15);
OutString(0,0,USetStr(13511),false);
OutVal(100,0,cnt,M40Val,true);
EndFormat;
LSearchItemRn:;
EndJob;
return;
end;
|
««