ABS(exp) Returns absolute value of exp. ACOS(exp) Returns the arc cosine of exp. ADDRESS of BJ Gleason The American University CSIS (Thin Air Labs) 4400 Massachusetts Avenue, N.W. Washington, DC 20016 Compuserve : 73337,2011 ALARM Beep speaker, Wait for keypress. PORT ONLY ALTR.COM TSR to invoke P.EXE from editor to Execute ASC(x$) Returns ASCII value of the first character in x$. ASIN(exp) Returns the arc sine of exp. ATN(exp) Returns Arc Tangent of exp. BEEP Single beep from the speaker. PORT ONLY BIN$(n) Converts n to a binary string. BLOAD filename, offset Load Binary file to SEG:offset. BOX row1, col1, row2, col2, type Draw a box. Row1 and Col1 specify the upper left corner position of the box, Row2 and Col2 specify the lower right. Type 0 for single line, 1 for a double PORT ONLY BSAVE filename, offset, length Save binary image of length bytes at SEG:offset to filename. BREAK - Atari key (/|\) CALL address Transfer control to SEG:address. CALL INTERRUPT intnum Invoke DOS interrupt intnum. CHAIN filename Load and execute filename.BAS. All variables are preserved. CHDIR pathname Change directory to pathname. CHR$(n) Returns ASCII char of the value n. CLICK Make the key click sound. PORT ONLY CLOSE #fileno Close a file. CLS Clears the screen. COMMAND$ Return the command line that started PBASIC. COS(exp) Returns cosine of exp. COSH(exp) Returns hyperbolic cosine of exp. CSRLIN Returns current cursor line. DATA list of numbers/strings MUST have a line number. Elements separted by commas Strings must be enclosed in quotes. 12 DATA 1,2,3,4,5,6 DATE$ Returns system date. DECR(n) Decrement n by 1. DEF SEG = exp Assigns a segment address for memory accessing via PEEK, POKE and CALL. DEG(exp) Convert radians to degrees. DIAL string Dial the "number" through the speaker. Valid tones are: 0 1 2 3 4 5 6 7 8 9 A B C D * #. PORT ONLY DIM var(size,[size]){,var(size)} Dimension Float or String Arrays DISPLAY exp 0=Static, 1=Normal, 2=Tracked PORT ONLY DMS(exp) Convert degrees to degree.minsec EDITOR Name PBASIC.EXE P.EXE Returns to Editor on Error END EOF(fileno) Test for End of File. ERL Returns the linenumber of the last error. ERR Returns the error number of the last error. ERROR errnum Simulate Error. ERRORLEVEL Code generated upon exit. 0 - Successful exit 1 - Program aborted 2 - STOP encountered ERRWIN row, col, "message" Display message at row, col. Beep and wait for keypress. PORT ONLY EVAL x$ Evaluate x$ as part of a PBASIC program. x$ MUST be a string variable. EXP(exp) Returns e to the power of exp. FALSE Returns 0. FIX(exp) Returns integer portion of exp. FORMFEED Send a formfeed to the printer. FOR var = exp TO exp [STEP exp] FRE(exp) Returns free amount of memory. Parameter exp is a dummy expression. GETDISPLAY Returns the current display mode. See DISPLAY for details. PORT ONLY GOSUB line number GOTO line number HEX$(n) Converts n to a hexidecmial string. IF exp THEN stmt [ ELSE stmt ] INCR(n) Increment n by 1. INKEY$ If a key is pressed, char is returned, otherwise, the empty string (""). INPUT ["prompt" (,|;)] varname [,] no ?, [;] ? is printed INPUT #fileno, varname [,varname...] Read data from a file. INP(port) Returns byte value from port. INPUT$(n,#fileno) Return n character from #fileno. INSTR(x$,y$) Returns position of y$ in x$. INT(exp) Returns integer portion of exp. KILL filename Delete filename from disk. LCASE$ x$ Returns the lower case version of x$. LEFT$(x$,n) Returns leftmost n characters of x$. LEN(x$) Returns the length of x$. LOCATE row,col[,cur] Move the cursor to row, col. 1,1 is top left. cur = 0-off, 1-underline, 2-block LOG(exp) Returns natural log of exp. LPOS(exp) Returns position of line printer head. Exp is a dummy expression. LTRIM$(n$) Returns n$ with no leading spaces. LPRINT list of expressions Send output to printer. See PRINT. MENU(row, col, display, topline, selected, elements, "Title",entries) Display menu, result%256=entry, result\256=topline Display is number of elements to show Topline is element at top Selected is cursor element Element is number of entries + title MID$(x$,n,m) Returns string from x$, starting at position n for m characters. MSD(exp) Convert Degrees.minsec to degrees. MKDIR pathname Make a directory called pathname. NEXT [var] NUMFMT = "format" Default number format. "% g " for GWBASIC. "%e" scientific. OCT$(n) Converts n to an Octal string. OFF Tunr off until keypress. PORT ONLY ON ERROR GOTO line number Transfer to line number on error. ON ERROR GOTO 0 Disable error trapping. ON exp GOSUB list of line numbers ON exp GOTO list of line numbers OUT port, exp Send value to the indicated port. OPEN "mode", fileno, filename Opens a file for access. "mode" is "I" input, "O" output, and "A" append. PBASIC filename.ext [-T] Use filename.ext Default .ext is .BAS -T turns on Line Trace PBASIC [-T] Use last file you were editing -T turns on Line Trace PBVER Returns the version number of PBASIC. PEEK(address) Returns byte from SEG:address. SEG is set via DEF SEG. PGLOAD filename Load a .PGC file into screen memory. PGSAVE filename Save screen memory as a .PGC file. PGSHOW filename, delay Load and Display a .PGC file. Delay is seconds, 0 is a keypress. PI Returns 3.14159. POINT(row,col) Returns value of pixel at row,col. POKE addr, exp Places value at SEG:addr. SEG is set via the DEF SEG statement. If you are doing Video Memory, use REFRESH. PORT Returns a 1 if running on a Portfolio, 0 if not. Portfolio BASIC, version 4.1 (c) 1991 BJ Gleason by BJ Gleason, American University POS(exp) Returns the current cursor column. Exp is a dummy expression. PRINTER All PRINT to the printer Will not wrap the output lines PRINT[@l,] list of expressions [,] to tab, [;] or [ ] @l moves to position 0-319 PRINT #fileno, list of expressions Write data to a file. PRINT[@l,] USING "format"; list of exp Display exp in format. "%e" is scientific. "%.0f" is integer. @l moves to position 0-319 PRINT #fileno, USING "format", list of exp Write formatted data to file. "%7.2f" is two digits after decimal point PRTSC Send copy to screen to printer PSET (row, col) [, exp] Set the pixel at row, col to exp. Port has mximum of 64x240 Exp can be 0 (off) or 1 (on). RAD(exp) Convert degrees to radians. RANDOMIZE Initialize the random number generator. RAND(exp) Return a number between 0 and exp-1. READ list of variables Read the values of the variables from DATA statements. REFRESH Copy video memory to the LCD controller PORT ONLY REG rn, value Sets rn to value. rn: 0=Flags, 1=AX, 2=BX, 3=CX, 4=DX, 5=SI, 6=DI REG(rn) Returns rn value. rn: 0=Flags, 1=AX, 2=BX, 3=CX, 4=DX, 5=SI, 6=DI REM Remark. The rest of line is ignored. You can also use the quote (') mark REPEAT ... UNTIL exp Repeat until exp is TRUE. RESTORE [line number] Sets data pointer to the specified line number. If no line number is given, point to first data location. RESUME line number Resume at line number after an error. RETURN RIGHT$(x$,n) Returns rightmost n characters from x$. RMDIR pathname Remove an empty directory from disk. RND Return an number between 0 and 1. ROMVER Return the version number of the ROM. PORT ONLY RUN filename Load and execute filename.BAS. All variables are lost. RTRIM$(n$) Returns n$ with no trailing spaces. SCREEN exp 4 graphics 320x200 5 graphics 320x200 6 graphics 640x200 7 text 80x25 8 graphics 160x200 10 graphics 640x200 SCRLOAD n$(x) Load text screen from string array. SCRSAVE n$(x) Save text screen to string array. Each screen requires two strings a(0), a(1) SGN(exp) Returns the sign of exp. -1 exp < 0 0 exp = 0 1 exp > 0 SIN(exp) Returns sine of exp. SINH(exp) Returns hyperbolic sine of exp. SOUND code, duration Duration is length of tone in 10 msec. PORT ONLY CODE NOTE Frequency (Hz) 48 D#5 622.3 49 E5 659.3 50 F5 698.5 51 F#5 740.0 52 G5 784.0 53 G#5 830.6 54 A5 880.0 55 A#5 932.3 56 B5 987.8 57 C6 1046.5 58 C#6 1108.7 41 D6 1174.7 59 D#6 1244.5 60 E6 1318.5 61 F6 1396.9 14 F#6 1480.0 62 G6 1568.0 44 G#6 1661.2 63 A6 1760.0 4 A#6 1864.7 5 B6 1975.5 37 C7 2093.0 47 C#7 2217.5 6 D7 2349.3 7 D#7 2489.0 SPACE$(n) Returns a string of n spaces. SPC(n) Returns a string of n spaces. SQR(exp) Returns Square Root of exp. STATUS exp Enable or disable the Status line. 0 for off, 1 for on. PORT ONLY STOP Terminate and Display Line number. Point editor to location. STRING$(n,m) Returns a string composed of n chars. The ASCII value of the character is m. STR$(n) Returns string representation of n. SWAP varname, varname Exchange contents of the two vars. SYSTEM Terminate the program. TAB(n) In PRINT, move to column n. TAN(exp) Returns tangent of exp. TANH(exp) Returns hyperbolic tangent of exp. TICK exp Sets the Clock tick speed. 0 is Normal, 1 tick every 128 seconds. 1 is Fast, 1 tick every second. PORT ONLY TIMER Returns number of seconds since midnight. TIME$ Returns the system time. TROFF Disable line tracing. TRON Enable line tracing. TRUE Returns -1. UCASE$(x) Returns the Uppercase version of x$ VAL(x$) Returns the numeric value of x$. VARPTR(x) Returns the location of variable x. VARSEG(x) Returns the segment of variable x. VCSRLIN Returns the current virtual cursor line. PORT ONLY VLOCATE row,col Move the virtual cursor to row, col. This location is position 1,1 on the physical screen. PORT ONLY VMOVE dir, dis Move screen in direction dir, dis number of characters. Works only in Static and Tracked modes. 1=Up,2=Down,3=Left,4=Right. PORT ONLY VPOS(exp) Returns current virtual cursor column. Exp is a dummy expression. PORT ONLY WAIT Wait for a keypress. WHILE exp ... WEND Execute statements while exp is TRUE. WKSREAD(file, row, col) Return number from row, col of .WKS file 0,0 is A1. 1,27 is AB2. WKSREAD$(file, row, col) Return string from row, col of .WKS file 0,0 is A1. 1,27 is AB2. WKSTYPE(file, row, col) 1=EOF, 12=Blank, 13=Integer, 14=Real 15=Label (String), 16=Formula (Real) 0,0 is A1. 1,27 is AB2. WRITE list of expressions Data is sperated by commas (,). WRITE #fileno, list of expressions Data is send to a file, seperated by commas (,).