You Are Here:

Community: Developer Discussion Boards

#1 Old Split multiple lines from appuifw.Text() input? - 2008-08-24, 10:28

Join Date: May 2008
Posts: 20
Stam112
Offline
Registered User
Im using the appuifw.Text() control to get some input from the user and i want to split the text that i get by lines, meaning, i want to create a list that every object in the list will be a line from the text, so how can i split the text by lines, whats the line break char?
Thanks.
Reply With Quote

#2 Old Re: Split multiple lines from appuifw.Text() input? - 2008-08-24, 13:02

Join Date: Apr 2008
Posts: 10
Location: PL
reaper7
Offline
Registered User
For example:
Code:
appuifw.app.body=t=appuifw.Text()
t.clear()
appuifw.app.body=appuifw.Text(u"Line 1" + "\n" + u"Line 2")
"\n" -> new line
more info there


E51
Reply With Quote

#3 Old Re: Split multiple lines from appuifw.Text() input? - 2008-08-24, 18:56

Join Date: Jul 2008
Posts: 25
Location: Tokyo, Japan
Hiisi
Offline
Registered User
Quote:
Originally Posted by reaper7 View Post
For example:
Code:
appuifw.app.body=t=appuifw.Text()
t.clear()
appuifw.app.body=appuifw.Text(u"Line 1" + "\n" + u"Line 2")
"\n" -> new line
more info there
If you add text to appuifw.Text(), '\n' is OK.

But I think the original question is "how to get and parse text from appuifw.Text()". Because Unicode paragraph separator (U+2029) is used for line breaking inside appuifw.Text(), you should split the input text by u'\u2029'. Here is a sample script.

Code:
import e32
import appuifw

def get_list():
    list = appuifw.app.body.get().split(u'\u2029')
    appuifw.note(unicode(str(list)), 'conf')

lock = e32.Ao_lock()
appuifw.app.body = appuifw.Text()
appuifw.app.menu = [(u'Get List', get_list),
                    (u'Exit', lock.signal)]
appuifw.app.exit_key_handler = lock.signal
lock.wait()
I hope this will help you
Reply With Quote

#4 Old Re: Split multiple lines from appuifw.Text() input? - 2008-08-25, 08:27

Join Date: Apr 2008
Posts: 10
Location: PL
reaper7
Offline
Registered User
@Hiisi yes, it's true, you're right
I wrote how put text to appuifw.Text (not a get) - mea culpa


E51
Reply With Quote

#5 Old Re: Split multiple lines from appuifw.Text() input? - 2008-08-25, 12:06

Join Date: May 2008
Posts: 20
Stam112
Offline
Registered User
Thanks, works great!
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
调用OpenC/C++的问题 shaojieli Symbian 32 2008-08-20 10:48
Multiple input in a single form RB_Sahu Symbian User Interface 2 2007-10-05 09:00
displaying labels with multiple lines and fonts in a List rien Mobile Java General 6 2007-09-13 01:47
WML multiple line text input? eliokenta Browsing and Mark-ups 0 2005-04-25 16:13
List not display text in multiple lines erracid8 Mobile Java Media (Graphics & Sounds) 5 2004-08-09 21:34

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia