Copyright
(C) 1998-2005 MKTMK Moscow, Russia
http://www.mktmk.narod.ru.
e-mail:
mktmk <at> narod.ru
Integrated development environment for Open
Basic
(IDE OB)
The User's Guide.
Version 1.00.
Integrated development environment for Open
Basic (IDE OB) is intended for support of debugging programs of interpreter
Open Basic.
Open Basic (OB) is realization of the
interpreter of language Basic.
Open
Basic is OS-independent software.
IDE OB can be an example for integration of
interpreter Open Basic for
OS
Windows.
IDE OB
is not a part of interpreter Open Basic.
Interpreter
Open Basic can use without IDE OB.
IDE OB gives usual service of the debugging
environment:
- Edit the text of programs
- Loading programs into interpreter (some
modes)
- Start of program in the interpreter
- Stop program
- Step-by-step execution of program
- Animate execution of program
- Breakpoints (on interpreter level, do not
support IDE OB)
- Viewing and updating variables
("Watch" window)
- Viewing diagnostic messages of the
interpreter ("Messages" window)
- Support of operators PRINT and INPUT
("I/O Terminal" window)
IDE OB is written on Borland C++ Builder 6.0
(BCB 6.0).
Copyright
(C) 1998-2005 MKTMK Moscow, Russia
http://www.mktmk.narod.ru.
e-mail:
mktmk <at> narod.ru
MKTMK
Software Company. Moscow, Russia
IDE OB and the documentation are delivered on
conditions "as is".
We shall be grateful for all errors found in
the program.
Company names and product names, which appear
in this User’s Guide, are the trademarks or registered trademarks of the
respective companies.
Table of contents
1. The description of a problem and
purpose of the program
2.2. Installation the project from
archive ide_ob.zip.
3.1.4.1. Diagnostics IDE OB in
"Messages" window
3.2. The main menu and the tool
panel of the program
3.2.1.7. Find/Replace (Ctrl+L)
3.2.2.2. Load overlay (button Lo)
3.2.2.3. Load at cursor (button Lc)
3.2.2.4. Load at cursor overlay
(button Lco)
3.2.2.5. Run/Continue (button R/C)
3.2.2.6. Load and Run (button L+R)
3.2.2.12. Rules of loading and start
3.4. The main menu and Popup menu of
"Watch" window
3.4.1. Modification current line
3.6. Attach the user functions to
execution system of interpreter Open Basic in IDE OB.
3.6.1 The
description of the user functions connected to IDE OB
3.7. Start interpreter Open Basic in
Windows thread
IDE OB
is delivered in two files.
1. Installer - setup.exe.
2. Archive
- ide_ob.zip.
The installer setup.exe contains an executed
part of the project.
The archive contain full project IDE OB,
including source code.
Structure of archive ide_ob.zip:
c:\ide_ob\htm
ide_rus.htm - this file in Russian
ide_eng.htm - this file in English
read_rus.htm - interpreter Open Basic User's Guide in
Russian
read_eng.htm - interpreter Open Basic User's Guide in
English
c:\ide_ob\include
mstore.h -
policy
mvect.h -
vector
mlist.h -
list
mstack.h -
stack
mhash.h -
hash table
ob.h -
main header of interpreter Open Basic
c:\ide_ob\lib
ob15_1.lib - library of interpreter Open Basic for BCB
6.0.
c:\ide_ob\exe
ide_ob.exe - target executed file IDE OB
c:\ide_ob\obj
- obj files
c:\ide_ob\bas
test0.bas -
*.bas program example
test1.bas -
*.bas program example
test2.bas -
*.bas program example
test3.bas -
*.bas program example
test4.bas -
*.bas program example
test5.bas -
*.bas program example
test6.bas -
*.bas program example
test7.bas -
*.bas program example
test8.bas -
*.bas program example
test9.bas -
*.bas program example
test10.bas -
*.bas program example
test11.bas -
*.bas program example
test12.bas -
*.bas program example
test13.bas -
*.bas program example
test14.bas -
*.bas program example
test15.bas -
*.bas program example
test16.bas -
*.bas program example
test17.bas -
*.bas program example
c:\ide_ob
IDE_OB.BPR - file of project IDE OB BCB 6.0.
UNIT1.CPP - source code
UNIT10.CPP - source code
UNIT2.CPP - source code
UNIT6.CPP - source code
UNIT7.CPP - source code
UNIT8.CPP - source code
UNIT9.CPP - source code
userfun.cpp - source code
UNIT1.DDP
UNIT2.DDP
UNIT6.DDP
UNIT7.DDP
UNIT8.DDP
UNIT9.DDP
UNIT1.DFM
UNIT2.DFM
UNIT6.DFM
UNIT7.DFM
UNIT8.DFM
UNIT9.DFM
IDE_OB.DSK
MENUM.H - header file
UNIT1.H - header file
UNIT10.H - header file
UNIT2.H - header file
UNIT6.H - header file
UNIT7.H - header file
UNIT8.H - header file
UNIT9.H - header file
IDE_OB.RES - resources
IDE_OB.ICO - icon file
IDE_OB.CPP - the initial text
IDE_OB.H - header file
Open
Basic (OB) is realization of the interpreter of language Basic.
Open
Basic is OS-independent software.
Integrated development environment for Open
Basic (IDE OB) is intended for support debugging programs of interpreter Open
Basic.
IDE OB
is written on Borland C++ Builder 6.0 with use VCL.
File of the project and source code place on a
disk C:\IDE_OB.
Intermediate *.obj files place on a disk
C:\IDE_OB\OBJ.
The target ide_ob.exe file place on a disk
C:\IDE_OB\EXE.
Start setup.exe and follow it help.
The project is designed for place on disk C:
to the directory C:\IDE_OB.
BCB 6.0 also should place on disk C: in it
default directories.
Unzip ide_ob.zip on disk C: with all catalogues
structure and load file IDE_OB.BPR (file of the project in BCB 6.0).
This is
main window of the program. It contains text of the current program. The
current program is loaded into interpreter Open Basic by "Load"
command.
Current executed line select in
"Edit" window.
This window contain the information printed by
operators PRINT from the current
Basic
program. During execution operator INPUT "I/O Terminal" window
becomes
modal
and user can input information from the keyboard.
End of input is "Enter" key.
String
variable must enclose in quotation mark.
Lines of this window have through numbering. A
maximum quantity of lines in
"I/O
Terminal" window is 1000.
Contain the information of variables value of
current Basic-programs.
Names of variables, array and elements of
array are printed in separate lines.
Names of array elements should be specified
with indexes in parentheses.
Updating of the information in
"Watch" window is made during stop programs or
by press
button "Info" or by menu commands of "Watch" window.
Except for menu "Watch" window have
Popup menu.
Name of variables are separated from the value
by equal sign.
If the variable or array does not exist, to
the right of a equal sign print
three
question marks.
Array print in braces and their elements are
separated by comma.
Updating of variables is made from menu of
"Watch" window or from Popup
menu of
this window.
Updating is possible only for variables and
elements of array in separate
lines.
For elements of array displayed in structure
of array updating is impossible.
To include a variable in the list of viewing
and updating, it is necessary
print it
name in window "Watch" and start updating "Watch" window by
"Info"
button
or by menu of "Watch" window.
To modify a variable it is necessary print new
value to the right of
equal
sign and start updating "Watch" window by the command
"Modification
current line" or "Modification all list".
Contain the information of current status IDE
OB, warnings and error
of
interpreter Open Basic and IDE OB. Some critical error messages have color
selection.
More detail about diagnostics Open Basic see
Open Basic User's Guide.
More detail about diagnostics IDE OB see the
next topic.
Lines of this window have through numbering. A
maximum quantity of lines in
"Messages"
window is 1000.
1. "Load OK", - loading of the current
program into interpreter Open Basic is
successfully completed (message)
2. "Load overlay OK", - loading of the
current program into interpreter
Open Basic is successfully completed (mode
overlay) (message)
3. "Running...", - start of the
program in interpreter Open Basic is performed
(message)
4. "IDE system error - this messages do not
use", - do not used during
normal work
5. "No action release, system error",
- do not used during normal work
6. "Get 'Terminated' signal", - thread
of interpreter Open Basic is stopped
(warning)
7. "Load at cursor OK", - loading of
the current program into interpreter Open
Basic is successfully completed (mode of
loading from the cursor)
(message)
8. "Load at cursor overlay OK", -
loading of the current program into
interpreter Open Basic is successfully
completed
(mode overlay loadings from the cursor)
(message)
9. "Edit file modified or not Basic loaded.
Please reload for run" - attempt
to start if current edit file not loaded
or modified after last loading
(warning)
10.
"Load do not finished within 10 second. Run do not perform" - during
execute
commands "Load and Run" loading was
not finished during 10 second (timeout
has expired) (warning or error)
11.
"Stop by stop code. Stop code=ENDOPERATORDETECT" - the program was
finished
because execute operator END (message)
12.
"Stop by stop code. Stop code=ENDFILEEND" - the program was finished
because detect end of input stream
(message)
13.
"Stop by stop code. Stop code=BREAKPOINTEND" - the program was
finished
after reading breakpoint symbol. Symbol
'@' is breakpoint symbol for Open
Basic (message)
14.
"Stop by stop code. Stop code=NOLOADEND" - run do not perform because
"Load" was not executed and the
input stream was not open (warning)
15.
"Stop by stop code. Stop code=BREAKBEFOREOPERATOR" - the program was
finished before executions some operator
OB (error)
16.
"Stop by stop code. Stop code=BREAKAFTEROPERATOR" - the program was
finished after executions some operator OB
(error)
17.
"Stop by stop code. Stop code=EOLEND" - the program was finished
after
executions of the next line (message)
18.
"Stop by stop code. Stop code=Unknown stop code" - the program was
finished
with the unknown exit code (error)
Open new file for edit.
Open existing file for edit.
Save current file under the same name.
Save current file under a new name.
Exit from the program.
Standard
dialogue Find/Replace. Search and replacement in the current program.
Load the current program from "Edit"
window into interpreter Open Basic.
Tables of variables and files of the previous
program are cleared.
Start of the program by "Run" or
"Step" command will be carried out from
the
first line.
Load the current program from "Edit"
window into interpreter Open Basic.
Tables of variables and files of the previous
program are not cleared.
Start of the program by "Run" or
"Step" command will be carried out from
the
first line.
Load the current program from "Edit"
window into interpreter Open Basic.
Tables of variables and files of the previous
program are cleared.
Start of the program by "Run" or
"Step" command will be carried out from
the
current position of cursor.
Load the current program from "Edit"
window into interpreter Open Basic.
Tables of variables and files of the previous
program are not cleared.
Start of the program by "Run" or
"Step" command will be carried out from
the
current position of cursor.
Start the last loaded program.
Load the current program from "Edit"
window into interpreter Open Basic
and at
once starts it.
Tables of variables and files of the previous
program are cleared.
Start of the program by this command will be
carried out from the first line.
Stop the program.
The current executed line select in
"Edit" window.
After stop the program can be continued by
commands "Run/Continue" or "Step".
Abnormal finishes thread of current program.
The command "Abort" it should be
execute
only if the command "Stop" can not finish the program. After execute
"Abort"
command it is possible crash IDE OB.
Before execute "Abort" command is
requested confirmation of execute.
Execute one line of the current program and
stop. The program should be
loaded
by one of "Load" command.
The current executed line select in
"Edit" window.
Automatically run "Step" command
with a delay between run. The period of run
is set
in "Options" command and it is kept in configuration file.
Print to "Messages" window
information about current status of interpreter
Open
Basic and updates the information in "Watch" window.
Before start of the program by
"Run/Continue" or "Step" command, current
program
should be loaded into interpreter Open Basic by one of "Load"
command.
After execute one of "Load" commands
before "Run/Continue" or "Step" command
it is
necessary to wait occurrences of the message on successful loading
in
"Messages" window.
During execute command "Load and
Run" loading must be finished within 10
second.
If after 10 second loading was not finished, run of the program is
not
execute and diagnostics about error print to "Messages" window.
New program can be loaded and started in
interpreter Open Basic only after
stop or
terminations previous program.
If the program updating in a "Edit"
window after start, the program
immediately
stop. For the subsequent start it is necessary reload of programs.
It is
for correct synchronization between "Edit" window and it image on
interpreter Open Basic.
Is possible simultaneous start of several
copies IDE OB.
The option panel contains two fields:
1. IDE font size - size of a font in IDE OB.
2. Animate period (ms) - period for
"Animate" command.
Both
parameters are kept in configuration file.
Open "I/O Terminal" window.
Open "Watch" window.
Open "Messages" window.
Contain the information about manufacturer and
version Open Basic and IDE OB.
In first half of status panel is displayed
information about conformity edit
file and
it image on disk.
In second half of status panel is displayed
information about conformity edit
file and
it image on interpreter Open Basic.
Assign the value specified after an equal sign
to variable in cursor line.
If
assignment is impossible (for example at attempt assignment string to
numerical
variable), the variable keep old value.
Assign the value specified after an equal sign
to variable in all line of
"Watch"
window. If assignment is impossible (for example at attempt assignment
string
to numerical variable), the variable keep old value.
Save contents of window "Watch" to
ide_ob.wtl file.
Updates contents of "Watch" window
from internal table of Open Basic.
During work IDE OB creates three files:
1. Configuration file ide_ob.cfg (binary file)
2. File of viewing and updating variables
ide_ob.wtl (text file)
3. Image file tmp1.$$$ (text file)
In configuration file ide_ob.cfg is kept
current configuration IDE OB
(size
and position of windows, constants from option panel etc.). If at start
of the
program configuration file is not found, these parameters are loaded
by
default values.
In file of viewing and updating variables
ide_ob.wtl are kept current
contents
of "Watch" window.
The working file tmp1.$$$ is created during
work and destroyed after exit.
The
current program is stored in it from a "Edit" window and loaded into
interpreter
Open Basic.
For attach the user function to execution
system of interpreter
Open
Basic in IDE OB it is necessary:
1. Find realization of functions winuserfunc,
winuserfunc1, winuserfunc2, winuserfunc3,
winuserfunc4, winuserfunc5,
winuserfunc6 in file userfun.cpp.
2. On this samples write new user function.
3. At the end of a file userfun.cpp to find an
example of connection of
functions winuserfunc, winuserfunc1,
winuserfunc2, winuserfunc3,
winuserfunc4, winuserfunc5, winuserfunc6 to
execution system of interpreter
Open Basic by ob_obasic::setfun method.
4. On this sample to connect the new user
function.
5. Rebuild the project.
6. Write *.bas program with use new user
function.
7. Load and run this *.bas program.
Note:
The functions described in this section are
determined and connected to Open Basic execution system only in IDE OB. In console Open Basic versions they are not determined and not
connected.
Name C++ functions |
Name Basic function (one C++
function can be connected under different names to Open Basic execution
system) |
The description of function |
winuserfunc |
|
Call MessageBox and returns to Basic-program a code of the
pressed key (No=0, Yes=1,
Cancel=2) |
winuserfunc1 |
|
Call MessageBox. Head and Messages of this MessageBox is first
and second string parameter of function Win_User_Function1%.
Returns to Basic-program a code of the pressed key (No=0, Yes=1, Cancel=2) |
winuserfunc2 |
|
Call dialogue of request of floating point
number. After input returns floating point number to Basic-program. If during input the error present, returns zero and prints
error message. |
winuserfunc3 |
|
Call dialogue of request of integer number
in a range 0-9. After input considers this number as index
in internal string array and returns string with the specified index to Basic-program. If during input the error present, returns the predetermined
line with error message. This function is example of return of
string placed in static memory. |
winuserfunc4 |
|
Call dialogue of request of string.
After input returns reverse string to Basic-program.
This function is example of return of string placed in heap by the operator new. |
winuserfunc5 |
MainFormResize% |
Accepts two floating point arguments. The
first argument is change of height of main window IDE OB (in
percentage with it sign) from the current height. The second argument is
change of width of main window IDE OB
(in percentage with it
sign) from the current width. By call without argument set initial size of
main window IDE OB. Allows to receive amusing effect of a
"crawling" window when it call in a cycle with different values of
parameters (see an example test0.bas) |
winuserfunc6 |
SLEEP% |
Delay on amount milliseconds specified in
it first argument. Type of argument is integer. |
winuserfunc7 |
ShellExecute% |
Call Win API ShellExecute.
As argument ShellExecute the first string argument of Basic-function is used. In example test18.bat this
function is used for start of copies of programs notepad.exe and wordpad.exe. |
In program IDE OB the method "run"
interpreter Open Basic is started in
separate
thread. This is thread of interpreter Open Basic.
In program IDE OB there are common objects
VCL, access to which is implements
from the
main thread and from thread of interpreter Open Basic. Example of
such
object is "Messages" window. Print of diagnostics to
"Messages" window is
implements
from main thread, and from thread of interpreter Open Basic.
For prevention of collisions access such
common objects VCL from
user
functions, access to this objects can implements by Synchronize method.
If object VCL is not used in others threads,
access to it can be done
without
method Synchronize.
In files userfun.cpp and UNIT10.h can find
examples of access common objects VCL through method Synchronize (for example
print to "Messages" window).