Hi,
I'm working on a small programme using DDT. I have a listbox, and I want to copy its contents into a text file.
This is what I thought would work:
etc.
However, I find that text$ is of zero length. Using LISTBOX GET TEXT to retrieve only the selected line of the listbox works, but I want the whole thing. I could use DDT to select each entry in turn, but that strikes me as a very clumsy solution.
A separate problem is this: When the user of my programme tries to add an item to the listbox when that item is already present, I want the programme to essentially ignore the (attepted!) new addition, because such duplication is impossible in the context of the application's overall purpose.
But this is simply impssible, as far as I can tell, using DDT. Some of the DDT LISTBOX tools handle the text in (one line of) the listbox, others handle the position in the listbox of the selected item. I want to be able to scan the listbox for a specific string.
Both of these problems appear to be solve-able by using a string array in parallel with the listbox, but it's an inefficient, and less than elegant work-around.
Is there a better way, something I'm missing?
d.
[This message has been edited by Dan Soper (edited September 26, 2000).]
I'm working on a small programme using DDT. I have a listbox, and I want to copy its contents into a text file.
This is what I thought would work:
Code:
CONTROL GET TEXT hDlg, %HDList TO text$ REPLACE $NUL WITH $CRLF IN text$ PRINT #1, text$
However, I find that text$ is of zero length. Using LISTBOX GET TEXT to retrieve only the selected line of the listbox works, but I want the whole thing. I could use DDT to select each entry in turn, but that strikes me as a very clumsy solution.
A separate problem is this: When the user of my programme tries to add an item to the listbox when that item is already present, I want the programme to essentially ignore the (attepted!) new addition, because such duplication is impossible in the context of the application's overall purpose.
But this is simply impssible, as far as I can tell, using DDT. Some of the DDT LISTBOX tools handle the text in (one line of) the listbox, others handle the position in the listbox of the selected item. I want to be able to scan the listbox for a specific string.
Both of these problems appear to be solve-able by using a string array in parallel with the listbox, but it's an inefficient, and less than elegant work-around.
Is there a better way, something I'm missing?
d.
[This message has been edited by Dan Soper (edited September 26, 2000).]
Comment