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!

Checking if a value exists in an Array for conditional suppression

Status
Not open for further replies.

semsel

Systems Engineer
Jul 29, 2019
1
0
0
AE
I have a string array named "spools" that was built using a for loop. I am trying to print the array using a variable called display which prints as follows

1.00 2.00 3.00 etc

This is how I built the array:
StringVar array spools := ['0'];
stringvar display;

if OnFirstRecord then
spools[1] := ToText({COESPOOL.LINENUMBER})
else (
if not (ToText({COESPOOL.LINENUMBER}) in spools) then (
Local NumberVar i := ubound(spools) + 1;
Redim Preserve spools;
spools := ToText({COESPOOL.LINENUMBER});
display := display & spools& chr(13)
)
);

display;

Now in my report I want to check a column value if it matches with one of the values, suppress the section. The condition used is "ToText({COESPOOL.LINENUMBER}) in spools", which should occassionally print true or false. However in my case it is always returing false. What could I be doing wrong


if my column value is returning 2.00, the condition should return true as the array at the time of printing record is [1.00 2.00]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top