I would like to remove the 0(zero) values in my Array if the entry is not filled from the iterations of the For loop. I've tryed using the as the subscript for the ToText which would (I think) make the number of entries variable. I coded ToText(NewIDs,"#") + ', ' but versiion 8.5 of Crystal report will not accept the in the ToText statement.
Here is the code the feeds the Totext.
WhilePrintingRecords;
NumberVar Qx; NumberVar i;
Numbervar Array NewIDs;
Redim NewIDs [5]; 0;
Global Numbervar Current_ID;
// The maximum number of available unassigned CodeIDs for parents is five.
// The Do increments the current CodeID, and places the new number
// in the next available slot in the array.
// The new CodeID is used in the next For loop iteration, until the maximum
// is reached.
//
If {@Differance} >1 and {@Differance} < 6 then
For i := 1 to {@Differance}
Do
(
NewIDs := (Current_ID + 1);
Current_ID := (NewIDs));
ToText(NewIDs[1],"#") + ', ' +
ToText(NewIDs[2],"#") + ', ' +
ToText(NewIDs[3],"#") + ', ' +
ToText(NewIDs[4],"#") + ', ' +
ToText(NewIDs[5],"#");
This is the current detail lines of the ToText statement:
1004, 1005, 0, 0, 0
1106, 1107, 0, 0, 0
1394, 1395, 0, 0, 0
Here is the code the feeds the Totext.
WhilePrintingRecords;
NumberVar Qx; NumberVar i;
Numbervar Array NewIDs;
Redim NewIDs [5]; 0;
Global Numbervar Current_ID;
// The maximum number of available unassigned CodeIDs for parents is five.
// The Do increments the current CodeID, and places the new number
// in the next available slot in the array.
// The new CodeID is used in the next For loop iteration, until the maximum
// is reached.
//
If {@Differance} >1 and {@Differance} < 6 then
For i := 1 to {@Differance}
Do
(
NewIDs := (Current_ID + 1);
Current_ID := (NewIDs));
ToText(NewIDs[1],"#") + ', ' +
ToText(NewIDs[2],"#") + ', ' +
ToText(NewIDs[3],"#") + ', ' +
ToText(NewIDs[4],"#") + ', ' +
ToText(NewIDs[5],"#");
This is the current detail lines of the ToText statement:
1004, 1005, 0, 0, 0
1106, 1107, 0, 0, 0
1394, 1395, 0, 0, 0