adding lines at and- sub ,libreoffice basic

I had that code:

Sub k
    oParEnum = ThisComponent.getText.createEnumeration 
    Do While oParEnum.hasMoreElements()

       oPar = oParEnum.nextElement()
       print oPar.getString


End Sub

This code is ment to write paragrapg by paragraph from the text in writer.
But if we hava a many lines song in writer, it writes line by line at the beginning,
then it writes more lines at the end of the text TOGETHER.

P.s. how to get the code written in particular lines?

Please, what is the cause?
WHat should I do, to get THE WHOLE TEXT written line by line

Many thanks!!!

Karolus, got it.