<?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: Value from outside program in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/value-from-outside-program/m-p/9374560#M77244</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6941902"&gt;@wstowe&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;....&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;The third option is to list a variable without the /.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;This means that a variable is set up to receive a value passed to it from outside the program. eg :&lt;/P&gt;
&lt;PRE&gt;	(defun DTR (a)
          (* PI (/a 180.0))
	)&lt;/PRE&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;[That needs a &lt;STRONG&gt;space&lt;/STRONG&gt; between the / and the&amp;nbsp; a&amp;nbsp; -- there is no function called&amp;nbsp; /a .]&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would word that differently.&amp;nbsp; In this case,&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;a&lt;/STRONG&gt;&amp;nbsp; is an &lt;STRONG&gt;&lt;EM&gt;argument&lt;/EM&gt;&lt;/STRONG&gt;, which is not really the same kind of thing as a &lt;EM&gt;&lt;STRONG&gt;variable&lt;/STRONG&gt;&lt;/EM&gt;.&amp;nbsp; An argument must be fed in when the function is used; a localized variable is internal to the function's operations.&amp;nbsp; The difference is the reason for the &lt;FONT color="#FF00FF"&gt;slash&lt;/FONT&gt; [if used] in the parentheses after the function name:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;(defun WHATEVER (&lt;FONT color="#FF0000"&gt;arguments if any go here&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#FF00FF"&gt;/&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000FF"&gt;localized&amp;nbsp;variables if any go here&lt;/FONT&gt;) ....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there are no localized variables, that slash is not needed [as is the case with that (DTR) function].&amp;nbsp; If there are, but there are no arguments to be fed in, the slash &lt;EM&gt;is&lt;/EM&gt;&amp;nbsp; needed:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(defun WHATEVER (&lt;FONT color="#FF00FF"&gt;&lt;STRONG&gt;/&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT color="#0000FF"&gt;localized&amp;nbsp;variables if any go here&lt;/FONT&gt;) ....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and that is typical of &lt;FONT color="#FF6600"&gt;&lt;STRONG&gt;C&lt;/STRONG&gt;&lt;/FONT&gt;ommand definitions beginning with&amp;nbsp; (defun &lt;FONT color="#FF6600"&gt;&lt;STRONG&gt;C:&lt;/STRONG&gt;&lt;/FONT&gt;MickeyMouse (/ variables) ....&amp;nbsp; which are not supposed to have arguments.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If a function definition lists an argument, you must feed in a value for it inside the parentheses when the function is called, in that case:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(dtr &lt;STRONG&gt;&lt;FONT color="#008000"&gt;45&lt;/FONT&gt;&lt;/STRONG&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and the &lt;FONT color="#008000"&gt;&lt;STRONG&gt;45&lt;/STRONG&gt;&lt;/FONT&gt; will be used inside the routine wherever the argument&amp;nbsp; &lt;STRONG&gt;a&lt;/STRONG&gt;&amp;nbsp; appears.&amp;nbsp; Such function definitions can call for more than one argument -- you must supply a value for each in the order in which they are listed in the definition.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 12 Mar 2020 14:59:59 GMT</pubDate>
    <dc:creator>Kent1Cooper</dc:creator>
    <dc:date>2020-03-12T14:59:59Z</dc:date>
    <item>
      <title>Value from outside program</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/value-from-outside-program/m-p/9374343#M77239</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been going through tutorials on AlfraLISP.com. Very helpful site for beginners and I'm sure advanced users too.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"(defun drawline (a / pntl pnt2)&lt;BR /&gt;&lt;SPAN&gt;The last, variable&amp;nbsp;&lt;/SPAN&gt;a&lt;SPAN&gt;&amp;nbsp;receives the first value to it from outside the program."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This statement is a direct quote from AlfraLISP.com.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://www.afralisp.net/autolisp/tutorials/quick-start.php" target="_blank" rel="noopener"&gt;https://www.afralisp.net/autolisp/tutorials/quick-start.php&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;By Kenny Ramage&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My question is as follows. When it says "outside the program", does that mean from another document? Such as another .lsp file or excel file or can that mean from within the same .lsp file but in a seperate section/command/function?(I don't have the LSIP jargon down yet so not sure how to word that last part)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 13:52:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/value-from-outside-program/m-p/9374343#M77239</guid>
      <dc:creator>wstowe</dc:creator>
      <dc:date>2020-03-12T13:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: Value from outside program</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/value-from-outside-program/m-p/9374379#M77240</link>
      <description>&lt;P&gt;a is the argument the function "drawline" accepts. In that case, drawline only accepts one argument a.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As an example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(defun addbyfive (a)&lt;/P&gt;&lt;P&gt;&amp;nbsp; (+ a 5)&lt;/P&gt;&lt;P&gt;&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you want to call the addbyfive function, you call it by doing:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(addbyfive 10)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and the function will return 15.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 14:03:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/value-from-outside-program/m-p/9374379#M77240</guid>
      <dc:creator>jonathanhandojo</dc:creator>
      <dc:date>2020-03-12T14:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: Value from outside program</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/value-from-outside-program/m-p/9374391#M77241</link>
      <description>&lt;P&gt;erased&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 14:14:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/value-from-outside-program/m-p/9374391#M77241</guid>
      <dc:creator>devitg</dc:creator>
      <dc:date>2020-03-12T14:14:47Z</dc:date>
    </item>
    <item>
      <title>Re: Value from outside program</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/value-from-outside-program/m-p/9374443#M77242</link>
      <description>&lt;P&gt;I may not have worded my question well. My apologies.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not trying to do anything specific but to understand general LISP rules and how it works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is another example of what I'm trying to understand from AfraLISP.com.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The third option is to list a variable without the /.&lt;BR /&gt;This means that a variable is set up to receive a value passed to it from outside the program. eg :&lt;/P&gt;&lt;PRE&gt;	(defun DTR (a)
	   

          (* PI (/a 180.0))
	)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So it's looking for the "a" outside the program?&lt;/P&gt;&lt;P&gt;The "/" needs to be in front of the character?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 14:24:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/value-from-outside-program/m-p/9374443#M77242</guid>
      <dc:creator>wstowe</dc:creator>
      <dc:date>2020-03-12T14:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: Value from outside program</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/value-from-outside-program/m-p/9374470#M77243</link>
      <description>&lt;P&gt;No, a is basically a variable that you use to substitute your argument inside the function. If you don't provide a number to x in (DTR x), then your function will return an error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Instead of (defun DTR (a) (* pi (/ a 180.0))), it can also be (defun DTR (abcdef) (* pi (/ abcdef 180.0))). It means the same thing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So it can be (DTR 180), so that means a = 180&lt;/P&gt;&lt;P&gt;then on running (* pi (/ a 180.0)), AutoLISP will calculate (* pi (/ 180 180)), giving you a result of pi.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 14:34:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/value-from-outside-program/m-p/9374470#M77243</guid>
      <dc:creator>jonathanhandojo</dc:creator>
      <dc:date>2020-03-12T14:34:36Z</dc:date>
    </item>
    <item>
      <title>Re: Value from outside program</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/value-from-outside-program/m-p/9374560#M77244</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6941902"&gt;@wstowe&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;....&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: inherit;"&gt;The third option is to list a variable without the /.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;This means that a variable is set up to receive a value passed to it from outside the program. eg :&lt;/P&gt;
