
BASIC-PLUS-2 Reference Manual Order Number : AA-JP30B-TK May 1991 This manual provides reference information and examples on all BASIC-PLUS-2 commands, directives, statements, and functions . Revision/Update Information : This manual is a revision. Operating System and Version : RSX-11M Version 4 .6 or higher RSX-IIM-PLUS Version 4.3 or higher Micro/RSX Version 4 .3 or higher RSTS/E Version 9.7 or higher Software Version : BASIC-PLUS-2 Version 2.7 Digital Equipment Corporation Maynard, Massachusetts The information in this document is subject to change without notice and should not be construed as a commitment by Digital Equipment Corporation . Digital Equipment Corporation assumes no responsibility for any errors that may appear in this document . The software described in this document is furnished under a license and may be used or copied only in accordance with the terms of such license. No responsibility is assumed for the use or reliability of software on equipment that is not supplied by Digital Equipment Corporation or its affiliated companies . Restricted Rights : Use, duplication, or disclosure by the U .S. Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFARS 252 .227-7013 . © Digital Equipment Corporation 1987,1991 . All Rights Reserved. Printed in U .S.A. The postpaid Reader's Comments forms at the end of this document request your critical evaluation to assist in preparing future documentation. The following are trademarks of Digital Equipment Corporation : BASIC-PLUS, BASIC-PLUS-2, DEC, DECnet, DECUS, Digital, Micro'RSX, PDP, PDP-11, RMS, RMS-11, RSTS, RSTS/E, RSX, RSX-11M, RSX-11M-PLUS, RX50, TK50, UNIBUS, VAX, VAXcluster, VAXinfo, VMS, and the Digital logo . BASIC is a trademark of Dartmouth College . This document was prepared using VAX DOCUMENT, Version 2 .0. Contents Preface XUI Summary of Technical Changes xvii 1 Program Elements and Structure 1 .1 Components of Program Lines 1-1 1 .1 .1 Line Numbers 1-2 1 .1 .2 Labels 1-2 1 .1 .3 Statements 1-3 1 .1 .3.1 Keywords 1-4 1 .1 .3.2 Single-Statement Lines and Continued Statements 1-5 1 .1 .3.3 Multi-Statement Lines 1 -6 1 .1 .4 Compiler Directives 1-8 1 .1 .5 Comments 1-8 1 .1 .5 .1 Comment Field 1 -9 1 .1 .5.2 REM Statements 1-10 1 .1 .6 Line Terminators 1-11 1 .1 .7 Lexical Order 1-11 1 .2 BASIC-PLUS-2 Character Set 1-11 1 .3 BASIC-PLUS-2 Data Types 1-12 1 .3.1 Implicit Data Typing 1-15 1 .3.2 Explicit Data Typing 1-16 1 .4 Variables 1-16 1 .4.1 Variable Names 1-17 1 .4.2 Implicitly Declared Variables 1-18 1 .4.3 Explicitly Declared Variables 1-19 1 .4.4 Subscripted Variables and Arrays 1-19 1 .4.5 Initialization of Variables 1-21 1 .5 Constants 1-22 III 1 .5.1 Numeric Constants 1-23 1 .5.1 .1 Floating-Point Constants 1-23 1 .5.1 .2 Integer Constants 1-24 1 .5 .2 String Constants 1-25 1 .5 .3 Named Constants 1-27 1 .5 .3.1 Naming Constants Within a Program Unit 1-27 1 .5 .3.2 Naming Constants External to a Program Unit 1-28 1 .5.4 Explicit Literal Notation 1-29 1 .5.5 Predefined Constants 1-32 1 .6 Expressions 1-34 1 .6.1 Numeric Expressions 1-34 1 .6.2 String Expressions 1-37 1 .6.3 Conditional Expressions 1-37 1 .6.3.1 Numeric Relational Expressions 1-37 1 .6.3.2 String Relational Expressions 1-39 1 .6.3.3 Logical Expressions 1-41 1 .6.4 Evaluating Expressions 1-45 2 Environment Commands $ system-command 2-2 APPEND 2-4 BRLRES 2-6 BUILD 2-8 COMPILE 2-14 DELETE 2-21 DSKLIB 2-23 EDIT 2-25 EXIT 2-28 EXTRACT 2-29 HELP 2-30 IDENTIFY 2-32 INQUIRE 2-33 LIBRARY 2-34 LIST and LISTNH 2-36 LOAD 2-38 LOCK 2-40 NEW 2-41 ODLRMS 2-43 OLD 2-45 iv RENAME 2-47 REPLACE 2-49 RMSRES 2-50 RUN 2-52 SAVE 2-58 SCALE 2-59 SCRATCH 2-61 SEQUENCE 2-62 SET 2-64 SHOW 2-72 UNSAVE 2-73 3 Compiler Directives %ABORT 3-2 %CROSS 3-3 %IDENT 3-4 %IF-%THEN-%ELSE-%END %IF 3-6 %INCLUDE 3-8 %LET 3-10 %LIST 3-11 %NOCROSS 3-12 %NOLIST 3-13 %PAGE 3-14 %PRINT 3-15 %SBTTL 3-16 %TITLE 3-18 %VARIANT 3-20 4 Statements and Functions ABS 4-2 ABS% 4-3 ASCII 4-4 ATN 4-5 BUFSIZ 4-6 CALL 4-7 CAUSE ERROR 4-12 V CCPOS 4-13 CHAIN 4-14 CHANGE 4-16 CHR$ 4-18 CLOSE 4-19 COMMON 4-20 COMP% 4-25 COS 4-26 CTRLC 4-27 CVT$$ 4-29 CVTxx 4-30 DATA 4-33 DATE$ 4-35 DECLARE 4-37 DEF 4-41 DEF* 4-46 DELETE 4-51 DET 4-53 DIF$ 4-55 DIMENSION 4-56 ECHO 4-61 EDIT$ 4-62 END 4-64 ERL 4-67 ERN$ 4-68 ERR 4-69 ERT$ 4-70 EXIT 4-71 EXP 4-73 EXTERNAL 4-74 FIELD 4-78 FIND 4-80 FIX 4-84 FNEND 4-85 FNEXIT 4-86 FOR 4-87 FORMAT$ 4-91 vi FSP$ 4-92 FSS$ 4-94 FUNCTION 4-95 FUNCTIONEND 4-97 FUNCTIONEXIT 4-98 GET 4-99 GETRFA 4-103 GOSUB 4-104 GOTO 4-105 IF 4-106 INPUT 4-109 INPUT LINE 4-112 INSTR 4-115 INT 4-117 INTEGER 4-118 ITERATE 4-119 KILL 4-120 LEFT$ 4-121 LEN 4-122 LET 4-123 LINPUT 4-125 LOG 4-128 LOG10 4-129 LSET 4-130 MAG 4-131 MAGTAPE 4-132 MAP 4-134 MAP DYNAMIC 4-137 MAT 4-140 MAT INPUT 4-144 MAT LINPUT 4-146 MAT PRINT 4-148 MAT READ 4-150 MAX 4-152 MID$ 4-153 MIN 4-154 MOD 4-155 vii MOVE 4-156 NAME . AS 4-159 NEXT 4-161 NOECHO 4-162 NUM 4-163 NUM2 4-164 NUM$ 4-165 NUM1$ 4-167 ON ERROR GO BACK 4-169 ON ERROR GOTO 4-171 ON ERROR GOTO 0 4-173 ON . GOSUB 4-174 ON . GOTO 4-176 ONECHR 4-177 OPEN 4-178 OPTION 4-191 PLACE$ 4-194 POS 4-197 PRINT 4-199 PRINT USING 4-203 PROD$ 4-209 PROGRAM 4-211 PUT 4-212 QUO$ 4-216 RAD$ 4-218 RANDOMIZE 4-219 RCTRLC 4-220 RCTRLO 4-221 READ 4-222 REAL 4-224 RECOUNT 4-225 REM 4-227 REMAP 4-229 RESET 4-233 RESTORE 4-234 RESUME 4-236 RETURN 4-238 RIGHT$ 4-239 RND 4-240 RSET 4-241 SCRATCH 4-242 SEG$ 4-243 SELECT 4-245 SET [NO] PROMPT 4-248 SGN 4-250 SIN 4-251 SLEEP 4-252 SPACE$ 4-253 SQR 4-254 STATUS 4-255 STOP 4-258 STR$ 4-260 STRING$ 4-261 SUB 4-262 SUBEND 4-265 SUBEXIT 4-266 SUM$ 4-267 SWAP% 4-269 SYS 4-270 TAB 4-271 TAN 4-272 TIME 4-273 TIME$ 4-275 TRM$ 4-276 UNLESS 4-277 UNLOCK 4-278 UNTIL 4-279 UPDATE 4-281 VAL 4-283 VAL% 4-284 WAIT 4-285 WHILE 4-286 XLATE$ 4-288 ix A BASIC-PLUS-2 Keywords A.1 BASIC-PLUS-2 Reserved and Unreserved Keywords A-1 A .2 Reserved Keywords In VAX BASIC A-9 B Debugger Commands BREAK B-2 CONTINUE B-4 CORE B-5 ERL B-6 ERN B-7 ERR B-8 EXIT B-9 FREE B-10 I/O BUFFER B-11 LET B-12 PRINT B-14 RECOUNT B-15 REDIRECT B-16 STATUS B-17 STEP B-19 STRING B-20 TRACE B-21 UNBREAK B-22 UNTRACE B-24 C Editing Mode Commands DEFINE C-2 EXECUTE C-3 EXIT C-4 FIND C-5 INSERT C-6 SUBSTITUTE C-8 x D Object Time System Routines Index Figures 1-1 Subscripted Variables 1-21 1-2 Truth Tables 1-43 Tables 1 -1 Keyword Space Requirements 1-4 1 -2 BASIC-PLUS-2 Data Types 1-14 1-3 Numbers in E Notation 1-24 1-4 Predefined Constants 1-32 1-5 Arithmetic Operators 1-35 1-6 Result Data Types in BASIC-PLUS-2 Expressions 1-36 1-7 Numeric Relational Operators 1-38 1-8 String Relational Operators 1-40 1-9 Logical Operators 1-42 1-10 Numeric Operator Precedence 1-46 2-1 Overlay Description Files 2-44 2-2 RMS-11 Libraries 2-51 4-1 BASIC-PLUS-2 Parameter-Passing Mechanisms 4-8 4-2 FILL Item Formats and Storage Allocations 4-22 4-3 EDIT$ Values 4-62 4-4 FSP$ Return Values and Corresponding RMS Fields 4-92 4-5 MAGTAPE Function Codes 4-132 4-6 Rounding and Truncation of 123456.654321 4-195 4-7 RSX STATUS Values 4-256 4-8 TIME Function Values 4-273 D-1 Control, Matrix, and Miscellaneous Modules D-1 D-2 Array Threads D-2 D-3 String Modules D-3 D-4 Common Math Modules D-4 D-5 FPU Math Modules D-6 D-6 Common I/O Modules D-7 xi D-7 RMS I/O Modules D-8 D-8 RSTS/E-Specific Modules D-9 D-9 RSX-Specific Modules D-11 xii Preface Intended Audience This manual provides detailed reference information on all BASIC-PLUS-2 commands, directives, statements, and functions .
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages539 Page
-
File Size-