SOQL in a snippet

Maybe I’m missing something, but can’t you just have your ‘next page’ button call loadNextOffsetPage()?