📄 bb.doc
字号:
MODE 0
This statement sets the screen colors to the indicated
foreground and background colors. Color values are:
0 - Black
1 - Blue
2 - Green
3 - Cyan
4 - Red
5 - Magenta
6 - Brown
7 - White
8 - Gray
9 - Light Blue
10 - LIght Green
11 - Light Cyan
12 - Light Red
13 - Light Magenta
14 - Yellow
15 - High intensity white
Foreground values can be 0 through 15 and background
values can be 0 through 15.
MODE 8,9
The first argument (foreground color) is a color
attribute. The second argument(background color) is a
screen color. For Windows programs see the section
WINDOWS AND GRAPHICS for additional information on the
COLOR statement.
MODE 12
Only one argument is used. The first argument
(foreground) color is a color attribute. In this mode
to change the background color for the entire screen use
the PALETTE command to change the definition of color
attribute 0.
MODE 1000
This mode is only supported under Windows. The first
argument (foreground) is a color attribute. The second
arguement (background) is a color attribute. In this
mode to change a palette color you must use the PALETTE
command.
COMMAND$
This function returns the command line used to start the
20
Copyright (c) 1992, 1993 by Mark Davidsaver
program.
e.g. TEST myfile.dat
COMMAND$ would return: myfile.dat
COMMON variablelist
Common passes variables to a chained program.
Variablelist is a list of variables and arrays whose
contents will be preserved when Chaining to a new
program. Only 'blank' common is supported. A blockname
is not allowed. the SHARED attribute is not allowed.
Arrays are indicated by blank parenthesis. See the
section 'Chaining and Common' for more details.
e.g. COMMON A,B,A$,B$()
COMSTATI(comnum)
This function returns the status of a communications
port. 8 bits of data are returned. These are defined
as follows:
bit 7 = Data Carrier Detect
6 = Ring Indicator
5 - Data Set Ready
4 - Clear to Sent
3 - Break Detect
2 - Framing Error
1 - Parity Error
0 - Overrun Error
e.g. a=COMSTATI(1)
COPYBITS sbm,sx,sy,xlen,ylen,dbm,dx,dy,0
This command is ignored under DOS. This command copies
the contents of a memory bitmap to another bitmap,
display or printer. The parameter sbm is the source
bitmap number and may be either 1 or 2, where 1 and 2
are memory bitmaps previously created with the
CREATEBITMAP command. Similarly dbm is the destination
bitmap number. It may be either 1,2 or PRINTER or
DISPLAY. Sx, sy are the coordinates of the upper left
corner of the source bitmap to be transfered. Xlen, and
ylen are the number of pixels to copy. Dx, dy are the
coordinates of the upper left corner of the destination.
21
Copyright (c) 1992, 1993 by Mark Davidsaver
The following example copies a 100 by 100 pixel
rectangle starting at 0,0 from a memory bitmap to the
screen at x=200 and y=0.
sx=0
sy=0
dx=200
dy=0
copybits 1,sx,sy,100,100,0,dx,dy,0
When copying to a printer from a bitmap the copy starts
from the lower left corner instead of the upper left
corner as is true when copying to the display.
COS(n)
This function returns the cosine of an angle expressed
in radians.
CREATEBITMAP n,0,xsize,ysize
This command is ignored under DOS. Under Windows it
creates a memory bitmap of the given size. The first
argument, n, may be either 1 or 2. The second argument
must always be a 0. You can create a maximum of 2
memory bitmaps. Using the SELECTBITMAP command you can
tell BasicBasic to route all screen output to a bitmap
instead. Then you can use the COPYBIT command to
quickly place a complex graphic on the screen.
If a SCREEN command is used in the program always use
CREATEBITMAP after the SCREEN command!
Here is an example of a createbitmap command:
pxsize=100
pysize=50
CREATEBITMAP 1,0,pxsize,pysize
SAMPLEW3.BAS uses the CREATEBITMAP command.
CREATEWINDOW number,0,fc,bc,leftx,topy,xlen,ylen
This command creates a child window. The background is
saved and will be restored when you destroy the window.
Number is a window number (1 through 9). Fc is
foreground color, bc is background color. For more
22
Copyright (c) 1992, 1993 by Mark Davidsaver
information see the section 'Programming Windows'.
CREATEFONT
Allows creation of fonts in DOS or Windows. See section
CREATING FONTS for a description of this command.
SAMPLEW1.BAS and SAMPLE14.BAS use the CREATE FONT
command.
CSRLIN
This function gets the current line position of the
cursor(starting with 1). In graphics mode 1000 the
pixel line position is returned (starting with 0).
CURDIR$[(drive$)]
This function returns the path currently is use for the
specified drive. If the optional parameter is omitted
then the path for the currently selected drive is
returned.
DATA
This statement is used in conjuction with the READ
statement to input numeric or string constants.
DATE$
This function returns a string of ten characters
corresponding to the current computer date.
DBUTTON keycode
This statement erases a button from the screen (using
currently define colors) and disables input from it.
The keycode should be the same as that used in the
CBUTTON command. See the section "Programming Buttons"
for more information on buttons.
23
Copyright (c) 1992, 1993 by Mark Davidsaver
DECLARE function name[(parameters)]
The DECLARE statement defines a function before the
actual function is created. Before you can use a user
function in your program you must either create the
function (using the FUNCTION, END FUNCTION statements)
or declare it with the DECLARE statement. The DECLARE
statement, therefore, allows you to put your user
functions someplace else other than the start of our
program. The name of the function, type and number of
parameters must the the same in the DECLARE statement as
in the FUNCTION statement.
DECLARE ADD%(A%,B%0
I%=2
J%=3
PRINT ADD%(I%,J%)
STOP
FUNCTION ADD%(X%,Y%)
ADD%=X%+Y%
END FUNCTION
DESTROYWINDOW number
Destroys an existing child window and restores the
background. For more information see the section
'Programming Windows'.
DEVICE(number)
This function is ignored in DOS. This function returns
the capabilities of the output device. This could be
the display or, if selected, the graphics printer. The
value returns depends on the number passed to the
function.
number function returns
------ ------------------------------
0 Driver version number
4 width of display in millimeters
6 height of display in millimeters
8 number of horizontal pixels
10 number of vertical pixels
12 number of color bits per pixel
14 number of color planes per pixel
22 number of device fonts
24 number of supported colors
24
Copyright (c) 1992, 1993 by Mark Davidsaver
40 aspectx
42 aspecty
44 aspectxy
104 number of system palette entries
108 number of color bits/pixel
DIALOG A$(),numitems,x,y,xlen,ylen,id,Header String
This statement executes a Dialog. See the section
"Programming Dialog Boxes" for details. The array a$()
contains text which defines the dialog box. Numitems
tells how many items are defined in A$(). X, y, xlen,
ylen are in pixel units in graphics screen modes and
character units in screen mode 0. Header String will be
displayed at the top of the dialog.
DIALOG$()
This function returns information on a Dialog Control.
See the section "Programming Dialog Boxes" for details.
SAMPLE11.BAS uses the DIALOG$ command.
DIM variable(subscripts),...
Defines arrays. There is no default array size of 10 in
BasicBasic; every array must be defined. SHARED is not
supported. Arrays may not be used as subscripts in a
Dimension statement.
LEGAL Dimension
DIM A$(10,5)
DIM B%(A%)
ILLEGAL Dimension
DIM A$(B%(1,2),5)
DIR$(path,[type])
or
DIR$
This function returns file names. If no type is
specified or type is set to 0 then file names not
25
Copyright (c) 1992, 1993 by Mark Davidsaver
including system and hidden will be returned. If no
path is specified then the next name using the previous
search path will be returned. Type may be set to a
non-zero value to return the names of special classes of
files.
type file type
1 Read Only files
2 Hidden files
3 System files
5 Directories
6 Archive bit set
SAMPLE10.BAS uses the DIR$ command.
DLEN (string)
This function returns the length in pixels of a string.
It is intended for use in Windows graphics mode but also
works in DOS graphics mode.
DO [UNTIL condition][UNTIL condition]
This statement incombination with the LOOP statement
repeats a series of statements while/until the condition
is true. A LOOP command must terminate the series of
statements. Alternately the while/until condition may
be placed after the LOOP command. In this case the
true/false checking of the condition occurs AFTER the
series of statements has been executed once. Here are
some examples:
I=0
DO WHILE I<5
PRINT I
I=I+1
LOOP
I=0
DO UNTIL I>4
PRINT I
I=I+1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -