View previous topic :: View next topic |
Author |
Message |
yui0900826 Cheater Reputation: 0
Joined: 09 Aug 2011 Posts: 35 Location: HongKong
|
Posted: Mon Mar 12, 2012 10:07 pm Post subject: print on the same line ? |
|
|
Code: |
print( strings_getText( listbox_getItems( xxx )))
print
on
the
same
line
|
how the print on the same line? thank~
|
|
Back to top |
|
|
atom0s Moderator Reputation: 198
Joined: 25 Jan 2006 Posts: 8518 Location: 127.0.0.1
|
Posted: Mon Mar 12, 2012 11:18 pm Post subject: |
|
|
Append the items together before you print them.
_________________
- Retired. |
|
Back to top |
|
|
yui0900826 Cheater Reputation: 0
Joined: 09 Aug 2011 Posts: 35 Location: HongKong
|
Posted: Mon Mar 12, 2012 11:59 pm Post subject: |
|
|
how to append the items together print?
thank~ ><
|
|
Back to top |
|
|
atom0s Moderator Reputation: 198
Joined: 25 Jan 2006 Posts: 8518 Location: 127.0.0.1
|
Posted: Tue Mar 13, 2012 12:49 am Post subject: |
|
|
Like this:
Code: |
-- Create an example form with a listbox..
local f = createForm( true );
local l = createListBox( f );
local s = listbox_getItems( l );
-- Add some test data to the listbox..
strings_add( s, "test 1" );
strings_add( s, "test 2" );
strings_add( s, "test 3" );
strings_add( s, "test 4" );
strings_add( s, "test 5" );
-- Get the items and print them on a single line..
local strList = listbox_getItems( l );
local output = "";
for x = 0, strings_getCount( strList ) - 1 do
output = output .. strings_getString( strList, x );
end
print( output );
|
_________________
- Retired. |
|
Back to top |
|
|
yui0900826 Cheater Reputation: 0
Joined: 09 Aug 2011 Posts: 35 Location: HongKong
|
Posted: Tue Mar 13, 2012 1:23 am Post subject: |
|
|
Thank you very much for your help
|
|
Back to top |
|
|
|