{"id":6360,"date":"2022-12-20T18:58:13","date_gmt":"2022-12-20T21:58:13","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/dde-mann\/"},"modified":"2022-12-20T18:58:13","modified_gmt":"2022-12-20T21:58:13","slug":"dde-mann","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/dde-mann\/","title":{"rendered":"dde (mann)"},"content":{"rendered":"<h1 align=\"center\">dde<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#DDE COMMANDS\">DDE COMMANDS<\/a><br \/> <a href=\"#DDE AND TCL\">DDE AND TCL<\/a><br \/> <a href=\"#EXAMPLE\">EXAMPLE<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#KEYWORDS\">KEYWORDS<\/a> <\/p>\n<hr>\n<p>______________________________________________________________________________<\/p>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">dde \u2212 Execute a Dynamic Data Exchange command<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>package require dde 1.4<\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>dde servername<\/b> ?<b>\u2212force<\/b>? ?<b>\u2212handler<\/b> <i>proc<\/i>? ?<b>\u2212\u2212<\/b>? ?<i>topic<\/i>?<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>dde execute<\/b> ?<b>\u2212async<\/b>? ?<b>\u2212binary<\/b>? <i>service topic data<\/i> <big>\u2502<\/big><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>dde poke<\/b> ?<b>\u2212binary<\/b>? <i>service topic item data<\/i><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>dde request<\/b> ?<b>\u2212binary<\/b>? <i>service topic item<\/i><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>dde services<\/b> <i>service topic<\/i><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>dde eval<\/b> ?<b>\u2212async<\/b>? <i>topic cmd<\/i> ?<i>arg arg &#8230;<\/i>? ______________________________________________________________________________<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This command allows an application to send Dynamic Data Exchange (DDE) command when running under Microsoft Windows. Dynamic Data Exchange is a mechanism where applications can exchange raw data. Each DDE transaction needs a <i>service name<\/i> and a <i>topic<\/i>. Both the <i>service name<\/i> and <i>topic<\/i> are application defined; Tcl uses the service name <b>TclEval<\/b>, while the topic name is the name of the interpreter given by <b>dde servername<\/b>. Other applications have their own <i>service names<\/i> and <i>topics<\/i>. For instance, Microsoft Excel has the service name <b>Excel<\/b>.<\/p>\n<h2>DDE COMMANDS <a name=\"DDE COMMANDS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The following commands are a subset of the full Dynamic Data Exchange set of commands. <b><br \/> dde servername<\/b> ?<b>\u2212force<\/b>? ?<b>\u2212handler<\/b> <i>proc<\/i>? ?<b>\u2212\u2212<\/b>? ?<i>topic<\/i>?<\/p>\n<p style=\"margin-left:22%;\"><b>dde servername<\/b> registers the interpreter as a DDE server with the service name <b>TclEval<\/b> and the topic name specified by <i>topic<\/i>. If no <i>topic<\/i> is given, <b>dde servername<\/b> returns the name of the current topic or the empty string if it is not registered as a service. If the given <i>topic<\/i> name is already in use, then a suffix of the form \u201c #2\u201d or \u201c #3\u201d is appended to the name to make it unique. The command\u2019s result will be the name actually used. The <b>\u2212force<\/b> option is used to force registration of precisely the given <i>topic<\/i> name.<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">The <b>\u2212handler<\/b> option specifies a Tcl procedure that will be called to process calls to the dde server. If the package has been loaded into a safe interpreter then a <b>\u2212handler<\/b> procedure must be defined. The procedure is called with all the arguments provided by the remote call.<\/p>\n<p style=\"margin-left:11%;\"><b>dde execute<\/b> ?<b>\u2212async<\/b>? ?<b>\u2212binary<\/b>? <i>service topic data<\/i><\/p>\n<p style=\"margin-left:22%;\"><b>dde execute<\/b> takes the <i>data<\/i> and sends it to the server indicated by <i>service<\/i> with the topic indicated by <i>topic<\/i>. Typically, <i>service<\/i> is the name of an application, and <i>topic<\/i> is a file to work on. The <i>data<\/i> field is given to the remote application. Typically, the application treats the <i>data<\/i> field as a script, and the script is run in the application. The <b>\u2212async<\/b> option requests asynchronous invocation. The command returns an error message if the script did not run, unless the <b>\u2212async<\/b> flag was used, in which case the command returns immediately with no error. <big>\u2502<\/big> Without the <b>\u2212binary<\/b> option all data will be sent in unicode. For <big>\u2502<\/big> dde clients which don\u2019t implement the CF_UNICODE clipboard <big>\u2502<\/big> format, this will automatically be translated to the system <big>\u2502<\/big> encoding. You can use the <b>\u2212binary<\/b> option in combination with the <big>\u2502<\/big> result of <b>encoding convertto<\/b> to send data in any other encoding.<\/p>\n<p style=\"margin-left:11%;\"><b>dde poke<\/b> ?<b>\u2212binary<\/b>? <i>service topic item data<\/i><\/p>\n<p style=\"margin-left:22%;\"><b>dde poke<\/b> passes the <i>data<\/i> to the server indicated by <i>service<\/i> using the <i>topic<\/i> and <i>item<\/i> specified. Typically, <i>service<\/i> is the name of an application. <i>topic<\/i> is application specific but can be a command to the server or the name of a file to work on. The <i>item<\/i> is also application specific and is often not used, but it must always be non-null. The <i>data<\/i> field is given to the remote application. Without the <b>\u2212binary<\/b> option all data will be <big>\u2502<\/big> sent in unicode. For dde clients which don\u2019t implement the <big>\u2502<\/big> CF_UNICODE clipboard format, this will automatically be <big>\u2502<\/big> translated to the system encoding. You can use the <b>\u2212binary<\/b> <big>\u2502<\/big> option in combination with the result of <b>encoding convertto<\/b> to <big>\u2502<\/big> send data in any other encoding.<\/p>\n<p style=\"margin-left:11%;\"><b>dde request<\/b> ?<b>\u2212binary<\/b>? <i>service topic item<\/i><\/p>\n<p style=\"margin-left:22%;\"><b>dde request<\/b> is typically used to get the value of something; the value of a cell in Microsoft Excel or the text of a selection in Microsoft Word. <i>service<\/i> is typically the name of an application, <i>topic<\/i> is typically the name of the file, and <i>item<\/i> is application-specific. The command returns the value of <i>item<\/i> as defined in the application. Normally this is interpreted to be a string with terminating null. If <b>\u2212binary<\/b> is specified, the result is returned as a byte array.<\/p>\n<p style=\"margin-left:11%;\"><b>dde services<\/b> <i>service topic<\/i><\/p>\n<p style=\"margin-left:22%;\"><b>dde services<\/b> returns a list of service-topic pairs that currently exist on the machine. If <i>service<\/i> and <i>topic<\/i> are both empty strings ({}), then all service-topic pairs currently available on the system are returned. If <i>service<\/i> is empty and <i>topic<\/i> is not, then all services with the specified topic are returned. If <i>service<\/i> is non-empty and <i>topic<\/i> is, all topics for a given service are returned. If both are non-empty, if that service-topic pair currently exists, it is returned; otherwise, an empty string is returned.<\/p>\n<p style=\"margin-left:11%;\"><b>dde eval<\/b> ?<b>\u2212async<\/b>? <i>topic cmd<\/i> ?<i>arg arg &#8230;<\/i>?<\/p>\n<p style=\"margin-left:22%;\"><b>dde eval<\/b> evaluates a command and its arguments using the interpreter specified by <i>topic<\/i>. The DDE service must be the <b>TclEval<\/b> service. The <b>\u2212async<\/b> option requests asynchronous invocation. The command returns an error message if the script did not run, unless the <b>\u2212async<\/b> flag was used, in which case the command returns immediately with no error. This command can be used to replace send on Windows.<\/p>\n<h2>DDE AND TCL <a name=\"DDE AND TCL\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">A Tcl interpreter always has a service name of <b>TclEval<\/b>. Each different interpreter of all running Tcl applications must be given a unique name specified by <b>dde servername<\/b>. Each interp is available as a DDE topic only if the <b>dde servername<\/b> command was used to set the name of the topic for each interp. So a <b>dde services TclEval {}<\/b> command will return a list of service-topic pairs, where each of the currently running interps will be a topic.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">When Tcl processes a <b>dde execute<\/b> command, the data for the execute is run as a script in the interp named by the topic of the <b>dde execute<\/b> command.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">When Tcl processes a <b>dde request<\/b> command, it returns the value of the variable given in the dde command in the context of the interp named by the dde topic. Tcl reserves the variable <b>$TCLEVAL$EXECUTE$RESULT<\/b> for internal use, and <b>dde request<\/b> commands for that variable will give unpredictable results.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">An external application which wishes to run a script in Tcl should have that script store its result in a variable, run the <b>dde execute<\/b> command, and then run <b>dde request<\/b> to get the value of the variable.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">When using DDE, be careful to ensure that the event queue is flushed using either <b>update<\/b> or <b>vwait<\/b>. This happens by default when using <b>wish<\/b> unless a blocking command is called (such as <b>exec<\/b> without adding the <b>&#038;<\/b> to place the process in the background). If for any reason the event queue is not flushed, DDE commands may hang until the event queue is flushed. This can create a deadlock situation.<\/p>\n<h2>EXAMPLE <a name=\"EXAMPLE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This asks Internet Explorer (which must already be running) to go to a particularly important website:<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">package require dde <b><br \/> dde execute<\/b> -async iexplore WWW_OpenURL http:\/\/www.tcl.tk\/<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">tk(n), winfo(n), send(n)<\/p>\n<h2>KEYWORDS <a name=\"KEYWORDS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">application, dde, name, remote execution<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  dde \u2212 Execute a Dynamic Data Exchange command <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3783,1],"tags":[2941,2635],"class_list":["post-6360","post","type-post","status-publish","format-standard","hentry","category-n-comandos-tcl-tk","category-sin-categoria","tag-dde","tag-mann"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/6360","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=6360"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/6360\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=6360"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=6360"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=6360"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}