I upgraded to the latest version 7.0.0.6 from 7.0.0.2
in my projects i have set a listbox to double click and it puts the text from the list box into acad. this worked with 7.0.0.2 but i get
; error: bad argument type: stringp
with the new version
attached are copies of my project with associated txt file
this is only 1 of 2 projects so far that i have found with this issue.
On line 212 you have this code:
(setq strStockBookNumber (substr (dcl_ListBox_GetSelectedItems oSTKBK_Form1_ListBox1) 1 21))
Since (dcl_ListBox_GetSelectedItems) returns a list of strings this should be:
(setq strStockBookNumber (substr (car (dcl_ListBox_GetSelectedItems oSTKBK_Form1_ListBox1)) 1 21))
It was a bug in earlier versions that GetSelectedItems did not return a list for a single-selection listbox. It should now match the documentation by always returning a list.
Quote from: owenwengerd on August 21, 2012, 08:20:34 AM
It was a bug in earlier versions that GetSelectedItems did not return a list for a single-selection listbox. It should now match the documentation by always returning a list.
i dont understand what this means
Quote from: roy_043 on August 21, 2012, 07:43:11 AM
On line 212 you have this code:
(setq strStockBookNumber (substr (dcl_ListBox_GetSelectedItems oSTKBK_Form1_ListBox1) 1 21))
Since (dcl_ListBox_GetSelectedItems) returns a list of strings this should be:
(setq strStockBookNumber (substr (car (dcl_ListBox_GetSelectedItems oSTKBK_Form1_ListBox1)) 1 21))
by doing what you listed returns an error
; error: bad argument type: consp
Are you perhaps testing with 7.0.0.6 *AND* 7.0.0.2?
If you want your code to work with both versions you could try something like this:
(setq tmp (dcl_ListBox_GetSelectedItems oSTKBK_Form1_ListBox1))
(if (listp tmp) (setq tmp (car tmp)))
(setq strStockBookNumber (substr tmp 1 21))