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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variables not resetting 1

Status
Not open for further replies.

Kristen3141

Programmer
May 31, 2011
2
US
I am using a global variable to display a set of codes. I am attempting to use two formulas to do this.

First-
Global stringVar x := x + {NEED.CODE}+",";

Second-
whileprintingrecords;

Global stringVar x := "";

The first one builds the list of codes and then displays it while the second is supposed to clear it. If i put the "whileprintingrecords;" in the first formula, it won't build the string, just display the last one.

The second formula is in a group surrounding the first and these formulas are found in the footers for these groups.

Any advice?

Thanks in advance
 
//{@reset} to be placed in the group header:
whileprintingrecords;
Global stringVar x := "";

//{@accum} to be placed in the detail section:
whileprintingrecords;
Global stringVar x := x + {NEED.CODE}+",";

//{@display} to be placed in the group footer:
whileprintingrecords;
Global stringVar x;
if len(x)>1 then
left(x,len(x)-1)

You could leave "Global" out of each formula, as it is the default.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top