shared variables are easy....
in a formula,
shared xxxxxvar variableName; //look at the types of variables that CR supports, but they all end var
then you can use it in the formula. If you want to access it in another formula, just include the header information.
Biggest caveat, := is assignment, = test for equality
usually there are 3 related formulas, but there could be more or less.
1 to reset the variable to 0
1 to increment th variable
1 to display the variable
it may be that you never need to reset the variable, so that would be less. you might be tracking more than 1 variable in a formula, so that woud be more (usually in the display)
HTH