Page 1 of 1
					
				Using AddGadgetItem() and breaking a line?
				Posted: Fri May 13, 2005 8:08 pm
				by PB&J Lover
				Hello PB Users,
I'm using AddGatgetItem() to add items to columns in a list. Why does "-1" work to fill up the list but counting down the rows from 1 on does not?
also, is there a way to break long lines in PB? Like this one?
Code: Select all
AddGadgetItem(lb,-1,punch(x,1)+Chr(10)+punch(x,2)+Chr(10)+punch(x,3)+Chr(10)+punch(x,4)+Chr(10)+punch(x,5)+Chr(10)+punch(x,6)+Chr(10)+punch(x,7))
Thanks
 
			 
			
					
				
				Posted: Sun May 15, 2005 3:29 am
				by Sparkie
				PB Help - AddGadgetItem() wrote:...To add this item to the end of the current item list, use a value of -1...
By using -1, you are always pointing to the next available item at the 
end of the list. Therefore, you can't use -1 in reverse. 
As for breaking long lines of code in PB, you can't do it with break characters as in some other languages. 
viewtopic.php?t=7426 
			 
			
					
				Re: Using AddGadgetItem() and breaking a line?
				Posted: Mon May 30, 2005 9:38 pm
				by Sub-Routine
				dbwisc wrote:Hello PB Users,
I'm using AddGatgetItem() to add items to columns in a list. Why does "-1" work to fill up the list but counting down the rows from 1 on does not?
also, is there a way to break long lines in PB? Like this one?
Code: Select all
AddGadgetItem(lb,-1,punch(x,1)+Chr(10)+punch(x,2)+Chr(10)+punch(x,3)+Chr(10)+punch(x,4)+Chr(10)+punch(x,5)+Chr(10)+punch(x,6)+Chr(10)+punch(x,7))
Thanks
 
You can build a loop to create a string and then refer to the string when you AddGadgetItem. This will break up your lines.
Code: Select all
punch$=""
For I = 1 to 7
punch$ = punch$ + punch(x,I) + Chr(10)
Next
AddGadgetItem(lb,-1,punch$)
You have to start counting ListItems at 0, I believe.
Rand