- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm struggling withmy firstlist box. I get the dialog box open (contains just one list box, multiple selection mode) andget it populated just fine.
But after returning from dlgmodal, everything appears selected, e.g.
j = 1
test = -1
retlog = DLGGET (dlg2, IDC_NAMES, TEMP, j)
test = J
j = j + 1
END DO
returns every item in the list, regardless of selection. Must be something simple I'm missing. In fact, after the last item of the list returns, test continues to increment forever, even beyond the max number of items (1000)in the list. Retlog is false after the last populated entry as it should be)
Please help!
TIA
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4th argument of DlgGet is always INTENT(in) -- i.e. unchanged -- so your test to zero will always fail. For retrieveal of selection, 3rd argument should be integer, (which is INTENT(out)); its output value is index of n-th selected item, where n is value of 4th argument. Thus:
j = 1
DO WHILE (iTemp .NE. 0)
IF (DlgGet (dlg2, IDC_NAMES, iTemp, j)) THEN
!j-th selected string is iTemp-th in the list:
retlog = DlgGet(Dlg2, IDC_NAMES, sItem, iTemp)
!Do something with sItem (string)
END IF
j = j + 1
END DO
DO WHILE (iTemp .NE. 0)
IF (DlgGet (dlg2, IDC_NAMES, iTemp, j)) THEN
!j-th selected string is iTemp-th in the list:
retlog = DlgGet(Dlg2, IDC_NAMES, sItem, iTemp)
!Do something with sItem (string)
END IF
j = j + 1
END DO
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks! Solved the problem for me. I was trying to follow the example in the docs and couldn't get it to work.
Neal
![](/skins/images/3344F5B3B76C91485ED0E980FD0CA95E/responsive_peak/images/icon_anonymous_message.png)
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page