<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.color64wiki.itchybutt.org/index.php?action=history&amp;feed=atom&amp;title=Use_of_go_command</id>
	<title>Use of go command - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.color64wiki.itchybutt.org/index.php?action=history&amp;feed=atom&amp;title=Use_of_go_command"/>
	<link rel="alternate" type="text/html" href="https://www.color64wiki.itchybutt.org/index.php?title=Use_of_go_command&amp;action=history"/>
	<updated>2026-08-24T20:16:27Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.0</generator>
	<entry>
		<id>https://www.color64wiki.itchybutt.org/index.php?title=Use_of_go_command&amp;diff=989&amp;oldid=prev</id>
		<title>Admin at 16:18, 29 July 2026</title>
		<link rel="alternate" type="text/html" href="https://www.color64wiki.itchybutt.org/index.php?title=Use_of_go_command&amp;diff=989&amp;oldid=prev"/>
		<updated>2026-07-29T16:18:35Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:18, 29 July 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{DISPLAYTITLE:&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Enhanced IF Statement&lt;/del&gt;}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{DISPLAYTITLE:&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Use of GO() Command&lt;/ins&gt;}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[programming features|Programming Features]] - &amp;lt;strong&amp;gt;Use of GO() Command&amp;lt;/strong&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[programming features|Programming Features]] - &amp;lt;strong&amp;gt;Use of GO() Command&amp;lt;/strong&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://www.color64wiki.itchybutt.org/index.php?title=Use_of_go_command&amp;diff=988&amp;oldid=prev</id>
		<title>Admin: Created page with &quot;{{DISPLAYTITLE:Enhanced IF Statement}} Programming Features - &lt;strong&gt;Use of GO() Command&lt;/strong&gt;  Color 64 adds GO() as a conditional expression function. It selects and returns one of two possible values based on whether a condition is true or false.  GO() is similar to placing a small IF/ELSE decision inside an expression. It may be used in assignments, calculations, string construction, output statements, function arguments, and other locati...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.color64wiki.itchybutt.org/index.php?title=Use_of_go_command&amp;diff=988&amp;oldid=prev"/>
		<updated>2026-07-29T16:17:05Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{DISPLAYTITLE:Enhanced IF Statement}} &lt;a href=&quot;/index.php/Programming_features&quot; title=&quot;Programming features&quot;&gt;Programming Features&lt;/a&gt; - &amp;lt;strong&amp;gt;Use of GO() Command&amp;lt;/strong&amp;gt;  Color 64 adds GO() as a conditional expression function. It selects and returns one of two possible values based on whether a condition is true or false.  GO() is similar to placing a small IF/ELSE decision inside an expression. It may be used in assignments, calculations, string construction, output statements, function arguments, and other locati...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{DISPLAYTITLE:Enhanced IF Statement}}&lt;br /&gt;
[[programming features|Programming Features]] - &amp;lt;strong&amp;gt;Use of GO() Command&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Color 64 adds GO() as a conditional expression function. It selects and returns one of two possible values based on whether a condition is true or false.&lt;br /&gt;
&lt;br /&gt;
GO() is similar to placing a small IF/ELSE decision inside an expression. It may be used in assignments, calculations, string construction, output statements, function arguments, and other locations where BASIC expects a value.&lt;br /&gt;
&lt;br /&gt;
Unlike an ordinary IF...THEN statement, GO() returns a value.&lt;br /&gt;
&lt;br /&gt;
Syntax&lt;br /&gt;
&amp;lt;strong&amp;gt;GO(condition,true-result,false-result)&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The three required parts are:&lt;br /&gt;
* condition is the expression tested by GO().&lt;br /&gt;
* true-result is returned when the condition is true.&lt;br /&gt;
* false-result is returned when the condition is false.&lt;br /&gt;
&lt;br /&gt;
Both commas and the closing parenthesis are required.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Numeric Conditions&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For a numeric condition:&lt;br /&gt;
|0       = False&lt;br /&gt;
|Nonzero = True&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 100 A=GO(X&amp;gt;10,1,0)&lt;br /&gt;
When X is greater than 10, A is set to 1. Otherwise, A is set to 0.&lt;br /&gt;
&lt;br /&gt;
Any nonzero numeric value is considered true, including negative values.&lt;br /&gt;
 100 A=GO(X,50,25)&lt;br /&gt;
