-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtcbasic.1.in
157 lines (157 loc) · 4.85 KB
/
tcbasic.1.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
.\" tcbasic - a small BASIC Interpreter written in C.
.\" Copyright (C) 2015, 2016, 2017, 2018, 2020 Thomas Cort <linuxgeek@gmail.com>
.\"
.\" This program is free software: you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by
.\" the Free Software Foundation, either version 3 of the License, or
.\" (at your option) any later version.
.\"
.\" This program is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public License
.\" along with this program. If not, see <http://www.gnu.org/licenses/>.
.TH TCBASIC "1" "June 2018" "@PROJECT_NAME@ @PROJECT_VERSION@" "User Commands"
.SH NAME
tcbasic \- a small BASIC Interpreter written in C
.SH SYNOPSIS
.B tcbasic
[\fIfilename\fR]
.SH DESCRIPTION
tcbasic implements a small subset of BASIC in portable C. If the user specifies
a filename on the command line or pipes data to tcbasic, the results will be
written to standard out. If no file is specified, an interactive mode is
started where a user can interact with the BASIC system directly.
.SH OPTIONS
.TP
\fB\-h\fR, \-? \fB\-\-help\fR
Print a helpful message and exit
.TP
\fB\-v\fR \fB\-\-version\fR
Print version information and exit
.SH STATEMENTS
.TP
\fBREM remark\fR
Remark has no effect on the execution of the program
and acts as a comment to the developer. The remark can contain
any character.
.TP
\fBPRINT list\fR
Prints the contents of 'list' to the console where 'list' is a
comma separated list of one or more quoted strings, expressions,
and/or variables.
.TP
\fBIF expression relop expression THEN statement\fR
Evaluates both 'expression's and compares them using relational
operator 'relop'. If the relation is true, then the statement
will be executed. Otherwise, the statement is skipped.
.TP
\fBGOTO expression\fR
Evaluates 'expression' and jumps to the corresponding line number.
.TP
\fBINPUT var_list\fR
Given a comma separated list of 1 or more variables, this command
will prompt the user to enter a comma separated list of expressions.
The value of each expression will be assigned to each corresponding
variable.
.TP
\fBGOSUB expression\fR
Evaluates 'expression' and jumps to the corresponding line number
after saving the current line number.
.TP
\fBRETURN\fR
Returns control to the line after the last 'GOSUB' call.
.TP
\fBLET var = expression\fR
Assigns the value of expression to variable 'var' where 'var' is
a single character variable name in the range from A to Z.
.TP
\fBEND\fR
Ends the execution of the program.
.TP
\fBSTOP\fR
Exits the interpreter.
.TP
\fBBEEP\fR
System beep.
.TP
\fBSHELL cmd\fR
Executes a shell command.
.TP
\fBRANDOMIZE\fR
Re-seeds the random number generator, causing RND to return a different
sequence of random numbers.
\fBCLS\fR
Clears the screen.
.SH FUNCTIONS
.TP
\fBRND\fR
Returns a random number in the range [0,1). The same sequence of numbers is
returned in each program run. Use the RANDOMIZE statement to generate
different sequences in each program run.
.TP
\fBTIME\fR
Returns the number of seconds since midnight.
.TP
\fBSIN (expression)\fR
Returns the sine of the given expression (measured in radians).
.TP
\fBCOS (expression)\fR
Returns the cosine of the given expression (measured in radians).
.TP
\fBTAN (expression)\fR
Returns the tangent of the given expression (measured in radians).
.TP
\fBCOT (expression)\fR
Returns the cotangent of the given expression (measured in radians).
.TP
\fBATN (expression)\fR
Returns the arctangent of the given expression (measured in radians).
.TP
\fBEXP (expression)\fR
Returns e to the power of the given expression.
.TP
\fBLOG (expression)\fR
Returns the natural logarithm of of the given expression.
.TP
\fBABS (expression)\fR
Returns the absolute value of the given expression.
.TP
\fBINT (expression)\fR
Returns the integer portion of the given expression.
.TP
\fBSGN (expression)\fR
Returns the sign of the given expression. 1, 0, or -1 for positive, zero, or negative.
.TP
\fBSQR (expression)\fR
Returns the square root of the given expression.
.SH COMMANDS
.TP
\fBCLEAR\fR
Clears the program from memory and sets all variables to 0.
.TP
\fBLIST\fR
Prints the current program.
.TP
\fBRENUM\fR
Renumber lines in memory.
.TP
\fBRUN\fR
Executes the current program.
.TP
\fBTROFF\fR
Turns off debug tracing.
.TP
\fBTRON\fR
Turns on debug tracing.
.SH AUTHORS
See https://github.com/tcort/tcbasic/graphs/contributors
.SH "REPORTING BUGS"
See https://github.com/tcort/tcbasic/issues
.SH COPYRIGHT
Copyright \(co 2015, 2016, 2017, 2018, 2020 Thomas Cort <linuxgeek@gmail.com>
.br
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.