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

can you make a shared variable of a running total? 1

Status
Not open for further replies.

redeemasp

Programmer
Jun 1, 2004
63
GB
I'm able to make a shared variable of a data field , e.g. command.jobid,
but can you make running totals shared?

thanks
 
you should replace {Table.DicId} with your own database field, ther field you are using to create the Div id group you mention above.

Basically this line does 2 things

shared numbervar array shdselling [DistinctCount(Table.DivID})];

shared numbervar array shdselling - creates a shared variable called shdselling

[DistinctCount(Table.DivID})]; - assigns a value for the size of the array = to the number of div id's in the report.




Gary Parker
MIS Data Analyst
Manchester, England
 
Getting a subscript error (shd be between 1 and size of array)

I assume the size of the array isn't coming into the report.

I then defines the array as 100

/
shared numbervar array shdSellingNew [100]; //define shared selling variable
shared stringvar array shdDividNew [100]; //define shared div variable

Still I get an error.

 
Try this syntax

Code:
//@DeclareVariables
whileprintingrecords;
Local Numbervar ArraySize := DistinctCount({Table.DivID});
shared numbervar array shdselling;
Redim shdselling [ArraySize]
shared stringvar array DivID;
Redim DivID [ArraySize]
Shared NumberVar intCount :=1



Gary Parker
MIS Data Analyst
Manchester, England
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top