&lt;PRE&gt;	(defun DTR (a)
          (* PI (/a 180.0))
	)&lt;/PRE&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;EM&gt;[That needs a &lt;STRONG&gt;space&lt;/STRONG&gt; between the / and the&amp;nbsp; a&amp;nbsp; -- there is no function called&amp;nbsp; /a .]&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would word that differently.&amp;nbsp; In this case,&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;a&lt;/STRONG&gt;&amp;nbsp; is an &lt;STRONG&gt;&lt;EM&gt;argument&lt;/EM&gt;&lt;/STRONG&gt;, which is not really the same kind of thing as a &lt;EM&gt;&lt;STRONG&gt;variable&lt;/STRONG&gt;&lt;/EM&gt;.&amp;nbsp; An argument must be fed in when the function is used; a localized variable is internal to the function's operations.&amp;nbsp; The difference is the reason for the &lt;FONT color="#FF00FF"&gt;slash&lt;/FONT&gt; [if used] in the parentheses after the function name:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;(defun WHATEVER (&lt;FONT color="#FF0000"&gt;arguments if any go here&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#FF00FF"&gt;/&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000FF"&gt;localized&amp;nbsp;variables if any go here&lt;/FONT&gt;) ....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there are no localized variables, that slash is not needed [as is the case with that (DTR) function].&amp;nbsp; If there are, but there are no arguments to be fed in, the slash &lt;EM&gt;is&lt;/EM&gt;&amp;nbsp; needed:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(defun WHATEVER (&lt;FONT color="#FF00FF"&gt;&lt;STRONG&gt;/&lt;/STRONG&gt;&lt;/FONT&gt; &lt;FONT color="#0000FF"&gt;localized&amp;nbsp;variables if any go here&lt;/FONT&gt;) ....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and that is typical of &lt;FONT color="#FF6600"&gt;&lt;STRONG&gt;C&lt;/STRONG&gt;&lt;/FONT&gt;ommand definitions beginning with&amp;nbsp; (defun &lt;FONT color="#FF6600"&gt;&lt;STRONG&gt;C:&lt;/STRONG&gt;&lt;/FONT&gt;MickeyMouse (/ variables) ....&amp;nbsp; which are not supposed to have arguments.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If a function definition lists an argument, you must feed in a value for it inside the parentheses when the function is called, in that case:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(dtr &lt;STRONG&gt;&lt;FONT color="#008000"&gt;45&lt;/FONT&gt;&lt;/STRONG&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and the &lt;FONT color="#008000"&gt;&lt;STRONG&gt;45&lt;/STRONG&gt;&lt;/FONT&gt; will be used inside the routine wherever the argument&amp;nbsp; &lt;STRONG&gt;a&lt;/STRONG&gt;&amp;nbsp; appears.&amp;nbsp; Such function definitions can call for more than one argument -- you must supply a value for each in the order in which they are listed in the definition.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 14:59:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/value-from-outside-program/m-p/9374560#M77244</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2020-03-12T14:59:59Z</dc:date>
    </item>
  </channel>
</rss>

