Академический Документы
Профессиональный Документы
Культура Документы
Conventions
In all attempts to tell you how to enter something, <--- will mean "hit the
Enter key"
To Start GWBASIC
GWBASIC is in an ".exe" file. Double clicking the icon will start GWBASIC.
To Stop GWBASIC
System <--- , then click the Close box (X)
To Load a Program
Programs must be in the same folder as GWBASIC.exe.
To Run a Program
F2 and finish the statement
To Save a Program
save "MyProgram" <---
Arithmetic Operators
^ exponentiation
- negation and */+-
Functions
ABS() return the absolute value PRINT ABS(7*(-5))
ACS(x$) ASCII numbers for strings PRINT ASC(X$)
AUTO 100,50 gives automatic line numbers starting w/100 increment 50,
exit with CTRL-C
BEEP sound PRINT CHR$(7) does the same thing, 800Hz for 0.25 seconds
BLOAD,BSAVE
COLOR foreground,background,border
maximums (screen 0) are foreground 31 ( for blink, add 16 ), background 7,
border 15.
to return to Windows screen the command is SCREEN 0. See SCREEN also for
dimensions
SCREEN 0
COLOR 31, 7, 15
SCREEN 8
COLOR 15, 15
SCREEN 9
COLOR 15, 15
COS(x) cosine(radians)
CVI,CVS,CVD
DRAW "Un;Dn;Ln;Rn;En;Fn;Gn;Hn;"
Drawing starts at middle of screen in a graphics mode.
Small n (above) is a variable representing a number or a number
U is up, D down, L left, R right, E up&right, F down&right, G down&left, H
up&left
Mx,y line is drawn from current position to point x,y M+or-x,y x&y are added
to position
Prefixes B move but plot no points, N Move but return when done
Commands As is Set angle 0 to 3, TA is turn angle -360 to +360, Cn is set
color, Sn is scale.
Ppaint, boundary paint is fill color, boundry is border color
EOF returns -1 when end of sequential or com file is found, 0 if not found
ERDEV ERDEV$ return value of device error or name of device causing error
KEA(n)ON,KEY(n)OFF,KEY(n)STOP
n is 1-10 functions,11 cursor up,12 left,13right,14 down
LPOS(x) return position of line printer head within line printer buffer
LPRINT expression1, expression 2 & LPRINT USING print data to line printer
LSET,RSET move data to random file buffer and left or right justify for PUT
statement
MERGE filename merge the lines from program file to file in memory
MID$
ON ...GOSUB, ON...GOTO
OPEN "COM(n)
READ A(n) reads value from data statement and assign to variable
REM remark
RENUM 1000,900,20 renumbers lines from 900 up so they start with 1000 and
increment 20
RIGHT$
SAVE MYPROGRAM
SHELL
SIN(x) in radians
SWAP A$,B$
TAN(x) radians
UNLOCK
VARPTR$
VIEW[[SCREEN][(x1-y1)-(x2-y2)[,[fill][,border]]]]
WRITE A,B,C$