<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wikidot="http://www.wikidot.com/rss-namespace">

	<channel>
		<title>Integrating a variable into a file name?</title>
		<link>http://tibasicdev.wikidot.com/forum/t-228465/integrating-a-variable-into-a-file-name</link>
		<description>Posts in the discussion thread &quot;Integrating a variable into a file name?&quot; - trying to use a dynamic file reference with a for loop</description>
				<copyright></copyright>
		<lastBuildDate>Fri, 15 May 2026 14:23:44 +0000</lastBuildDate>
		
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-228465#post-1000787</guid>
				<title>Re: Integrating a variable into a file name?</title>
				<link>http://tibasicdev.wikidot.com/forum/t-228465/integrating-a-variable-into-a-file-name#post-1000787</link>
				<description></description>
				<pubDate>Sat, 12 Feb 2011 20:56:00 +0000</pubDate>
				<wikidot:authorName>majaron</wikidot:authorName>				<wikidot:authorUserId>707628</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>I cleared all the variables and now in works.</p> <p>I don't get that error any more but I'm not sure what really messed everything up. Thanks for your help.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-228465#post-1000745</guid>
				<title>Re: Integrating a variable into a file name?</title>
				<link>http://tibasicdev.wikidot.com/forum/t-228465/integrating-a-variable-into-a-file-name#post-1000745</link>
				<description></description>
				<pubDate>Sat, 12 Feb 2011 19:53:48 +0000</pubDate>
				<wikidot:authorName>Xeda Elnara</wikidot:authorName>				<wikidot:authorUserId>595803</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Ah, sorry I am not familiar with java. I am familiar with TI-89 BASIC and I do understand indirection, though. The example I gave stored the value X^2 into varX where X is a number from 1 to 10. So 100→var10, 81→var9, et cetera.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-228465#post-1000733</guid>
				<title>Re: Integrating a variable into a file name?</title>
				<link>http://tibasicdev.wikidot.com/forum/t-228465/integrating-a-variable-into-a-file-name#post-1000733</link>
				<description></description>
				<pubDate>Sat, 12 Feb 2011 19:40:08 +0000</pubDate>
				<wikidot:authorName>majaron</wikidot:authorName>				<wikidot:authorUserId>707628</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Didn't for me. Don't know why.</p> <p>I then did something like @Chokladkakan suggested at the bottom. It works but it's ugly.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-228465#post-1000594</guid>
				<title>Re: Integrating a variable into a file name?</title>
				<link>http://tibasicdev.wikidot.com/forum/t-228465/integrating-a-variable-into-a-file-name#post-1000594</link>
				<description></description>
				<pubDate>Sat, 12 Feb 2011 16:20:10 +0000</pubDate>
				<wikidot:authorName>Xeda Elnara</wikidot:authorName>				<wikidot:authorUserId>595803</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>This worked for me:</p> <div class="code"> <pre><code>test() Prgm For x,1,10 x*x→#(&quot;var&quot;&amp;string(x)) EndFor EndPrgm</code></pre></div> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-228465#post-1000457</guid>
				<title>Re: Integrating a variable into a file name?</title>
				<link>http://tibasicdev.wikidot.com/forum/t-228465/integrating-a-variable-into-a-file-name#post-1000457</link>
				<description></description>
				<pubDate>Sat, 12 Feb 2011 11:17:27 +0000</pubDate>
				<wikidot:authorName>majaron</wikidot:authorName>				<wikidot:authorUserId>707628</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Hi, I'm new around here and before asking something i found this thread, where this part of code that @Dakotah wrote is exactly what i need:</p> <p>:prog1()<br /> :Program<br /> :For x,1,10<br /> :x*x→#(&quot;var&quot;&amp;string(x))<br /> :EndFor<br /> :EndPrgm</p> <p>I would like to get (&quot;var&quot;&amp;number of time this thing loops) So in this case &quot;var&quot;1,&quot;var&quot;2&#8230;&quot;var&quot;10</p> <p>But it doesn't work. I always get tihis: <em>Indirection string is not a valid variable name</em></p> <p>Any ideas to make this work.</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-228465#post-866932</guid>
				<title>Re: Integrating a variable into a file name?</title>
				<link>http://tibasicdev.wikidot.com/forum/t-228465/integrating-a-variable-into-a-file-name#post-866932</link>
				<description></description>
				<pubDate>Tue, 07 Sep 2010 21:03:39 +0000</pubDate>
				<wikidot:authorName>BlakPilar</wikidot:authorName>				<wikidot:authorUserId>538289</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>[SORRY Did not mean to post.]</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-228465#post-864848</guid>
				<title>Re: Integrating a variable into a file name?</title>
				<link>http://tibasicdev.wikidot.com/forum/t-228465/integrating-a-variable-into-a-file-name#post-864848</link>
				<description></description>
				<pubDate>Sun, 05 Sep 2010 03:07:29 +0000</pubDate>
				<wikidot:authorName>Dakotah</wikidot:authorName>				<wikidot:authorUserId>557500</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>To use a variable as part of a file name, use the indirection (#) operator. So in your case, if x is a number from 1 to 10, you can use #(&quot;mat&quot;&amp;string(x)). An example:<br /> :prog1()<br /> :Program<br /> :For x,1,10<br /> :x*x→#(&quot;var&quot;&amp;string(x))<br /> :EndFor<br /> :EndPrgm</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-228465#post-729473</guid>
				<title>Re: Integrating a variable into a file name?</title>
				<link>http://tibasicdev.wikidot.com/forum/t-228465/integrating-a-variable-into-a-file-name#post-729473</link>
				<description></description>
				<pubDate>Sat, 20 Mar 2010 16:21:05 +0000</pubDate>
				<wikidot:authorName>Chokladkakan</wikidot:authorName>				<wikidot:authorUserId>447893</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Alright! I am not entirely sure if something equivalent is possible to do in 68k Basic, but instinctively, I see another solution, but perhaps not as elegant: if you let exampleproject1/ include all the different variations, sorted into conditional statements and then you call exampleproject(x) and if x is 5, do 5.example. Would that work?</p> <p>I made a small example to test if my idea worked, which it does:</p> <div class="code"> <pre><code>:test2() :Prgm :For t,1,6 :test(t) :EndFor :EndPrgm</code></pre></div> <div class="code"> <pre><code>:test(x) :Prgm :If x=1 Then :Disp &quot;Hello!&quot; :ElseIf x=2 Then :Disp &quot;Hey! How are you?&quot; :ElseIf x=3 Then :Disp &quot;I'm good, thanks. You?&quot; :ElseIf x=4 Then :Disp &quot;I'm great, thanks for asking.&quot; :Else :Disp &quot;Bye!&quot; :EndIf :EndPrgm</code></pre></div> <p>Which, when running <strong><tt>test2()</tt></strong> outputs:</p> <div class="code"> <pre><code>Hello! Hey, how are you? I'm good, thanks. You? I'm great, thanks for asking. Bye! Bye!</code></pre></div> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-228465#post-729468</guid>
				<title>Re: Integrating a variable into a file name?</title>
				<link>http://tibasicdev.wikidot.com/forum/t-228465/integrating-a-variable-into-a-file-name#post-729468</link>
				<description></description>
				<pubDate>Sat, 20 Mar 2010 16:13:44 +0000</pubDate>
				<wikidot:authorName>fysicsandPholds</wikidot:authorName>				<wikidot:authorUserId>457763</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>Thanks for the help but I think I was a little unclear<br /> I know how to do this in Java so I'll give an example of the same type of thing in java</p> <p>File tempFile;</p> <p>for (int i=0;i&lt;10;i++){<br /> tempFile = new File(&quot;/exampleproject1/&quot;+i+&quot;.example&quot;);<br /> tempFile.doSomething;}</p> <p>that program would preform the method doSomething for the files (/exampleproject1/) 0.example, 1.example, 2.example, 3.example, etc.<br /> In this Java program the way I integrated the filename with the variable was (&quot;/exampleproject1/&quot;+i+&quot;.example&quot;)<br /> I need some equivalent of this in TI Basic</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-228465#post-729460</guid>
				<title>Re: Integrating a variable into a file name?</title>
				<link>http://tibasicdev.wikidot.com/forum/t-228465/integrating-a-variable-into-a-file-name#post-729460</link>
				<description></description>
				<pubDate>Sat, 20 Mar 2010 15:59:27 +0000</pubDate>
				<wikidot:authorName>Chokladkakan</wikidot:authorName>				<wikidot:authorUserId>447893</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>I might be misunderstanding you, and if so, please forgive me, but here goes:</p> <p>You know how you have to write () after a program name in 68k? Well, if you in the program code</p> <p><strong><tt>name()</tt></strong><br /> <strong><tt>Prgm</tt></strong><br /> <strong><tt>EndPrgm</tt></strong></p> <p>write</p> <p><strong><tt>name(x)</tt></strong></p> <p>you can call upon the entered variable x later within the program!</p> 
				 	]]>
				</content:encoded>							</item>
					<item>
				<guid>http://tibasicdev.wikidot.com/forum/t-228465#post-729446</guid>
				<title>Integrating a variable into a file name?</title>
				<link>http://tibasicdev.wikidot.com/forum/t-228465/integrating-a-variable-into-a-file-name#post-729446</link>
				<description></description>
				<pubDate>Sat, 20 Mar 2010 15:38:54 +0000</pubDate>
				<wikidot:authorName>fysicsandPholds</wikidot:authorName>				<wikidot:authorUserId>457763</wikidot:authorUserId>				<content:encoded>
					<![CDATA[
						 <p>I am creating a program that requires the manipulation of several files of a similar title (Appfolder/mat*x*)<br /> where x represents a number between 1 and 10. (so the files i am working with are called mat1, mat2, mat3, mat4,..etc)<br /> I want to know if there is a way I can call upon these files with a variable so I can use a for loop to repeat a similar procedure on them<br /> whenever i try just calling upon matx it just thinks I mean a file called matx not mat1 or mat2 or whatever x equals?<br /> Example<br /> For i,1,10,1<br /> For x,1,3,1<br /> For y,1,3,1<br /> Define Appfolder/mat*i*[x,y]=&#8230;etc.<br /> EndFor<br /> EndFor<br /> EndFor</p> <p>*Edit* matx is not a program. It is a matrix variable I need to edit within the context of a program</p> 
				 	]]>
				</content:encoded>							</item>
				</channel>
</rss>