Help with combining 2 sketches together.

Then it works. It saves the digits.

But there is no call to the write file so how can it save the digits?