Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
TCBASIC(1)			  User Commands 		      TCBASIC(1)

NAME
     tcbasic - a small BASIC Interpreter written in C

SYNOPSIS
     tcbasic [filename]

DESCRIPTION
     tcbasic implements a small subset of BASIC in portable C. If the user spec-
     ifies  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.

OPTIONS
     -h, -?	       --help
	    Print a helpful message and exit

     -v 		--version
	    Print version information and exit

STATEMENTS
     REM remark
	    Remark  has  no effect on the execution of the program and acts as a
	    comment to the developer. The remark can contain any character.

     PRINT list
	    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.

     IF expression relop expression THEN statement
	    Evaluates  both 'expression's and compares them using relational op-
	    erator 'relop'. If the relation is true, then the statement will  be
	    executed. Otherwise, the statement is skipped.

     GOTO expression
	    Evaluates 'expression' and jumps to the corresponding line number.

     INPUT var_list
	    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.

     GOSUB expression
	    Evaluates  'expression'  and  jumps to the corresponding line number
	    after saving the current line number.

     RETURN
	    Returns control to the line after the last 'GOSUB' call.

     LET var = expression
	    Assigns the value of expression to variable 'var' where 'var'  is  a
	    single character variable name in the range from A to Z.

     END    Ends the execution of the program.

     STOP   Exits the interpreter.

     BEEP   System beep.

     SHELL cmd
	    Executes a shell command.

     RANDOMIZE
	    Re-seeds  the  random number generator, causing RND to return a dif-
	    ferent sequence of random numbers.	CLS Clears the screen.

FUNCTIONS
     RND    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.

     TIME   Returns the number of seconds since midnight.

     SIN (expression)
	    Returns the sine of the given expression (measured in radians).

     COS (expression)
	    Returns the cosine of the given expression (measured in radians).

     TAN (expression)
	    Returns the tangent of the given expression (measured in radians).

     COT (expression)
	    Returns the cotangent of the given expression (measured in radians).

     ATN (expression)
	    Returns  the  arctangent  of the given expression (measured in radi-
	    ans).

     EXP (expression)
	    Returns e to the power of the given expression.

     LOG (expression)
	    Returns the natural logarithm of of the given expression.

     ABS (expression)
	    Returns the absolute value of the given expression.

     INT (expression)
	    Returns the integer portion of the given expression.

     SGN (expression)
	    Returns the sign of the given expression. 1, 0, or -1 for  positive,
	    zero, or negative.

     SQR (expression)
	    Returns the square root of the given expression.

COMMANDS
     CLEAR  Clears the program from memory and sets all variables to 0.

     LIST   Prints the current program.

     RENUM  Renumber lines in memory.

     RUN    Executes the current program.

     TROFF  Turns off debug tracing.

     TRON   Turns on debug tracing.

AUTHORS
     See https://github.com/tcort/tcbasic/graphs/contributors

REPORTING BUGS
     See https://github.com/tcort/tcbasic/issues

COPYRIGHT
     Copyright	 (C)   2015,   2016,   2017,   2018,  2020   Thomas  Cort  <lin-
     uxgeek@gmail.com>
     This is free software; see the source for copying conditions.  There is  NO
     warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

tcbasic 2.3.0			    June 2018			      TCBASIC(1)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=tcbasic&sektion=1&manpath=FreeBSD+Ports+15.1.quarterly>

home | help