If X is nonzero, A becomes 50. If X is zero, A becomes 25.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;String Conditions&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A string may also be used as the condition:&lt;br /&gt;
|Null string     = False&lt;br /&gt;
|Nonempty string = True&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 100 A$=GO(FI$,&amp;quot;FILE: &amp;quot;+FI$,&amp;quot;NO FILE&amp;quot;)&lt;br /&gt;
If FI$ contains one or more characters, the first result is returned. If FI$ is empty, &amp;quot;NO FILE&amp;quot; is returned. This provides a compact way to test whether a string contains data without separately checking its length.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Numeric Results&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GO() may return numeric values or numeric expressions.&lt;br /&gt;
 100 A=GO(X=5,100,200)&lt;br /&gt;
If X equals 5, A becomes 100. Otherwise, A becomes 200.&lt;br /&gt;
&lt;br /&gt;
The result expressions do not have to be constants:&lt;br /&gt;
 100 A=GO(X&amp;gt;Y,X*2,Y*2)&lt;br /&gt;
If X is greater than Y, the result is X*2. Otherwise, the result is Y*2.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;String Results&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GO() may return strings or string expressions.&lt;br /&gt;
 100 A$=GO(ER=0,&amp;quot;OK&amp;quot;,&amp;quot;ERROR&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
String expressions may include variables, concatenation, and other string functions:&lt;br /&gt;
 100 A$=GO(FI$&amp;lt;&amp;gt;&amp;quot;&amp;quot;,&amp;quot;OPENING &amp;quot;+FI$,&amp;quot;NO FILENAME&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Using GO() in Output&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because GO() returns a value, it may be used directly inside an output statement.&lt;br /&gt;
 100 PRINT GO(X,&amp;quot;YES&amp;quot;,&amp;quot;NO&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
It may also be combined with other text:&lt;br /&gt;
 100 PRINT &amp;quot;WORD WRAP &amp;quot;;GO(WW,&amp;quot;ON&amp;quot;,&amp;quot;OFF&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
An actual Color 64-style use is:&lt;br /&gt;
 100 %GO(FM,&amp;quot;WORDWRAP ON&amp;quot;,&amp;quot;WORDWRAP OFF&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Lazy Evaluation&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An important feature of GO() is that it evaluates only the result that is selected.&lt;br /&gt;
&lt;br /&gt;
When the condition is true:&lt;br /&gt;
* The true result is evaluated.&lt;br /&gt;
* The false result is skipped.&lt;br /&gt;
&lt;br /&gt;
When the condition is false:&lt;br /&gt;
* The true result is skipped.&lt;br /&gt;
* The false result is evaluated.&lt;br /&gt;
&lt;br /&gt;
This differs from functions that evaluate every argument before selecting a result.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Avoiding Invalid Calculations&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lazy evaluation can prevent an error in an unused expression.&lt;br /&gt;
 100 A=GO(D&amp;lt;&amp;gt;0,N/D,0)&lt;br /&gt;
If D is zero, N/D is skipped and the function returns zero. A division-by-zero error does not occur.&lt;br /&gt;
&lt;br /&gt;
Without lazy evaluation, both result expressions would be calculated and the division would fail even though its result was not needed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Avoiding Invalid String Operations&amp;lt;/strong&amp;gt;&lt;br /&gt;
 100 A$=GO(LEN(I$)&amp;gt;0,LEFT$(I$,1),&amp;quot;&amp;quot;)&lt;br /&gt;
When I$ is empty, the LEFT$ expression is skipped and a null string is returned.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Nested GO() Functions&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A GO() function may be placed inside another GO() function.&lt;br /&gt;
 100 A$=GO(X=1,&amp;quot;ONE&amp;quot;,GO(X=2,&amp;quot;TWO&amp;quot;,&amp;quot;OTHER&amp;quot;))&lt;br /&gt;
This produces:&lt;br /&gt;
* X = 1  returns &amp;quot;ONE&amp;quot;&lt;br /&gt;
* X = 2  returns &amp;quot;TWO&amp;quot;&lt;br /&gt;
* Other  returns &amp;quot;OTHER&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Nested use can replace several small IF tests, but deeply nested expressions may become difficult to read and maintain.&lt;br /&gt;
&lt;br /&gt;
For more complicated decisions, ordinary IF...THEN, ON...GOTO, or a subroutine may be clearer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Comparisons as Conditions&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Any BASIC comparison may be used as the condition:&lt;br /&gt;
* GO(A=B,...,...)&lt;br /&gt;
* GO(A&amp;lt;&amp;gt;B,...,...)&lt;br /&gt;
* GO(A&amp;gt;B,...,...)&lt;br /&gt;
* GO(A&amp;lt;B,...,...)&lt;br /&gt;
* GO(A&amp;gt;=B,...,...)&lt;br /&gt;
* GO(A$=&amp;quot;Y&amp;quot;,...,...)&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
 100 A$=GO(LV&amp;gt;=9,&amp;quot;SYSOP&amp;quot;,&amp;quot;CALLER&amp;quot;)&lt;br /&gt;
 100 A=GO(CR&amp;gt;0,CR-1,0)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Function Calls Within GO()&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The condition and result sections may contain other BASIC or Color 64 functions:&lt;br /&gt;
 100 A$=GO(LEN(FI$)&amp;gt;15,LEFT$(FI$,15),FI$)&lt;br /&gt;
 100 A=GO(@2(&amp;quot;A&amp;quot;,I$),1,0)&lt;br /&gt;
&lt;br /&gt;
Commas inside nested function parentheses are handled correctly:&lt;br /&gt;
 100 A$=GO(X,LEFT$(I$,10),RIGHT$(I$,10))&lt;br /&gt;
&lt;br /&gt;
Commas or parentheses inside quoted strings are treated as ordinary characters:&lt;br /&gt;
 100 A$=GO(X,&amp;quot;YES, CONTINUE&amp;quot;,&amp;quot;NO, STOP&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Result Types&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The selected result may be numeric or string.&lt;br /&gt;
 100 A=GO(X,1,0)&lt;br /&gt;
returns a numeric value.&lt;br /&gt;
&lt;br /&gt;
 100 A$=GO(X,&amp;quot;YES&amp;quot;,&amp;quot;NO&amp;quot;)&lt;br /&gt;
returns a string value.&lt;br /&gt;
&lt;br /&gt;
The two result expressions can technically be different types:&lt;br /&gt;
 100 X=GO(A,10,&amp;quot;ERROR&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
However, this is not recommended. The type returned changes according to the condition, and the receiving expression may produce a TYPE MISMATCH.&lt;br /&gt;
&lt;br /&gt;
For predictable operation, both result expressions should normally return the same type:&lt;br /&gt;
&lt;br /&gt;
GO(condition,number,number)&lt;br /&gt;
&lt;br /&gt;
or:&lt;br /&gt;
&lt;br /&gt;
GO(condition,string,string)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;What GO() Can Do&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
GO() can:&lt;br /&gt;
* Select between two numeric values.&lt;br /&gt;
* Select between two strings.&lt;br /&gt;
* Use numeric comparisons as conditions.&lt;br /&gt;
* Use an empty or nonempty string as a condition.&lt;br /&gt;
* Return calculations and complete expressions.&lt;br /&gt;
* Be used inside larger expressions.&lt;br /&gt;
* Be used in PRINT and Color 64 output commands.&lt;br /&gt;
* Be passed as an argument to another function.&lt;br /&gt;
* Contain nested BASIC functions.&lt;br /&gt;
* Contain another GO() function.&lt;br /&gt;
* Avoid evaluating an unsafe or unnecessary expression.&lt;br /&gt;
* Replace simple IF/ELSE value-selection code.&lt;br /&gt;
&lt;br /&gt;
What GO() Cannot Do&lt;br /&gt;
* GO() does not replace BASIC program-control statements.&lt;br /&gt;
&lt;br /&gt;
The true and false sections must be expressions that return values. They cannot contain statement commands such as:&lt;br /&gt;
* GOTO&lt;br /&gt;
* GOSUB&lt;br /&gt;
* RETURN&lt;br /&gt;
* PRINT&lt;br /&gt;
* INPUT&lt;br /&gt;
* POKE&lt;br /&gt;
* OPEN&lt;br /&gt;
* CLOSE&lt;br /&gt;
* FOR&lt;br /&gt;
* NEXT&lt;br /&gt;
&lt;br /&gt;
For example, this is not valid:&lt;br /&gt;
 100 GO(X,GOTO 500,GOTO 600)&lt;br /&gt;
&lt;br /&gt;
Use an ordinary IF statement instead:&lt;br /&gt;
 100 IF X THEN GOTO 500&lt;br /&gt;
 110 GOTO 600&lt;br /&gt;
&lt;br /&gt;
GO() also cannot execute a series of colon-separated statements:&lt;br /&gt;
 100 GO(X,A=1:B=2,A=3:B=4)&lt;br /&gt;
&lt;br /&gt;
Assignments and statement sequences must remain outside the function.&lt;br /&gt;
* GO() Does Not Mean GOTO&lt;br /&gt;
* GO() is a value-returning function.&lt;br /&gt;
&lt;br /&gt;
It does not branch to a BASIC line number.&lt;br /&gt;
 A=GO(X,100,200)&lt;br /&gt;
sets A to either 100 or 200. It does not transfer execution to line 100 or line 200.&lt;br /&gt;
&lt;br /&gt;
To branch between line numbers, use IF...THEN or ON...GOTO&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Common Uses&amp;lt;/strong&amp;gt;&lt;br /&gt;
On/Off Text&lt;br /&gt;
 100 PRINT &amp;quot;MODE: &amp;quot;;GO(MD,&amp;quot;ON&amp;quot;,&amp;quot;OFF&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Default Value&lt;br /&gt;
 100 A$=GO(FI$,FI$,&amp;quot;UNTITLED&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Minimum Value&lt;br /&gt;
 100 A=GO(X&amp;lt;0,0,X)&lt;br /&gt;
&lt;br /&gt;
Maximum Limit&lt;br /&gt;
 100 A=GO(X&amp;gt;255,255,X)&lt;br /&gt;
&lt;br /&gt;
Safe Division&lt;br /&gt;
 100 A=GO(D,N/D,0)&lt;br /&gt;
&lt;br /&gt;
Optional Carriage Return&lt;br /&gt;
 100 I$=@8+GO(!60,CR$,&amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Display Width&lt;br /&gt;
 100 PRINT GO(MC&amp;gt;40,&amp;quot;80 COLUMN&amp;quot;,&amp;quot;40 COLUMN&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Nested Selection&lt;br /&gt;
 100 A$=GO(LV&amp;gt;=9,&amp;quot;SYSOP&amp;quot;,GO(LV&amp;gt;=5,&amp;quot;MODERATOR&amp;quot;,&amp;quot;CALLER&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;Programming Recommendations&amp;lt;/strong&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use GO() when choosing between two values as part of an expression.&lt;br /&gt;
&lt;br /&gt;
It is especially useful for:&lt;br /&gt;
* Short text substitutions.&lt;br /&gt;
* On/off descriptions.&lt;br /&gt;
* Default values.&lt;br /&gt;
* Safe calculations.&lt;br /&gt;
* Compact comparison results.&lt;br /&gt;
* Avoiding several nearly identical IF statements.&lt;br /&gt;
&lt;br /&gt;
Use a normal IF...THEN structure when:&lt;br /&gt;
* Program execution must branch to another line.&lt;br /&gt;
* Variables must be assigned in multiple statements.&lt;br /&gt;
* Several commands must be performed.&lt;br /&gt;
* The decision requires lengthy or complicated processing.&lt;br /&gt;
* Nested GO() expressions would make the program difficult to read.&lt;br /&gt;
&lt;br /&gt;
Next Section: [[shorthand numeric updates|Shorthand Numeric Updates]]&lt;br /&gt;
&lt;br /&gt;
[[programming features|Programming Features]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>