bad argument type: stringp nil

bad argument type: stringp nil

Anonymous
Not applicable
5,545 Views
9 Replies
Message 1 of 10

bad argument type: stringp nil

Anonymous
Not applicable

Attached are lisp and dcl. I had it working perfectly, but then restarted AutoCAD and now if gives me this error. I am thinking it is close to the top of the lisp because the dialog box flashes then I get the error. Any help would be greatly appreciated.

0 Likes
Accepted solutions (1)
5,546 Views
9 Replies
Replies (9)
Message 2 of 10

ronjonp
Advisor
Advisor

Quick check and you're trying to set:

    (set_tile "fw1" no)
    (set_tile "aw1" no)	

but 'no' is nil.

 

I also had to remove this from the end just to get it to run:

(unload_dialog dcl_id)
0 Likes
Message 3 of 10

Anonymous
Not applicable

Yes, they are toggle boxes.

0 Likes
Message 4 of 10

ronjonp
Advisor
Advisor

I understand that but you cannot pass a nil value to set_tile. Do you use the VLIDE to debug your code? 

image.png

0 Likes
Message 5 of 10

Anonymous
Not applicable

Yes, but it does not show me the error location

 

Do I need to set func for yes no toggle box?

0 Likes
Message 6 of 10

ronjonp
Advisor
Advisor

make sure this is checked:

image.png

Run the code then:

image.png

0 Likes
Message 7 of 10

Anonymous
Not applicable

That helps, but if I disable these it will not draw weld_all for field_weld.

0 Likes
Message 8 of 10

ronjonp
Advisor
Advisor

@Anonymous wrote:

That helps, but if I disable these it will not draw weld_all for field_weld.


I don't think you're following what I'm telling you ... passing nil to set_tile is the FIRST thing wrong with your code. You have to step through one at a time and fix each error until it works. Make sense?

Message 9 of 10

scot-65
Advisor
Advisor
Accepted solution
Setting tiles - one should always set tiles.

For toggles - "0" or "1".
For edit boxes - "" (empty string).
For radio buttons - Assign a key to the container and use this key to
set the appropriate radio button. The value is the radio button's key name.
On the reverse, to get a value of the current radio button, get_tile the container.
For list boxes and popup lists - position "0" as a start. Ensure the list is
added first before setting.
For sliders - "0".

{I did not look at your code}

???

Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.

0 Likes
Message 10 of 10

ronjonp
Advisor
Advisor

There is also the HELP file to refer to ; - ). You really need to practice debugging your code in the vlide to solve these problems for yourself. Once you learn that essential skill in programming, you can quit banging your head on the wall trying to guess what is wrong. 😉

0 Likes