monk 发表于 2022-7-6 07:45:30

What does Backslash "\" mean?

In lisp what is the significance of backslash? For example for me to load a command from a DCL button I would write:
 

(action_tile "MKLINE" "(command \"line\")(done_dialog)")
 
I have had a look around and most people say that the character after the backslash is not taken into account?! I am a little foggy.
 
Thanks

MSasu 发表于 2022-7-6 08:01:21

Is used in pair with following character to add special characters to strings. The ACTION_TILE function accept a string argument - therefore "\"" allow you to incluse the " character in string. Other examples: "\t" (tab), "\n" (new line) or "\\" (backslash).

monk 发表于 2022-7-6 08:23:25

Ah i understand!
 
But why for example does this not work?
 

(action_tile "MKLINE" "(command line)(done_dialog)")

MSasu 发表于 2022-7-6 08:38:11

There are two errors on that excerpt (by the way, please edit your posts to add code tags).

[*]The call of command is not allowed while the dialog is still open.
[*]The name of command must be provided as a string.


(command line)(command "line")


Lee Mac 发表于 2022-7-6 09:00:16

I've attempted to explain the use of the backslash many times...
 
http://www.cadtutor.net/forum/showthread.php?66989-Highligting-a-selection&p=459873&viewfull=1#post459873
http://www.cadtutor.net/forum/showthread.php?60935-Help-troubleshooting-LISP-to-insert-titleblock&p=413743&viewfull=1#post413743
http://www.cadtutor.net/forum/showthread.php?59341-Custom-Block-Inserts&p=402387&viewfull=1#post402387
http://www.theswamp.org/index.php?topic=41033.msg462429#msg462429
http://www.theswamp.org/index.php?topic=40111.msg453823#msg453823
http://forums.augi.com/showthread.php?131845-importing-layer-states-via-quot-layerstate-import-quot-function&p=1136714&viewfull=1#post1136714
页: [1]
查看完整版本: What does Backslash "\" mean?