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!

Help with sorting out my formula

Status
Not open for further replies.

t16turbo

Programmer
Mar 22, 2005
315
0
0
GB
Hi guys,

I have several formula fields which return a text string given certain criteria.
I use them do display exceptions on project fields.

Then display these in one big text string using a formula as follows:
Code:
whileprintingrecords;
numbervar counter := 0;
stringvar array x := [{@Version Exception},{@Exception Text},{@Category/Status Exception}, {@Client Exception}];
numbervar y := ubound(x);
stringvar result := "";
numbervar counterx := 0;

for counter := 1 to y do(
if x[counter] <> "No Exception" then
(counterx := counterx + 1;
result := result + "<b>"+totext(counterx,0,"") + ". "+"</b>" + x[counter] + ";<br>"));
result;

for some reason, this is not functioning correctly.
It only displays one of the excpetions from the array.
for example if {@Version Exception} and {@Client Exception} are returning anything other than "No Exception" the combined exception displays the text string only from {@Client Exception}, rather than both.

I have exactly the same code in another report and it works fine - so I can't understand whats wrong with this one.

any ideas?

 
Worked fine here:

whileprintingrecords;
numbervar counter := 0;
stringvar array x := ["hello","there","you", "No Exception"];
numbervar y := ubound(x);
stringvar result := "";
numbervar counterx := 0;
for counter := 1 to y do(
if x[counter] <> "No Exception" then
(counterx := counterx + 1;
result := result + "<b>"+totext(counterx,0,"") + ". "+"</b>" + x[counter] + ";<br>"));
result;

This returns:

1. hello;
2. there;
3. you;


Perhaps there's something you misunderstand about your data or you're pointing to the wrong formulas/fields?

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top