# FreeBSD Manual Pages

TCBASIC(1) User Commands TCBASIC(1)NAMEtcbasic - a small BASIC Interpreter written in CSYNOPSIStcbasic[filename]DESCRIPTIONtcbasic 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.OPTIONS-h, -?--helpPrint a helpful message and exit-v--versionPrint version information and exitSTATEMENTSREMremarkRemark has no effect on the execution of the program and acts as a comment to the developer. The remark can contain any charac- ter.listPrints the contents of 'list' to the console where 'list' is a comma separated list of one or more quoted strings, expressions, and/or variables.IFexpressionrelopexpressionTHENstatementEvaluates 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.GOTOexpressionEvaluates 'expression' and jumps to the corresponding line num- ber.INPUTvar_listGiven a comma separated list of 1 or more variables, this com- mand will prompt the user to enter a comma separated list of ex- pressions. The value of each expression will be assigned to each corresponding variable.GOSUBexpressionEvaluates 'expression' and jumps to the corresponding line num- ber after saving the current line number.RETURNReturns control to the line after the last 'GOSUB' call.LETvar=expressionAssigns the value of expression to variable 'var' where 'var' is a single character variable name in the range from A to Z.ENDEnds the execution of the program.STOPExits the interpreter.RANDOMIZERe-seeds the random number generator, causing RND to return a different sequence of random numbers.FUNCTIONSRNDReturns 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.SIN(expression)Returns the sine of the given expression (measured in radians).COS(expression)Returns the cosine of the given expression (measured in radi- ans).TAN(expression)Returns the tangent of the given expression (measured in radi- ans).COT(expression)Returns the cotangent of the given expression (measured in radi- ans).ATN(expression)Returns the arctangent of the given expression (measured in ra- dians).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.SQR(expression)Returns the square root of the given expression.COMMANDSCLEARClears the program from memory and sets all variables to 0.LISTPrints the current program.RUNExecutes the current program.AUTHORSSee https://github.com/tcort/tcbasic/graphs/contributorsREPORTING BUGSSee https://github.com/tcort/tcbasic/issuesCOPYRIGHTCopyright (C) 2015 Thomas Cort <linuxgeek@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.1.0 May 2015 TCBASIC(1)

NAME | SYNOPSIS | DESCRIPTION | OPTIONS | STATEMENTS | FUNCTIONS | COMMANDS | AUTHORS | REPORTING BUGS | COPYRIGHT

Want to link to this manual page? Use this URL:

<https://www.freebsd.org/cgi/man.cgi?query=tcbasic&sektion=1&manpath=FreeBSD+12.0-RELEASE+and+Ports>