shared variables...actually everything I know I learned from CR Help.
Basically they are declared/used in formulas and typically come in groups of 3...a reset / initialization formula, an increment formula, and a display formula.
Typically reset is in the group header and looks something like:
shared numbervar a := 0;
"" //hides the output
The incrementing formula is typically in the detail section:
shared numbervar a;
if (table.field} = x then
a := a + {table.field1};
"" //hides the output
the display is typically in the group footer:
shared numbervar a;
a
:= is the assignment operator while = is for equality
HTH