I declared all the global variables called bucket1, bucket2, etc. in the main forumula that calculated all the buckets. In the bucket formula's, I just declared the variable and have it out put like this.
global numbervar bucket1;
bucket1;
that did not work, so I tried this.
global numbervar bucket1;
numbervar displaybucket1;
displaybucket1:=bucket1;
bucket1:=0//reset bucket to zero;
displaybucket1;
It was displaying zeros until I put whilereadingrecords on the 1st line. I figured since the formula's displaying the variables did not reference database fields, that I needed the whilereadingrecords line.