В хелпе всё понятно. Вот кусок нужный тебе:
program rs
var rs : recordStore;
countStr : string;
countInt, nextId, index : integer;
begin
rs := OpenRecordStore('Count'); //открываем RMS
{если первый запуск, добавляем запись}
if nextId = 1 then
index := AddRecordStoreEntry(rs, '0') //сначала 0 (или 'КУКУ', '4tf^&' и т.д)
countStr := ReadRecordStoreEntry(rs, 1); // читаем запись
{делаем черное дело -- модифицируем переменную}
countInt := StringToInteger(countStr) + 1;
countStr := IntegerToString(countInt);
{В данном случае увеличиваем на 1}
ModifyRecordStoreEntry(rs, countStr, 1); // coхраняем
CloseRecordStore(rs); // закрываем хранилище
{делаем, что хотим}
ShowForm;
index := FormAddString('Значение переменной countStr: ' + countStr);
AddCommand(CreateCommand('Exit', CM_EXIT, 1));
repeat Delay(100) until GetClickedCommand <> EmptyCommand;
end.
Типа так