|
|
#1 |
|
Junior Member
Join Date: Sep 2008
Posts: 8
|
I have an interface where I add IP addresses to a listbox using a textbox and I want to then iterate over all of those IP addresses in the "Leave" function of my page... how do I get each string in a listbox one at a time to do something with it? Here is some code I have so far:
code: |
|
|
|
|
|
#2 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
|
LB_GETCOUNT and LB_GETTEXT messages, see MSDN for details
IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Sep 2008
Posts: 8
|
Was looking at this page
Yeah, I was looking at this page:
http://msdn.microsoft.com/en-us/library/bb761313(VS.85).aspx But I can't quite put it together. Had something like this: SendMessage $VERSUS_IP_LISTBOX ${LB_GETTEXT} 0 0 $1 System::Call user32::SendMessage(i$VERSUS_IP_LISTBOX,i${LB_GETTEXT},ir1,t.r1) But it didn't seem to pull a string value out of the listbox, what am I doing wrong there? Do you see it? I am not very familiar with the syntax of user32::SendMessage, what does that all mean? Is there a good doc on it? |
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Sep 2008
Posts: 8
|
Tried this:
code: But I got this warning: 1 warning: unknown variable/constant "INDEX,t.$0)" detected, ignoring (C:\Documents and Settings\Max Davis\Desktop\setup.nsi:269) And it doesn't work. Assuming it is talking about $INDEX not being set... when I set it (Var INDEX) I got this: 1 warning: Variable "INDEX" not referenced or never set, wasting memory! And it still didn't work. |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Sep 2008
Posts: 8
|
I was able to get the first string in the select box with this:
code: What is a good way to now loop to get all of them? Can someone give me an example syntax using: Do[While|Until]..{ExitDo|Continue|Break}..Loop[While|Until] From logicLib? |
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Sep 2008
Posts: 8
|
This is where I am currently at:
code: But it only outputs the last string in the listbox. |
|
|
|
|
|
#7 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
|
in that code, the text would be in $R1, not $0. You can remove the non system plugin sendmessage, it is never going to work
IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#8 |
|
Junior Member
Join Date: Sep 2008
Posts: 8
|
This is the final working script to add values to a listbox and then iterate over them in the leave:
code: Anyone is free to reuse this code for their purpose. I used it as a way to collect IP addresses to create config file. |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|