<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Associate user input string to specific variable in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/associate-user-input-string-to-specific-variable/m-p/6378963#M131553</link>
    <description>&lt;P&gt;I would suggest something like this...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:test nil

  (setq dtelst '(("21/06/16" . 441294067.896324)
		 ("22/06/16" . 443874734.960046))
	dte (getstring "\nSet date: "))

  (cdr (assoc dte dtelst))
)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or your way using variables...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&amp;gt; (setq 21/06/16 441294067.896324)
4.41294e+008

&amp;gt; (eval (read (getstring)))
&amp;gt; 21/06/16
4.41294e+008&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 12 Jun 2016 09:52:15 GMT</pubDate>
    <dc:creator>ВeekeeCZ</dc:creator>
    <dc:date>2016-06-12T09:52:15Z</dc:date>
    <item>
      <title>Associate user input string to specific variable</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/associate-user-input-string-to-specific-variable/m-p/6378953#M131552</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have defined a value to each date of the year&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for example&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(Setq 21/06/16 (441294067.896324))&lt;BR /&gt;(Setq 22/06/16 (443874734.960046))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The lisp routine prompts the user to enter a date in the format (dd/mm/yy)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(setq date (getstring "Enter date (dd/mm/yy) "))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I associate the string entered by the user to the specific value associated with that particular date in my list of variables?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example the user enters:&amp;nbsp;&lt;SPAN&gt;21/06/16, how do I get it to use the value&amp;nbsp;441294067.896324 for use in other commands?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Jun 2016 09:34:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/associate-user-input-string-to-specific-variable/m-p/6378953#M131552</guid>
      <dc:creator>Rob_Durham</dc:creator>
      <dc:date>2016-06-12T09:34:48Z</dc:date>
    </item>
    <item>
      <title>Re: Associate user input string to specific variable</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/associate-user-input-string-to-specific-variable/m-p/6378963#M131553</link>
      <description>&lt;P&gt;I would suggest something like this...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:test nil

  (setq dtelst '(("21/06/16" . 441294067.896324)
		 ("22/06/16" . 443874734.960046))
	dte (getstring "\nSet date: "))

  (cdr (assoc dte dtelst))
)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or your way using variables...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&amp;gt; (setq 21/06/16 441294067.896324)
4.41294e+008

&amp;gt; (eval (read (getstring)))
&amp;gt; 21/06/16
4.41294e+008&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Jun 2016 09:52:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/associate-user-input-string-to-specific-variable/m-p/6378963#M131553</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2016-06-12T09:52:15Z</dc:date>
    </item>
    <item>
      <title>Re: Associate user input string to specific variable</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/associate-user-input-string-to-specific-variable/m-p/6379050#M131554</link>
      <description>&lt;P&gt;Your first method worked perfectly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Sun, 12 Jun 2016 12:04:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/associate-user-input-string-to-specific-variable/m-p/6379050#M131554</guid>
      <dc:creator>Rob_Durham</dc:creator>
      <dc:date>2016-06-12T12:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: Associate user input string to specific variable</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/associate-user-input-string-to-specific-variable/m-p/6381373#M131555</link>
      <description>Did you notice the variable created by BeeKee&lt;BR /&gt;did not begin with a number?&lt;BR /&gt;And the dotted-pair is quoted (meaning it is a STRING)&lt;BR /&gt;when the first character is a number?&lt;BR /&gt;&lt;BR /&gt;.&lt;BR /&gt;</description>
      <pubDate>Mon, 13 Jun 2016 22:36:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/associate-user-input-string-to-specific-variable/m-p/6381373#M131555</guid>
      <dc:creator>scot-65</dc:creator>
      <dc:date>2016-06-13T22:36:03Z</dc:date>
    </item>
  </channel>
</rss>

