Using AddGadgetItem() and breaking a line?

Windows specific forum
PB&J Lover
Enthusiast
Enthusiast
Posts: 212
Joined: Fri Apr 22, 2005 2:07 pm
Location: U.S.A.
Contact:

Using AddGadgetItem() and breaking a line?

Post 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
-- DB

Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage — to move in the opposite direction.

Albert Einstein
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post 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
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
Sub-Routine
User
User
Posts: 82
Joined: Tue May 03, 2005 2:51 am
Location: Wheeling, Illinois, USA
Contact:

Re: Using AddGadgetItem() and breaking a line?

Post 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
Post Reply