How do I know which flash page to erase to subsequently write to it?

I have been asked to write an application to be able to change some variables during runtime and be able to store them in non-volatile memory (flash). I read the C8051f507 datasheet and the process to erase and write to flash looks really straightforward. My question is: How do I know which page to erase?

Thanks for your time,

Fer

More questions in this forum