<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://learn.cemetech.net/index.php?action=history&amp;feed=atom&amp;title=TI-BASIC%3APrgm</id>
	<title>TI-BASIC:Prgm - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://learn.cemetech.net/index.php?action=history&amp;feed=atom&amp;title=TI-BASIC%3APrgm"/>
	<link rel="alternate" type="text/html" href="http://learn.cemetech.net/index.php?title=TI-BASIC:Prgm&amp;action=history"/>
	<updated>2026-04-17T16:07:02Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.3</generator>
	<entry>
		<id>http://learn.cemetech.net/index.php?title=TI-BASIC:Prgm&amp;diff=719&amp;oldid=prev</id>
		<title>Maintenance script: Initial automated import</title>
		<link rel="alternate" type="text/html" href="http://learn.cemetech.net/index.php?title=TI-BASIC:Prgm&amp;diff=719&amp;oldid=prev"/>
		<updated>2016-02-24T18:15:11Z</updated>

		<summary type="html">&lt;p&gt;Initial automated import&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Template:TI-BASIC:Command&lt;br /&gt;
|picture=PRGM.GIF&lt;br /&gt;
|summary=Calls another program from within a program, with program execution moving to that program.&lt;br /&gt;
|syntax=prgm&amp;#039;&amp;#039;NAME&amp;#039;&amp;#039;&lt;br /&gt;
|location=Outside the editor, press:&lt;br /&gt;
# PRGM to enter the PRGM menu&lt;br /&gt;
# Use arrows to choose program&lt;br /&gt;
&lt;br /&gt;
When editing a program, press:&lt;br /&gt;
# PRGM to enter the PRGM menu&lt;br /&gt;
# LEFT to enter the EXEC submenu&lt;br /&gt;
# select a program&lt;br /&gt;
|compatibility=TI-83/84/+/SE&lt;br /&gt;
|size=1 byte&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The prgm command is used to execute a program from inside another program (at any time while the program is running), with the secondary program acting as a [[TI-BASIC:Subprograms|subprogram]] for that program. Although they are listed in the program menu and can be executed independently like any other program, subprograms are primarily designed to do a particular task for the other program.&lt;br /&gt;
&lt;br /&gt;
You insert the prgm command into the program where you want the subprogram to run, and then type (with the alpha-lock on) the program name. You can also go to the program menu to choose a program, pressing ENTER to paste the program name into your program.&lt;br /&gt;
&lt;br /&gt;
 PROGRAM:MYPROG&lt;br /&gt;
 :ClrHome&lt;br /&gt;
 :Output(3,3,&amp;quot;Hello&lt;br /&gt;
 :prgmWHATEVER&lt;br /&gt;
&lt;br /&gt;
When the subprogram name is encountered during a program, the program will be put on hold and program execution will transfer to the subprogram. Once the subprogram is finished, program execution will go back to the program, continuing right after the subprogram name.&lt;br /&gt;
&lt;br /&gt;
Although subprograms can call themselves or other subprograms, this should be done sparingly because it can cause memory leaks if done too much or if the subprogram doesn&amp;#039;t return to the parent program.&lt;br /&gt;
&lt;br /&gt;
[[TI-BASIC:Goto|Branching]] is local to each program, so you can’t use Goto in one program to jump to a Lbl in another program. In addition, all [[TI-BASIC:Variables|Variables]] are global, so changing a variable in one program affects the variable everywhere else.&lt;br /&gt;
&lt;br /&gt;
= Advanced Uses =&lt;br /&gt;
&lt;br /&gt;
Each time you call a TI-Basic program, 16 bytes are used to save your place in the original program so you can return to it correctly. This is a small enough amount that you don&amp;#039;t have to worry about it, unless you&amp;#039;re low on RAM or use a lot of recursion.&lt;br /&gt;
&lt;br /&gt;
= Error Conditions =&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;[[TI-BASIC:Errors#archived|ERR:ARCHIVED]]&amp;#039;&amp;#039;&amp;#039; if the program is archived.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;[[TI-BASIC:Errors#syntax|ERR:SYNTAX]]&amp;#039;&amp;#039;&amp;#039;, with no 2:Goto option, if the program is an [[TI-BASIC:Assembly|Assembly]] program.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;[[TI-BASIC:Errors#undefined|ERR:UNDEFINED]]&amp;#039;&amp;#039;&amp;#039; if the program doesn&amp;#039;t exist.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[TI-BASIC:Subprograms|Subprograms]]&lt;br /&gt;
* [[TI-BASIC:Goto|Branching]]&lt;br /&gt;
* [[TI-BASIC:Variables|Variables]][[Category:TI-BASIC]]&lt;br /&gt;
[[Category:TIBD]]&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
	</entry>
</feed>