On 12-6-2023 08:15, Nikolay Nikolov via fpc-pascal wrote: Shouldn't the recursive call assign the result? > nextt(num - 1); nextt:=nextt(num - 1); if you don't use the result, the whole call may be optimized away?