📄 bb.doc
字号:
errors. Selecting an error in the error window will
cause the corresponding source line to become the first
line in the edit window. The Options Menu contains an
item, 'Error Window' which will remove the error window
when you no longer need the errors displayed.
TRANSFER MENU
The transfer menu contains one entry. This is the
'Icon Editor'. Using the $ICON metacommand you can
assign a Windows Icon to your program. The icon editor
allows you to create the icon. See the section on
'Program Icon' for more information.
RUNTIME ERRORS
While executing a program you have entered you may
receive a runtime error message. The message will have
two numbers; the first being an error number and the
second being a runtime error address. This manual
contains a list of error numbers. The runtime error
address will show you what line had the error.
Each time you compile your program BasicBasic creates a
file which shows the runtime address for each line. You
can examine this file with the BasicBasic editor to find
which line contains the address the address at which the
runtime error occurs. The file BasicBasic creates has the
extension .TMP. For example if you compile the program
SAMPLE1.BAS, then BasicBasic will create the file
SAMPLE1.TMP, which will have the runtime addresses.
(Occasionaly you might want to delete all .TMP files from
your BasicBasic directory to conserve disk space.)
13
Copyright (c) 1992, 1993 by Mark Davidsaver
TOO BIG
If you write very large programs there may not be room in
memory to compile your program while the editor is
running. If you receive an error message saying not
enough memory to compile you may need to exit the editor
and compile seperately. See the section of Seperate
Compilation for instructions.
IMPORTANT: To run programs compiled with BasicBasic the
runtime module must be present. For Windows this is the
file WBBL152.EXE.
14
Copyright (c) 1992, 1993 by Mark Davidsaver
STATEMENT AND FUNCTION REFERENCE
-------------------------------------------------------
Here is a brief description of available functions and
statements. More detailed information on those not unique
to BasicBasic can be found in standard Basic reference
books.
ABS(numericexpression)
This function returns the absolute value of the numeric
expression.
ADDSUBMENU menunumber,stringexpression,keycode
Addsubmenu adds an item to a pull down menu with the
text stringexpression. When the user selects this menu
item the keycode will be returned at the next INKEY$
function call. See the section 'Programming Menus' for
more details
ASC(string expression)
This function returns a numerical value which is the
ASCII code for the first character of string expression.
ATN(numeric expression)
This function returns the arctangent of a numeric
expression.
BEEP
This statement sounds the ASCII bell character.
BITMAPC(filename,longinteger array)
This function returns colors values for a disk file
device independent bitmap.
e.g. A=BITMAPC("C:\WINDOWS\CARS.BMP",COLORS&(0))
15
Copyright (c) 1992, 1993 by Mark Davidsaver
Each element of the array COLORS& will contain one RGB
color value up to the total colors available (see
BITMAPH). See the section BITMAPS for further
information.
BITMAPH(filename,longinteger array)
This function returns the bitmap header from a file
device independent bitmap.
e.g. A=BITMAPC("C:\WINDOWS\CARS.BMP",HEADER&(0))
The data returned are:
0 - size of bitmapinfoheader
1 - width in pixels
2 - height in pixels
3 - always 1
4 - color bits per pixel
5 - compression flag
6 - total bytes in image
See the section BITMAPS for further information.
CALL name [arguments]
This statement transfers control to a BASIC SUB
procedure. Arguments may be any valid BasicBasic data
type. Arrays are specified with empty parenthesis.
here is an example of a CALL statement.
a=2
b=3
call sum(a,b)
stop
sub sum(x,y)
print x+y
end sub
The EXIT SUB statement may be used to exit a procedure
at any time. You may not transfer control out of the
prodecure except with the END SUB or EXIT SUB
statements.
In this version of BasicBasic procedures do not have
access to common variables.
16
Copyright (c) 1992, 1993 by Mark Davidsaver
CBUTTON "name",keycode,0,"type",0,left,top,xsize,ysize,
forecolor,backcolor
This command defines and creates a button on screen.
This command is DOS and Windows compatible. In screen
mode 0 left,top,xsize,ysize are in character units. In
graphics screen modes these must be supplied in pixel
units. The name is the text which will be displayed in
the button. When you define a button you must define
the keycode which will be returned when that button is
pressed by the user. Legal button types are "Radio",
"Push" or "Invisible". Left, top, xsize, ysize define
the position and size of the button(in character
position). Radio buttons may have a foreground and
background color defined. If these are left 0 then the
default colors will be used. In DOS the colors are also
used for Pushbuttons.
When the user presses the button the indicated keycode
will be returned to the INKEY$ function. If a button is
pressed while executing the INPUT command the input will
be ended, but the keycode will not be returned until a
subsequent INKEY$ function is called. Instead of using
the mouse to press the indicated button, the user can
also press the keyboard key which returns the indicated
keycode.
Any key may be defined for a button. See the section
"Keyboard codes" for a list of codes recognized by
BasicBasic. As an example the uppercase letter 'A'
would be the keycode 65. Extended keycodes are
indicated by adding 1000 to the second part of the code.
For example F1 would be 1059, or F10 would be 1068.
e.g. CBUTTON "Exit",1068,"Push",0,1,1,8,1,7,4
Creates a push button on the top line. Because
it is a Push button the color values are ignored
in windows, but used in DOS.
See RADIOON and RADIOOFF and CHECKON and CHECKOFF for
instructions on checking/unchecking radio and check
buttons.
See the section "Programming Buttons" for more detail on
programming buttons.
Note that while CBUTTON creates a button it will not
respond to the mouse button until the function MOUSEON
17
Copyright (c) 1992, 1993 by Mark Davidsaver
has been issued.
SAMPLE5.BAS and SAMPLE6.BAS use the CBUTTON command.
CHAIN filespec
This command transfers control from the current program
to another program. COMMON may be used to pass
variables between programs. Files are left open when
transfering to another program. See the section
'Chaining and Common' for more details.
e.g. CHAIN "TEST2.EXE"
CHDIR drive$
This statement changes the default directory for the
specified drive. CHDIR statement changes the default
directory, but not the default drive.
CHDRIVE drive$
This statement changes the current drive to that given
in the string expression drive$
CHECKON keycode
This command 'checks' the indicated Check button. See
the section "Programming Buttons" for more information.
CHECKOFF keycode
This command 'unchecks' the indicated Check button. See
the section "Programming Buttons" for more information.
CHR$(numeric expression)
This function returns the ASCII code for the numeric
expression. The returned code is one character.
CIRCLE [STEP](x1,y),radius,[color],[start],[end],[aspect]
18
Copyright (c) 1992, 1993 by Mark Davidsaver
This statement draws a circle, ellipse, or pie section
on the graphics screen. (x,y) are the screen
coordinates of the center of the figure. Radius is the
radius in pixels. Start and End are angles in radians.
Omiting these results in a complete circle or ellipse.
You may use Start,End to draw arcs or pie sections. A
complete circle has a start randian of 0 and an end
radian of 6.2832.
If start or end are negative the value is converted to a
positive number for purposes of drawing the arc, but
then a line is drawn from the center of the figure to
the end point of the arc. PIE figures may be draw in
this way.
Example of a complete circle, radius 50, color blue
SCREEN 8
CIRCLE (100,100),50,1
Example of pie figure, filled in
SCREEN 8
CIRCLE (100,100),50,1,-.01,-2
PAINT (102,98),1,1
Aspect can be used to adjust the ratio of y radius to
the x radius. By default BasicBasic sets aspect to a
number to create round circles for the type of screen
being used.
CLOSE #filenumber
This statement terminates I/O to the indicated
filenumber. Only one number allowed for each CLOSE
command.
CLS
This statement clears the screen. If a scrollable area
has been define the entire screen is still cleared.
COLOR foreground,background
The format of this statement varies depending on the
screen mode you are in.
19
Copyright (c) 1992, 1993 by Mark Davidsaver
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -