Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to Create an ARRAY TRIPLICATING DATA

Status
Not open for further replies.

rwn

Technical User
Dec 14, 2002
420
0
0
US
I have this ARRAY, but it is triplicating the results. Suggestions are appreciated.

WhileReadingRecords;

Global NumberVar qty;
qty := qty + 1;

Global StringVar serialNumbers;

// split the string into array of lines
Local StringVar Array TempArray := Split( Trim({Job.Note_Text}), Chr(10) );

Local NumberVar i;
Local BooleanVar foundSN := false; // indicates whether we found Serial Number or Heat Code in string
Local StringVar tempString;

For i := 1 To UBound(TempArray) Do
(
tempString := Trim(TempArray);

If foundSN Then
(
If Len(tempString) > 0 Then
(
Local NumberVar pos := InStr(tempString, " ");


If pos > 0 Then
(
serialNumbers := serialNumbers & tempString[1 to pos - 1] & ", ";
serialNumbers := serialNumbers & cdTrimNewLine(Trim(tempString[pos to Len(tempString)])) & "; ";
Exit For;
)
Else
(
serialNumbers := serialNumbers & tempString & "; ";
Exit For;
)
)
)
Else
(

If InStr(tempString, "Serial Number") > 0 Then
(

foundSN := true;
)
)
);
 
You might have more luck getting a response if you provide a sample of the text you are working with and then show what kinds of results you are trying to achieve with your formula. Maybe also show (for the same sample) the results you ARE getting.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top