<?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 Pass Variable problems in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/pass-variable-problems/m-p/2508459#M146997</link>
    <description>I think this is a simple question but I cant seem to work it out.  I have a main Sub that calls a Function, and I want to pass the value of a variable from my main Sub to my Function. &lt;BR /&gt;
&lt;BR /&gt;
Here's what i'm doing, the whole code is rather long so here is a condensed version:&lt;BR /&gt;
{code}&lt;BR /&gt;
sub start()&lt;BR /&gt;
'-open excel workbook-&lt;BR /&gt;
dim oExclN as Integer&lt;BR /&gt;
'-gather lots of information-&lt;BR /&gt;
'-close workbook-&lt;BR /&gt;
'-open inventor file-&lt;BR /&gt;
call NewDocUpdater&lt;BR /&gt;
end sub&lt;BR /&gt;
&lt;BR /&gt;
private function NewDocUpdater()&lt;BR /&gt;
'-call another function-&lt;BR /&gt;
'-do stuff-&lt;BR /&gt;
end function&lt;BR /&gt;
{code}&lt;BR /&gt;
&lt;BR /&gt;
 I am trying to use "ByVal 'myvariable' as Integer".  If I attach that to my Function, I get a "argument is not optional" error on the 'call NewDocUpdater' in my Sub.  If i attach it to my Sub it wont run anymore.  I've tried changing it to public and private on both Sub and Function but no change.  And i'd like to pass this value along when my Function calls another routine.</description>
    <pubDate>Wed, 17 Jun 2009 15:45:07 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2009-06-17T15:45:07Z</dc:date>
    <item>
      <title>Pass Variable problems</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/pass-variable-problems/m-p/2508459#M146997</link>
      <description>I think this is a simple question but I cant seem to work it out.  I have a main Sub that calls a Function, and I want to pass the value of a variable from my main Sub to my Function. &lt;BR /&gt;
&lt;BR /&gt;
Here's what i'm doing, the whole code is rather long so here is a condensed version:&lt;BR /&gt;
{code}&lt;BR /&gt;
sub start()&lt;BR /&gt;
'-open excel workbook-&lt;BR /&gt;
dim oExclN as Integer&lt;BR /&gt;
'-gather lots of information-&lt;BR /&gt;
'-close workbook-&lt;BR /&gt;
'-open inventor file-&lt;BR /&gt;
call NewDocUpdater&lt;BR /&gt;
end sub&lt;BR /&gt;
&lt;BR /&gt;
private function NewDocUpdater()&lt;BR /&gt;
'-call another function-&lt;BR /&gt;
'-do stuff-&lt;BR /&gt;
end function&lt;BR /&gt;
{code}&lt;BR /&gt;
&lt;BR /&gt;
 I am trying to use "ByVal 'myvariable' as Integer".  If I attach that to my Function, I get a "argument is not optional" error on the 'call NewDocUpdater' in my Sub.  If i attach it to my Sub it wont run anymore.  I've tried changing it to public and private on both Sub and Function but no change.  And i'd like to pass this value along when my Function calls another routine.</description>
      <pubDate>Wed, 17 Jun 2009 15:45:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/pass-variable-problems/m-p/2508459#M146997</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-06-17T15:45:07Z</dc:date>
    </item>
    <item>
      <title>Re: Pass Variable problems</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/pass-variable-problems/m-p/2508460#M146998</link>
      <description>sub start()&lt;BR /&gt;
'-open excel workbook-&lt;BR /&gt;
dim oExclN as Integer&lt;BR /&gt;
'-gather lots of information-&lt;BR /&gt;
'-close workbook-&lt;BR /&gt;
'-open inventor file-&lt;BR /&gt;
call NewDocUpdater(Argument)&lt;BR /&gt;
end sub&lt;BR /&gt;
&lt;BR /&gt;
private function NewDocUpdater(Argument as ?)&lt;BR /&gt;
'-call another function-&lt;BR /&gt;
'-do stuff-&lt;BR /&gt;
end function</description>
      <pubDate>Wed, 17 Jun 2009 15:54:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/pass-variable-problems/m-p/2508460#M146998</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-06-17T15:54:15Z</dc:date>
    </item>
    <item>
      <title>Re: Pass Variable problems</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/pass-variable-problems/m-p/2508461#M146999</link>
      <description>Thanks CadFish,  that was my problem.  I was missing that little tab on my 'Call' line.</description>
      <pubDate>Wed, 17 Jun 2009 16:02:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/pass-variable-problems/m-p/2508461#M146999</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-06-17T16:02:17Z</dc:date>
    </item>
  </channel>
</rss>

