Hi,
I want to find a string which should have been added before in a while procedure:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
CString strLocalText;
strLocalText = [22 CHarge/Serie];
CString strLeft;
CString strRight;
CString strAnz=S.GTM("Anz.",nSprache);
CString strDat=S.GTM("Ablaufdatum",nSprache);
Cstring strLocalText2;
CString strLTTemp=strLocalText;
strLocalText="";
strlocaltext2=""
if(strLTTemp.GetLength()>0){
while(strLTTemp.GetLength()>0){
CString strLTLine=H.ExtractFirstLine(strLTTemp);
if(strLTLine.GetLength()>0){
CString strLotNr=H.ExtractFirstElementFromLine(strLTLine,":");
CString strAnz2=H.ExtractFirstElementFromLine(strLTLine,":");
CString strDat2=H.ExtractFirstElementFromLine(strLTLine,":");
strAnz2.TrimLeft();
strDat2.TrimLeft();
strLocalText2=strLocalText + strLotNr + " ";
if(strAnz2.GetLength()>0){strLocalText2=strLocalText2 + strAnz + ":" + strAnz2 +" ";};
if(strDat2.GetLength()>0){strLocalText2=strLocalText2 + strDat + ":" + strDat2;};
};
strLocalText2=strLocalText2 + "\r\n";
int ind = strlocaltext2.IndexOf(S.GTM("Serien-/Chargennummer",nSprache));
if (ind > -1)
{}
else
{
strLocalText2=S.GTM("Serien-/Chargennummer",nSprache) + ":" + strLocalText2;
}
};
strlocaltext=strlocaltext2;
};
|
Now when I have two serial numbers, I can write
1 2 3 4 5 6 7 8 9 10
|
};
strLocalText2=strLocalText2 + "\r\n";
strLocalText2=S.GTM("Serien-/Chargennummer",nSprache) + ":" + strLocalText2;
};
strlocaltext=strlocaltext2;
};
[code]
Instead of:
|
strLocalText2=strLocalText2 + "\r\n";
int ind = strlocaltext2.IndexOf(S.GTM("Serien-/Chargennummer",nSprache));
if (ind > -1)
{}
else
{
strLocalText2=S.GTM("Serien-/Chargennummer",nSprache) + ":" + strLocalText2;
}
};
strlocaltext=strlocaltext2;
};[/code]
When I write that, the program writes e.g.:
SerialNumber: SerialNumber:090010090 Qty: 1 Exp.Date: 12.12.2012
090010091 Qty: 4 Exp.Date 13.12.2012
What is wrong? I want that in both lines stands:
SerialNumber: ..... Qty: ... Exp.Date: ...
How is this possible with my code?
Kindest Regards and thanks
Daniel