
Information in this document is subject to change without notice and does not represent a commitment on the part of Mindset Corporation. The software described in this document is furnished under a license agreement or non­ disclosure agreement. The software may be used or copied only in accordance with the terms of the agreement. It is against the law to copy Mindset GW-BASIC on magnetic tape, disk, or any other medium for any purpose other than the purchaser's personal use. (c) Microsoft Corporation 1979, 1983, 1984 (c) Mindset Corporation 1983, 1984 Microsoft is a registered trademark of Microsoft Corporation. Microsoft GW-BASIC Interpreter is a trademark of Microsoft Corporation. All rights reserved. Printed in U.S.A 100213-001 A Tec-Ed manual. Contents Section 1 I ntrod uction Graphics 1-1 Sound and Music 1-2 Input Peripherals Support 1-2 Device-I ndependent Input/Output 1-2 Event Trapping 1-3 ON ... GOSUB Statement Type 1-5 RETURN Statement 1-6 Keyword Entry Using the Alt Key 1-7 Section 2 General Information About GW-BASIC Syntax Notation 2-1 Line Format 2-2 Error Messages 2-2 Modes of Operation 2-2 Default Disk Drive 2-3 Active and Visual (Display) Pages 2-3 Character Set 2-3 Constants 2-5 String Constants 2-5 Numeric Constants 2-5 Single/Double Precision Form for Numeric Constants 2-6 Variables 2-7 Variable Names and Declaration Characters 2-7 Array Variables 2-8 Memory Space Requirements 2-8 Type Conversion 2-9 iii iv GW-BASIC Reference Manual Expressions and Operators 2-11 Arithmetic Operators 2-11 Integer Division and Modulus Arithmetic 2-12 Division By Zero and Overflow 2-13 Relational Operators 2-13 Logical Operators 2-14 Functional Operators -2-16 String Operators 2-16 MS-DOS 2.0 File System 2-17 Hierarchical File System 2-17 Directory Paths 2-18 File-Naming Conventions 2-19 Character Device Support 2-19 Assembly Language Subroutines 2-21 Memory Allocation 2-21 The CALL Statement 2-22 The CALLS Statement 2-26 The USR Function 2-26 Section 3 Programming Animation Animation Features 3-1 Programmable Motion and Priority 3-1 Multiple Object Views 3-2 Animation Event Statements 3-2 Animation Event Functions 3-3 Animation EVent Control Statements 3-4 Object Activation Statements 3-5 Overview of Animation Programming 3-5 Sample Animation Program Description 3-6 Initializing the System 3-7 Dimensioning the Object Arrays 3-7 Generating the Views for Each Object 3-8 Storing the Object Views in Arrays 3-8 Defining the Views Comprising an Object 3-9 Setting Up the Event Traps 3-9 Enabling the Event Traps 3-9 Defining Object Parameters and Activating the Object 3-10 Incuding the Background Program 3-10 Using ARR IVAL Subroutines 3-11 Using CLIP Subroutines 3-121, Using COLLISION Subroutines 3-12 Contents v Section 4 Starting GW-BASIC Starting GW-BASIC Without MS-DOS 4-1 GW-BASIC Operating Environment Without MS-DOS 4-2 Starting GW-BASIC with MS-DOS 4-2 BASIC Command Line Syntax 4-3 Command Line Options 4-3 File Options 4-4 Option Switches 4-4 BASIC Command Examples 4-6 Redirection of Standard Input and .Standard Output 4-7 Rules for Redirecting Input and Output 4-7 Example of I/O Redirection 4-7 Returning to MS-DOS from GW-BASIC 4-8 Section 5 Editing Basic Programs Line Editing 5-1 Edit Command 5-2 Full Screen Editor 5-2 Writing Programs 5-2 Editing Programs 5-3 Control Functions and Editor Keys 5-4 BASIC Editor Function Keys 5-4 Logical Line Definition with INPUT 5-6 Editing Lines Containing Variables 5-6 Section 6 GW-BASIC Commands, Statements, Functions, and Variables ABS Function 6-3 ACTIVATE/DEACTIVATE Statements 6-4 ARRIVAL Function 6-5 ARRIVAL Statement 6-8 ASC Function 6-10 ATN Function 6-11 AUTO Command 6-12 BEEP Statement 6-13 BLOAD Statement 6-14 BSAVE Statement 6-15 CALL Statement 6-16 CALLS Statement 6-17 CDBL Function 6-18 CHAI N Statement 6-19 CHOIR Statement 6-22 CH R$ Function 6-23 VI l.:iW-tiA::iIl,; Heterence Manual CI NT Function 6-24 CI RCLE Statement 6-25 CLEAR Statement 6-27 CLIP Function 6-28 CLI P Statement 6-30 CLOSE Statement 6-31 CLS Statement 6-32 COLLISION Function 6-33 COLLISION Statement 6-36 COLOR Statement (Text) 6-37 COLOR Statement (Graphics) 6-39 COM Statement 6-41 COMMON Statement 6-42 CONT Command 6-43 COS Function 6-44 CSNG Function 6-45 CSRLlN Variable 6-46 CVI, CVS, and CVD Functions 6-47 DATA Statement 6-48 DATE$ Statement 6-49 DATE$ Variable 6-50 DEF FN Statement 6-51 DEFINT/SNG/DBL/STR Statements 6-52 DEF OBJ ECT Statement 6-53 DEF SEG Statement 6-54 DEF USR Statement 6-55 DELETE Command 6-56 01 M OBJ ECT Statement 6-57 DIM Statement 6-58 o RAW Statement 6-59 EDIT Command 6-62 END Statement 6-63 ENVI RON Statement 6-64 ENVI RON$ Function 6-66 EOF Function 6-68 ERASE Statement 6-69 ERDEV and ERDEV$ Variables 6-70 ERR and ERL Variables 6-71 ERROR Statement 6-72 EXP Function 6-74 FIELD Statement 6-75 FI LES Statement 6-78 FIX Function 6-80 FOR ... NEXT Statement 6-81 FRE Function 6-84 GET Statement (Files) 6-85 GET Statement (Graphics) 6-86 GOSUB ... RETURN Statements 6-88 Contents vii GOTO Statement 6-90 H EX$ Function 6-91 IF ... THEN[ ... ELSE]!IF ... GOTO Statements 6-92 IN KEY$ Function 6-94 INP Function 6-95 I N PUT Statement 6-96 I N PUT # Statement 6-98 IN PUT$ Function 6-99 I NSTR Function 6-100 I NT Function 6-101 10CTL Statement 6-102 10CTL$ Function 6-103 KEY Statement 6-104 KEY (n) Statement 6-107 KI LL Statement 6-109 LEFT$ Function 6-111 LEN Function 6-112 LET Statement 6-113 LI N E Statement 6-114 LI N E I N PUT Statements 6-117 LI N E IN PUT# Statement 6-118 LIST Command 6-119 LLiST Command 6-121 LOAD Command 6-122 LOC Function 6-123 LOCATE Statement 6-124 LOF Function 6-126 LOG Function 6-127 LPOS Function 6-128 LPRINT and LPRINT USING Statements 6-129 LSET and RSET Statements 6-130 MERGE Command 6-131 M I D$ Statement 6-132 MID$ Function 6-133 MKDIR Statement 6-134 MKI$, MKS$, and MKD$ Functions 6-135 NAM E Statement 6-136 NEW Command 6-137 OBJ ECT Function 6-138 OBJ ECT Statement 6-139 OCT$ Function 6-142 ON ARRIVAL Statement 6-143 ON CLI P Statement 6-145 ON COLLISION Statement 6-147 ON COM Statement 6-150 ON ERROR GOTO Statement 6-152 ON ... GOSUB and ON ... GOTO Statements 6-153 ON KEY Statement 6-154 viii GW-BASIC Reference Manual ON PLAY Statement 6-156 ON STRIG Statement 6-157 ON TIMER, TIMER ON, TIMER OFF, TIMER STOP Statements 6-159 OPEN Statement 6-160 OPEN COM Statement 6-162 OPTION BASE Statement 6-164 OUT Statement 6-165 PAINT Statement 6-166 PALETIE Statement 6-169 PALETIE USING Statement 6-171 PEEK Function 6-173 PLAY Statement 6-174 PLAY Function 6-178 PMAP Function 6-179 POINT Function 6-180 POKE Statement 6-181 POS Function 6-182 PRESET Statement 6-183 PR I NT Statement 6-184 PRINT USING Statement 6-187 PRINT# and PRINT#USING Statements 6-192 PSET Statement 6-194 PUT Statement (Files) 6-196 PUT Statement (Graphics) 6-197 RANDOMIZE Statement 6-199 READ Statement 6-201 REM Statement 6-203 RENUM Command 6-204 RESET Command 6-205 RESTORE Statement 6-206 RESUME Statement 6-207 RETURN Statement 6-208 RIGHT$ Function 6-209 RMDIR Statement 6-210 RND Function 6-211 RUN Command 6-212 SAVE Command 6-213 SCREEN Statement 6-214 SCREEN Function 6-216 SCN Function 6-217 SHELL Statement 6-218 SI N Function 6-221 SOUND Statement 6-222 SPACE$ Function 6-223 SPC Function 6-224 SQR Function 6-225 STICK Function 6-226 STOP Statement 6-228 Contents ix STOP/START OBJECT Statements 6-229 STR$ Function 6-230 STRIG Statement/Function 6-231 STRI NG$ Function 6-233 SWAP Statement 6-234 SYSTE M Command 6-235 TAB Function 6-236 TAN Function 6-237 TI M E$ Statement 6-238 TI M E$ Variable 6-239 TIMER Variable 6-240 TRON/TROFF Statements/Commands 6-241 USR Function 6-242 VAL Function 6-243 VARPTR Function 6-244 VARPTR$ Function 6-245 VI EW Statement 6-247 VIEW PRINT Statement 6-248 WAIT Statement 6-249 WH I LE .. WE N D Statements 6-250 WI DTH Statement 6-251 WI N DOW Statement 6-253 WRITE Statement 6-255 WRITE# Statement 6-256 Appendix A Error Codes And Error Messages GW-BASIC Error Messages A-1 Disk Error Messages A-5 Appendix B Derived Mathematical Functions AppendixC ASCII Character Codes Extended Codes C-3 Appendix D GW-BASIC Reserved Words Index Figures and Tables Figure 2-1 : Disk file organization 2-17 Figure 2-2: Stack layout when CALL statement is activated 2-23 Figure 2-3: Stack layout during execution of a CALL statement 2-23 Table 2-1: GW-BASIC Relational Operators Truth Table 2-14 Table 3-1: Sample Program Array Names 3-7 Figure 4-1: GW-BASIC start-up screen 4-2 Table 5-1 : GW-BASIC Control Functions 5-4 Table 6-1: Default Palette Colors 6-37 Table 6-2: Graphics Color Palettes 6-39 Table 6-3: Default Color Palette Definition 6-169 Table 6-4: Screen Modes 6-214 xi Section 1 Introduction Welcome to GW-BASIC.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages369 Page
-
File Size-