×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    May 2008
    Posts
    20

    Split multiple lines from appuifw.Text() input?

    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.

  2. #2
    Registered User
    Join Date
    Apr 2008
    Location
    PL
    Posts
    10

    Re: Split multiple lines from appuifw.Text() input?

    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

  3. #3
    Registered User
    Join Date
    Jul 2008
    Location
    Tokyo, Japan
    Posts
    25

    Re: Split multiple lines from appuifw.Text() input?

    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

  4. #4
    Registered User
    Join Date
    Apr 2008
    Location
    PL
    Posts
    10

    Re: Split multiple lines from appuifw.Text() input?

    @Hiisi yes, it's true, you're right
    I wrote how put text to appuifw.Text (not a get) - mea culpa
    E51

  5. #5
    Registered User
    Join Date
    May 2008
    Posts
    20

    Re: Split multiple lines from appuifw.Text() input?

    Thanks, works great!

Similar Threads

  1. Multiple input in a single form
    By RB_Sahu in forum Symbian User Interface
    Replies: 2
    Last Post: 2007-10-05, 08:00
  2. displaying labels with multiple lines and fonts in a List
    By rien in forum Mobile Java General
    Replies: 6
    Last Post: 2007-09-13, 00:47
  3. WML multiple line text input?
    By eliokenta in forum Browsing and Mark-ups
    Replies: 0
    Last Post: 2005-04-25, 15:13
  4. List not display text in multiple lines
    By erracid8 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 5
    Last Post: 2004-08-09, 20:34

Posting Permissions

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