You are here

Language reference

See the Download section for offline help text.

BASIC is a very simple language and it is a perfect tool for calculations or utilities. Its name stands for (B)eginners (A)ll-purpose (S)ymbolic (I)nstruction ©ode. It was developed by John Kemeny and Thomas Kurtz at Dartmouth College during the middle of 1960, and was one of the most popular languages for several decades.

How to read the language reference syntax

  • Everything written inside of [ ] characters are optional values.
  • Everything written inside of { characters means you must select one of them.
  • The symbol | means OR.
  • The symbols ... mean you can repeat the previous syntax.
  • Keywords are written with capital letters.
  • Parameters are written with lower letters.
  • Keywords with suffix ( ) are functions.
  • Parameters with suffix ( ) are arrays.
FOO     <- This is keyword
FOO()   <- This is function
foo     <- This is variable/parameter
foo()   <- This is array/parameter
{A|B}   <- This means that you must type A or B
[{A|B}] <- This means that you must use A or B or nothing

The following example means that you must give the first parameter (a) but you can use the second (x) only if you want to. But if you want to use the (x) you must also separate it from (a) with a comma.

FOO a[, x]

The next example means that you must use the first parameter. You can also use second parameter but you must separate it with ‘,’ or ‘;’. You can also repeat the last syntax more times.

FOO var [{,|;} var2 [...]]

The following code demonstrates valid examples of this syntax:

FOO a
FOO a, b
FOO a; b
FOO a, b; c
FOO a, b, c
FOO a; b; c, d; e, f, g

Index

? ! ~ ABS ABSMAX ABSMIN ACCESS ACCESS ACOS ACOSH ACOT ACOTH ACSC ACSCH AND APPEND ARC ASC ASEC ASECH ASIN ASINH AT ATAN ATAN2 ATANH ATN BALLOC BAND BCOPY BCS BEEP BGETC BIN BLOAD BOR BPUTC BSAVE BUTTON BYREF CALL CASE CAT CBS CDBL CEIL CHAIN CHART CHDIR CHMOD CHOP CHR CINT CIRCLE CLOSE CLS COLOR CONST COPY COS COSH COT COTH CREAL CSC CSCH DATA DATE DATEDMY DATEFMT DEF DEFINEKEY DEG DELAY DELETE DERIV DETERM DIFFEQN DIM DIRWALK DISCLOSE DO DOFORM DRAW DRAWPOLY ELIF ELSE ELSEIF EMPTY ENCLOSE END ENDIF ENV ENV ENVIRON ENVIRON EOF ERASE EQV EXEC EXIST EXIT EXP EXPORT EXPRSEQ FI FILES FIX FLOOR FOR FORMAT FRAC FRE FREEFILE FUNC GOSUB GOTO HEX HTML IF IFF IMAGE IMAGEH IMAGEW IMP IMPORT IN INKEY INPUT INPUT INPUT INSERT INSTR INT INTERSECT INVERSE ISARRAY ISDIR ISFILE ISLINK ISNUMBER ISSTRING JOIN JULIAN KILL LABEL LINEINPUT LINPUT LBOUND LCASE LEFT LEFTOF LEFTOFLAST LEN LET LIKE LINE LINEQN LOCAL LOCATE LOCK LOF LOG LOG10 LOGPRINT LOWER LTRIM M3APPLY M3IDENT M3ROTATE M3SCALE M3TRANS MAX MALLOC MDL MID MIN MKDIR MOD NAND NEXT NOR NOSOUND NOT OCT ON OR OPEN OPTION PAINT PAUSE PEEK PEEK16 PEEK32 PEN PEN PLAY PLOT POINT POLYAREA POLYCENT POLYEXT POW PRINT PROGLINE PSET PTDISTLN PTDISTSEG PTSIGN RAD RANDOMIZE READ RECT REDIM REM RENAME REPEAT REPLACE RESTORE RETURN RGB RGBF RIGHT RIGHTOF RIGHTOFLAST RINSTR RMDIR RND ROOT ROUND RTE RTRIM RUN SEARCH SEC SECH SEEK SEEK SEGCOS SEGLEN SEGSIN SELECT SEQ SGN SIN SINH SINPUT SORT SOUND SPACE SPC SPLIT SPRINT SQUEEZE SQR STATMEAN STATMEANDEV STATSPREADP STATSPREADS STEP STKDUMP STOP STR STRING SUM SUMSQ SWAP SUB TAB TAN TANH TEXT TEXTHEIGHT TEXTWIDTH THEN TICKS TICKSPERSEC TIME TIMEHMS TIMER TLOAD TRANSLATE TRIM TROFF TRON TSAVE TXTH TXTW UBOUND UCASE UNIT UNTIL UPPER USE VADR VAL VIEW WEEKDAY WEND WHILE WINDOW WRITE XOR XPOS XNOR YPOS

Index by Module