Ask Your Question
-1

string to string variable-how to get/libreoffice [closed]

asked 2014-06-13 18:00:55 +0200

altair gravatar image

updated 2014-06-13 18:23:12 +0200

Hello! I have such a code:

Sub k 
    oParEnum = ThisComponent.getText.createEnumeration 
    Do While oParEnum.hasMoreElements() 
        oPar = oParEnum.nextElement()  
        print oPar.getString
    Loop 
End Sub

It writes the text in writer line by line in a msgbox. What I want to achieve is to get each line in a particular variable with particular name, so that I can write it alone when I want later in program.

Please, any advices and links would be of a great help!

MANY THANKS IN ADVANCE!!!

P.S. iF i have:

twinkle twinke
little star
How I
wonder
what u
are

I want to get:

a$="twinkle twinkle"
b$="little star"
c$="How I"
d$="wonder"
e$="what u"
f$="are"

P.s. 2 Please, how do I get lines separated in these posts? Many thanks!!!

MANY THANKS IN ADVANCE- I am not able to google any cute advices in the net at the moment!
AND YOU ARE ALREADY NOT ABLE TO EDIT YOUR POSTS PROPERLY, NEXT TIME I DELETE UNREADEBLE POST INSTEAD OF EDITING FOR DUMP --- KAROLUS

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2016-02-25 10:35:35.022826

1 Answer

Sort by » oldest newest most voted
0

answered 2014-06-13 18:25:21 +0200

altair gravatar image

Hello! Was practising right now: "enter code here" is what I have to click for each ROW ,otherwise it does not go! I don't know for other computors, but that is definitely what I have to use at the moment! Anyway, at least the problem is solved!

edit flag offensive delete link more

Comments

I mean, just the problem with writing the code in the post! Not the problem I asked about:(

altair gravatar imagealtair ( 2014-06-13 18:35:24 +0200 )edit

Thanks, Karolus!

altair gravatar imagealtair ( 2014-06-14 09:00:06 +0200 )edit

Please, how do I get variables a, b, c, d, e from text writen in writer when I use sub k? Many thanks!!! When I use sub k, I get each paragraph of the text on msgbox. When I click ok, I get next paragraph in the msbbox. But, now I want each paragraph to be a string, each string having its name (a,b,c,...) so that I can mange these srings further! Please, would be extremely gratefull for each advise! Many thanks!!!

altair gravatar imagealtair ( 2014-06-14 09:03:34 +0200 )edit

Question Tools

1 follower

Stats

Asked: 2014-06-13 18:00:55 +0200

Seen: 53 times

Last updated: Jun 13 '14