home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
windows
/
kpwdemo.zip
/
KPHELP.HLP
< prev
next >
Wrap
Text File
|
1990-06-28
|
284KB
|
7,287 lines
//Create Objects
Create:
Button #mbutton#m
Check box #mcheck_box#m
Edit objects #medit_box#m
#medit_line#m
#medit_file#m
#medit_window#m
Group box #mgroup_box#m
List box #mlist_box#m
Menu #mmenu#m
Radio box #mradio_box#m
Scroll bar #mhorz_scroll_bar#m
#mvert_scroll_bar#m
Window #mwindow#m
Ask a questions #mask#m
#mread_response#m
Get a file name #mfile_menu#m
#msave_as#m
#msave_edit_file#m
//Manipulate Objects
Disable #mdisable_window#m
Enable #menable_window#m
Enable All #menable_all_windows#m
Hide #mhide_window#m
Show #mshow_window#m
Re-size #mresize_window#m
Re-position #mmove_window#m
Redraw #mupdate_window#m
Find information #mwindow_info#m
Find parent #mparent_window#m
Close #mclose_window#m
List of windows #mwindow_list#m
Window only:
Set to modal #mmake_modal#m
Attach an icon #mattach_icon#m
Find children #mchild_windows#m
Menu only:
Disable an item #mdisable_menu_item#m
Enable an item #menable_menu_item#m
Check an item #mcheck_menu_item#m
Uncheck an item #muncheck_menu_item#m
#mFind and set information about screen objects#m
//Find and set information about screen objects
Set:
Text #mset_text#m
Title #mset_title#m
Object with focus #mset_focus#m
Display window #mset_display_window#m
Active window #mset_active_window#m
Top window #mset_top_window#m
Display position #mset_display_pos#m
Cursor position #mset_cursor_pos#m
Value:
Check box #mset_check_box#m
Radio button #mset_radio_button#m
Edit objects #mset_text#m
Scroll bar #mset_scroll_bar#m
Get:
Text #mget_text#m
Title #mget_title#m
Object with focus #mget_focus#m
Display window #mget_display_window#m
Active window #mget_active_window#m
Top window #mget_top_window#m
Display position #mget_display_pos#m
Cursor position #mget_cursor_pos#m
Value:
Check box #mget_check_box#m
Radio button #mget_radio_button#m
Edit objects #mget_text#m
Scroll bar #mget_scroll_bar#m
//Using Text
Display #mtext#m
Clear, display and wait #msay#m
Print #mprint#m
Set:
Cursor position #mset_cursor_pos#m
Display position #mset_display_pos#m
Window text #mset_text#m
Get:
Cursor position #mget_cursor#m
Display position #mget_display_pos#m
Window text #mget_text#m
Scroll horizontally #mhorz_scroll_text#m
Scroll vertically #mvert_scroll_text#m
Read from the clipboard #mread_clipboard#m
Write to a file #mwrite#m
Write to the clipboard #mtext_to_clipboard#m
Compile text string #mcompile_string#m
Execute compiled string #mevaluate#m
Execute text string #mperform#m
Hypertext font, color #mhyper_display#m
All text hypertext #mauto_hyper_on#m
Only marked hypertext #mauto_hyper_off#m
#mFonts#m
#mCommands for Controlling Text Display#m
//Fonts
Create #mcreate_font#m
Use a font #muse_font#m
Delete #mdelete_font#m
List available fonts #mfont_list#m
List typefaces #mtypeface_list#m
#mCommands for Controlling Text Display#m
//Commands for Controlling Text Display
##n New line
##p New page
##e Erase the screen, new page
##l New line for each list item (DEFAULT)
##s List items on the same line
##o No spaces after a list item
##i Insert a space after each list item (DEFAULT)
##t Tab five spaces
##m Define hypertext phrase
##d Default screen colors
#### Display the character ##
##v Call enclosed topics. Display their values.
##c Call enclosed topics. Do Not Display the Values.
##INTEGER Print the ASCII character
##xINTEGER Move to Column X
##yINTEGER Move to Row Y
##fCOLOR Change foreground color
##bCOLOR Change background color
//Graphics
Display #mbitmap#m
To clipboard #mbitmap_to_clipboard#m
Delete #mdelete_bitmap#m
From file #mload_bitmap#m
From clipboard #mread_clipboard#m
Create #mcreate_bitmap#m
Icon commands:
Load #mload_icon#m
Display #micon#m
Delete #mdelete_icon#m
Assign to Window #mattach_icon#m
To print a bitmap use the command ##g followed by the
handle of the bitmap. For example:
image is load_bitmap ('PICTURE.BM4').
print (concat ('##g', ?image)).
Text can also be printed along with bitmaps.
//Lists
Find:
First item #mfirst#m
Last item #mlast#m
Specific item #melement#m
All except #mrest#m
Length of a list #mlist_length#m
Where an item is on a list #mwhere#m
If an item is on a list #mone_of#m
Sort:
Alphabetic #msort#m
Numeric #mnumeric_sort#m
New lists From old:
Remove an item #mremove#m
Replace matching items #mreplace#m
Replace specific elements #mreplace_elements#m
Items not shared by lists #mdifferent#m
Items on all lists #mintersect#m
Sublist #msublist#m
Combine lists #mcombine#m
Combine lists, no doubles #munion#m
//Strings
Find:
Length #mstring_length#m
Location of a substring #mstring_where#m
Concatenate #mconcat#m
Copy part of a string #mstring_copy#m
Replace part of a string #mstring_replace#m
//Conversion between Lists and Strings
ASCII Values to characters #mnumber_to_char#m
Characters to ASCII values #mchar_to_number#m
String to list of characters #mlist_of_char#m
String to lower case #mlower#m
String to upper case #mupper#m
String to list #mstring_to_list#m
List to string #mlist_to_string#m
//External Files
Text Files
Read:
Paragraph #mread#m
Line #mread_line#m
Character #mread_char#m
Write #mwrite#m
Open #mnew_file#m
Close one or more #mclose#m
Close all #mclose_all#m
Set file pointer #mset_file_pos#m
Get file pointer #mget_file_pos#m
Knowledge Base Files
Read:
Include in current KB #mload#m
Open new #mnew_kb#m
Write #msave_topic#m
Get input file name #mfile_menu#m
Get output file name #msave_as#m
Save an edit file #msave_edit_file#m
Get the current directory #mcurrent_directory#m
Get a directory list #mdir#m
//External Programs
External Program:
Chain out of KP #mchain#m
Run a program #mrun#m
Load a program #mload_program#m
Find tasks running #mtask_list#m
Find task windows #mtask_windows#m
Knowledge Base Files
Read:
Include in current KB #mload#m
Open new #mnew_kb#m
Write #msave_topic#m
Get input file name #mfile_menu#m
Get output file name #msave_as#m
Save an edit file #msave_edit_file#m
Get the current directory #mcurrent_dir#m
Get a directory list #mdir#m
Data Link Library:
Load #mload_library#m
Free library #mfree library#m
#muser#m
//Using the Clipboard
Read #mread_clipboard#m
Write text to #mtext_to_clipboard#m
Write a bitmap to #mbitmap_to_clipboard#m
//Topics
Assign a new value #mmake#m
alternate format #mis#m
Add a value #mgets#m
Assign corresponding values #mmake_c#m
alternate format #mis_c#m
Add corresponding values #mgets_c#m
Create #mcreate_topic#m
Create and inherit #mnew#m
Execute #mdo#m
Execute local #mdo_local#m
Inherit #mim_a#m
Exit #mexit#m
Remove #mremove_topic#m
Save to a file #msave_topic#m
List all topics #mmake_topic_list#m
Show information #mshow_topic#m
Make unevaluated #mreset#m
Flatten sublists #mflatten#m
#mFind properties#m
#mSet properties#m
//Find properties
Value of a topic #mvalue_of#m
alternate format #m?#m
Children of a topic #mchildren#m
How a topic was called #mcalling_topic#m
Full name of the topic #mfull_name#m
If a topic exists #mexists#m
Parent of a topic #mparent#m
Class a topic belongs to #mclass#m
Demons assigned #mget_demon#m
Legal number of values #mget_number_of_values#m
Commands attached #mget_procedures#m
If values can be assigned #mget_read_only#m
//Set properties
Assign a demon #mset_demon#m
Attach commands #mset_procedures#m
Define number of values #mset_number_of_values#m
Define Read/Write status #mset_read_only#m
//Object-oriented Features
Inherit a topic structure #mim_a#m
Create topic and inherit structure #mnew#m
Perform a topic locally #mdo_local#m
//Program Control
Loops:
Repeat until condition is met #mrepeat#m
Execute while a condition holds #mwhile#m
Execute a topic #mdo#m
Execute a topic locally #mdo_local#m
Execute a compiled string #mevaluate#m
Execute a text string #mperform#m
Compile a text string #mcompile_string#m
Make a window modal #mmodal#m
Set:
Event handling topic #mset_event_topic#m
Error handling topic #mset_error_topics#m
Demon #mset_demon#m
Get:
Event handling topic #mget_event_topic#m
Error handling topic #mget_error_topic#m
Demon #mget_demon#m
Execute function instead of topic #mprimitive#m
Halt execution of current topic #mwait#m
End a wait #mcontinue#m
Leave a topic #mexit#m
End Execution of a KB #mstop#m
Clear a KB from memory #mclear#m
Exit KnowledgePro #mexit_kp#m
Exit Windows #mexit_windows#m
//Booleans, Rules and Arithmetic
Creating rules #mrule#m
Forming boolean expressions:
Comparing expressions #mcompare#m
ANDing boolean expressions #mand#m
Negating a boolean expression #mnot#m
ORing boolean expressions #mor#m
Performing arithmetic:
Performing arithmetic expressions #marith#m
Negating a number #mneg#m
Arithmetic operators:
+ Addition
- Subtraction or Negation
/ Division
* Multiplication
^ Exponential x = 4 ^ 3. x is assigned 254.
MOD Remainder of Division x = 22 MOD 4. x is assigned 2.
DIV Integer Division x = 22 DIV 4. x is assigned 5.
% Percentage x = 20 % 10. x is assigned 2.
//Dynamic Data Exchange
Responding to DDE requests
Respond to DDE requests #mdde#m
Ignore DDE requests #mdde_off#m
Controlling other applications using DDE:
Open a channel #mdde_open#m
Request data #mdde_request#m
Write data #mdde_write#m
Execute commands #mdde_execute#m
Advise of data change #mdde_advise#m
Stop advising of change #mdde_unadvise#m
Close channel #mdde_close#m
//Error Handling
Display error message #merror_message#m
List user error topics #mget_error_topic#m
Set error topics #mset_error_topic#m
//Debugging
Execute one step at a time #msingle_step#m
Turn off single stepping #msingle_step_off#m
Trace #mtrace#m
Trace off #mtrace_off#m
//Send Text to Printer
Print with form feed #mprint#m
Print without form feed #mwrite#m
//System Information
Free memory remaining #mmemory#m
Screen resolution #msystem_info#m
Date #mdate#m
Time #mtime#m
Collect memory #mcollect#m
Enable memory collection #mcollect_ok#m
Disable memory collection #mcollect_not_ok#m
//Styles for Windows
Display windows
Type: Initial State: Special Elements:
Overlapped Visible TitleBar
PopUp Disabled VertScroll
Child HorzScroll
Frame: Control Menu: Related Windows:
ThinFrame MaximizeBox ShowChildren
ThickFrame MinimizeBox Siblings
DialogFrame
Combined Styles:
OverlappedWindow includes [Overlapped, ThickFrame, ControlMenu,
MaximizeBox, MinimizeBox, ShowChildren, TitleBar]
PopupWindow includes [Popup, ThickFrame, ShowChildren]
ChildWindow includes [Child, ThinFrame, ShowChildren, Siblings]
DialogWindow includes [Popup, DialogFrame, ShowChildren]
Edit box styles:
LeftText CenterText RightText MultiLine
AutoVscroll AutoHscroll NoHideSel
//Alphabetic Listing of Functions
#mand#m #mfont_list#m #mread_response#m
#marith#m #mfree_library#m #mremove#m
#mask#m #mfull_name#m #mremove_topic#m
#mattach_icon#m #mget_active_window#m #mrepeat#m
#mauto_hyper_off#m #mget_check_box#m #mreplace#m
#mauto_hyper_on#m #mget_cursor_pos#m #mreplace_elements#m
#mbitmap#m #mget_demon#m #mreset#m
#mbitmap_to_clipboard#m #mget_display_pos#m #mresize_window#m
#mbutton#m #mget_display_window#m #mrest#m
#mcalling_topic#m #mget_error_topic#m #mrule#m
#mchain#m #mget_event_topic#m #mrun#m
#mchar_to_number#m #mget_file_pos#m #msave_as#m
#mcheck_box#m #mget_focus#m #msave_edit_file#m
#mcheck_menu_item#m #mget_list_box#m #msave_topic#m
#mchild_windows#m #mget_number_of_values#m #msay#m
#mchildren#m #mget_procedures#m #mset_active_window#m
#mclass#m #mget_radio_button#m #mset_check_box#m
#mclear#m #mget_read_only#m #mset_cursor_pos#m
#mclose#m #mget_scroll_bar#m #mset_demon#m
#mclose_all#m #mget_text#m #mset_display_pos#m
#mclose_window#m #mget_title#m #mset_display_window#m
#mcollect#m #mget_top_window#m #mset_error_topic#m
#mcollect_not_ok#m #mgets#m #mset_event_topic#m
#mcollect_ok#m #mgets_c#m #mset_file_pos#m
#mcombine#m #mgroup_box#m #mset_focus#m
#mcompare#m #mhide_window#m #mset_number_of_values#m
#mcompile_string#m #mhide_scroll_bar#m #mset_procedures#m
#mconcat#m #mhorz_scroll_text#m #mset_radio_button#m
#mcontinue#m #mhyper_display#m #mset_read_only#m
#mcreate_bitmap#m #mhyper_region#m #mset_scroll_bar#m
#mcreate_font#m #micon#m #mset_text#m
#mcreate_topic#m #mim_a#m #mset_title#m
#mcurrent_directory#m #mintersect#m #mset_top_window #m
#mdate#m #mlast#m #mshow_topic#m
#mdde#m #mlist_box#m #mshow_window#m
#mdde_advise#m #mlist_length#m #msingle_step#m
#mdde_close#m #mlist_of_char#m #msingle_step_off#m
#mdde_execute#m #mlist_to_string#m #msort#m
#mdde_off#m #mload#m #mstop#m
#mdde_open#m #mload_bitmap#m #mstring_copy#m
#mdde_request#m #mload_icon#m #mstring_length#m
#mdde_unadvise#m #mload_library#m #mstring_replace#m
#mdde_write#m #mload_program#m #mstring_to_list#m
#mdelay#m #mlower#m #mstring_where#m
#mdelete_bitmap#m #mmake#m #msublist#m
#mdelete_font#m #mmake_c#m #msystem_info#m
#mdelete_icon#m #mmake_modal#m #mtask_list#m
#mdifferent#m #mmake_topic_list#m #mtask_windows#m
#mdir#m #mmemory#m #mtext#m
#mdisable_menu_item#m #mmenu#m #mtext_to_clipboard#m
#mdisable_window#m #mmove_window#m #mtime#m
#mdo#m #mneg#m #mtrace#m
#mdo_local#m #mnew#m #mtrace_off#m
#medit_box#m #mnew_file#m #mtypeface_list#m
#medit_file#m #mnew_kb#m #muncheck_menu_item#m
#medit_line#m #mnot#m #munion#m
#medit_window#m #mnumber_to_char#m #mupdate_window#m
#melement#m #mnumeric_sort#m #mupper#m
#menable_all_windows#m #mone_of#m #muse_font#m
#menable_menu_item#m #mor#m #muser#m
#menable_window#m #mparent#m #mvalue_of#m
#merror_message#m #mparent_window#m #mvert_scroll_bar#m
#mevaluate#m #mperform#m #mvert_scroll_text#m
#mexists#m #mprimitive#m #mwait#m
#mexit#m #mprint#m #mwhere#m
#mexit_kp#m #mradio_button#m #mwhile#m
#mexit_windows#m #mread#m #mwindow#m
#mfile_menu#m #mread_char#m #mwindow_info#m
#mfirst#m #mread_clipboard#m #mwindow_list#m
#mflatten#m #mread_line#m #mwrite#m
#m?#m
//Converting from KnowledgePro (DOS) ver. 1.X
The knowledge base CONVERT.SRC is included to help you convert
knowledge bases developed under KnowledgePro (DOS) ver. 1.x
to KnowledgePro (Windows) applications.
To use the knowledge base include the line:
@ CONVERT.SRC
as the first line in your knowledge base. Make sure that
CONVERT.SRC is in the same directory as your knowledge base
and recompile the knowledge base using KnowledgePro (Windows).
To run the knowledge base select File/Run.
CONVERT will translate commands that have changed between
environments and will inactivate DOS commands that do not
exist under windows. If you want to see the major differences
between the versions you may want to print CONVERT.SRC.
Even though many knowledge bases will immediately run after
including CONVERT, you'll probably want to modify them to take
advantage of the many features of the windows environment.
Here are a few areas to watch out for:
1] Colors - The colors supported are different between version.
Since Windows does not use colored windows in the
same way as DOS, you're probably better off getting rid
of all your colors and then adding them as needed.
2] The DOS version let you refer to the device names
con: , lst: , aux: , kbd:
without surrounding them with quotes. If you have
done this, you must include the quotes before using
the knowledge base under KnowledgePro (Windows).
3] The WINDOWS version handles hypertext differently than
the DOS version. For example:
window (,10,5,40,10).
say ('This is an example of #m#mhypertext#m#m').
close_window ().
topic hypertext.
say ('This text overwrites the old text.').
end.
In the DOS version, the hypertext returns to the original
screen once the second message is read and waits for input.
In WINDOWS hypertext returns to the next command line. If
the hypertext is displayed in a new window this does not
create a problem but in the example above, the first message
is not automatically redisplayed. This can easily be
remedied by opening a new window.
topic hypertext.
window (,10,5,40,10).
say ('This text overwrites the old text.').
close_window ().
end.
This change adds flexibility to hypertext that you will
come to appreciate as you dive into the system.
//Knowledge Bases Included
The knowledge bases shipped with this Pre-production Version
of KnowledgePro include:
apphelp.src help system which can be used with your
applications
chartest.kb list the event and code generated by
key presses
color.kb create custom colors and copy RGB value
to the clipboard
convert.src convert from KnowledgePro (DOS) to (Windows)
ddeshow.kb an example of interaction with Microsoft Excel
design.kb design interface screens
engine.kb a hypertext file rea
font.kb test different fonts and copy the code
to the clipboard
fontprn.kb print a listing of available fonts
index.kb index a text file
insure1.kb sample of a rule-based system
insure2.kb problem from insure1 solved using a
different technique
intro.kb an introduction to KnowledgePro
kphelp.src the help knowledge base you are using now
palette.kb a list of standard colors for windows and text
sample*.kb the example described in Chapter 2
seticon.kb utility to install icons on Windows 3.0
Program Manager
sigdits.kb rounding a number
//Help
On-Line Help in KnowledgePro
The line below shows the font used for hypertext
on your monitor.
#mThis is the font for hypertext on the current monitor.#m
To select hypertext, point and click with the mouse
or, use TAB and SHIFT TAB to move the cursor among
hypertext items and press ENTER to select the item.
To return to the first screen, select TOP.
To see a list of the KnowledgePro functions select FUNCTIONS.
To go back to the previous screen, select BACK.
To print the current item, select PRINT.
When the syntax of a KnowledgePro function is displayed,
you can select COPY to copy the format of the function
to the clipboard. In your edit window, Edit/Paste will
insert the syntax at the current cursor position.
//?
#cenable_menu_item (?m1, &Copy).
Format is '?TOPIC ({PARAMETER1, PARAMETER2,...}).'.#c
Format ?TOPIC ({PARAMETER1, PARAMETER2,...})
Alternate value_of (TOPIC {,PARAMETER1,PARAMETER2,... })
Action Find the list of items assigned to a topic. If TOPIC
has already been evaluated, the current value is
returned. The system will search the hierarchy for
TOPIC. If TOPIC is not yet evaluated, the commands
associated with it are immediately executed until the
maximum number of legal values for the topic has
been reached, or an exit or stop is executed.
If the number of legal values was not set, all of
the commands in the topic are executed. This
command implements a backward chaining function. The
optional PARAMETERS are parameters which can be
passed to the topic if it is evaluated at this
time. If TOPIC can't be found, an error message is
given.
Parameters TOPIC is a topic or list of topics whose values you
want to find. If these values have not yet been
determined the topics' commands are executed.
{PARAMETER1, PARAMETER2 , ... }
are parameters passed to TOPIC when it is executed.
Returns The value or list of values of the
specified topic or topics.
Note ?x(a,b)
is equivalent to
do (?x,a,b).
x is evaluated and then the result of this evaluation
is passed a and b and executed.
?(x(a,b))
is evaluated to
value_of (do (x,a,b)).
//and
#cenable_menu_item (?m1, &Copy).
Format is 'and (BOOLEAN1,BOOLEAN2).'.#c
Format and (BOOLEAN1,BOOLEAN2)
Alternate BOOLEAN1 and BOOLEAN2
BOOLEAN1 & BOOLEAN2
Action The infix and is most commonly used to combine
conditional statements in a rule. The conditions are
evaluated and the two boolean values are anded
together to produce the resulting value. In the
functional form, lists are anded item by item.
Anything anded with a value of [ ] gives a result of
[ ]. The values T, True and Yes are treated as a
boolean value of true, anything else is treated as
false.
Parameters BOOLEAN1, BOOLEAN2 are single boolean values, lists
of boolean values or expressions that evaluate to
either of these.
Returns A boolean value or a list of boolean values that
is the result of anding together the two lists of
booleans. and returns T if both elements are T and F
otherwise. List are anded element by element.
Missing elements are treated as [ ].
Note When and is used as an infix operator (between two
boolean expressions) the second expression is not
evaluated if the first expression evaluates to
false. The condition in the above example would be
represented internally as:
[and,[eq,?color,red],[delay,[and,[eq,?shape,round],
[delay, [eq,?skin,smooth]]]]]
delay is used to prevent evaluation until the first
boolean expression is evaluated.
//arith
#cenable_menu_item (?m1, &Copy).
Format is 'arith (OPERATOR, NUMBER1, NUMBER2) .'.#c
Format arith (OPERATOR, NUMBER1, NUMBER2)
Alternate NUMBER1 OPERATOR NUMBER2
Action Perform arithmetic operations on NUMBERS. If NUMBER1
and NUMBER2 are both lists, the operation is
performed sequentially on pairs of elements. If one
item is a list and the other is a single element, the
element operates on each item in the list. In infix
expressions, operators fall into three categories,
denoted by their order of precedence:
1] - (negation)
2] *, /, div, ^
3] +, -, mod, %
Operators of the same precedence are evaluated from
left to right. Expressions within parentheses are
evaluated first. Parentheses should be used to
clearly denote the desired order of arithmetic
operators. [ ] and non-numeric items are treated as
zero. Division by zero results in 1.7E+308, the
maximum numeric value.
Parameters OPERATOR is one of the list of legal operators that
describes the type of operation to be performed.
The legal operators for the alternate form are:
+ , - , / , * , div , mod , ^ , % .
The legal operators for the first form are:
=, - , / , * , div , mod , ^ , % , add , sub, mul,
int_divide, divide, mod_f, expon, and per_cent.
div returns the integer result of dividing two
numbers.
mod returns the remainder resulting from dividing two
numbers.
^ returns the result of raising the first number to
the power of the second.
% takes the percentage of a number.
NUMBER1, NUMBER2 are the two lists of numbers on
which to perform the operations.
Returns The result of the operation performed.
//ask
#cenable_menu_item (?m1, &Copy).
Format is 'ask (QUESTION {,TOPIC, LIST}).'.#c
Format ask (QUESTION {,TOPIC, LIST})
Action Clears the window. Places a question on the screen
and waits for the user to either select an answer
from a list box or type an answer into an edit line.
Parameters QUESTION is the question that appears on the screen
as a prompt for the user. The following control
codes can be embedded within the text of QUESTION to
control the display of information on the screen:
##n start a new line
##p start a new page
##e erase the contents of the window
##l put each list item on a new line (default)
##s put each list item on the same line
##o no spaces after a list item
##i insert a space after each list item (default)
##m begin or end marked text
#### display the character ##
##INTEGER print the ASCII character of INTEGER
##xINTEGER move to column INTEGER
##yINTEGER move to row INTEGER
##gHANDLE display a bitmap. HANDLE is the handle
returned by load_bitmap.
##fCOLOR change foreground color to COLOR
##bCOLOR change background color to COLOR
##d return to default colors
##cTEXT##c TEXT is compiled and evaluated
##vTEXT##v TEXT is compiled, evaluated and any value
returned is displayed
TOPIC is the topic or list of topics where the answer
given to the prompt is assigned. If no TOPIC is
named, the answer is assigned to the current topic.
If the topic does not exist, it is created
LIST is a list of possible responses to the prompt
which appear in a list box. The list box allows the
user to select multiple answers unless the TOPIC has
been previously defined as single valued. If no LIST
is given, an edit line is provided for the user to
type in the response to the question.
See Section 3.4 for information on using control
codes.
The following color names may be placed after the ##f
and ##b:
black, blue, green, cyan, red, magenta, yellow, white
At least one blank space must follow the name of the
color. In addition, to using defined color names,
colors can also be defined numerically. This is
described in Section 3.2.1.2.
Returns The answer provided by the user.
Errors ask calls:
text
list_box
make
edit_line
These functions can generate their own error
messages.
Attempting to assign to TOPIC more than the legal
number of values specified by a set_number_of_values
topic.
I_READ_ONLY_TOPIC, I_TOO_MANY_VALUES,
I_CANT_CREATE_TEMP_FILE
See Also #mlist_box#m, #mread_response#m
//attach_icon
#cenable_menu_item (?m1, &Copy).
Format is 'attach_icon ({HANDLE}, ICON_HANDLE).'.#c
Format attach_icon ({HANDLE}, ICON_HANDLE)
Action The icon from ICON_HANDLE is assigned to the window.
The icon is displayed when the window is minimized.
An icon should only be assigned to a window using the
Overlapped style.
Parameters HANDLE is the handle of the window is which assigned
the icon. The default is the current display window.
ICON_HANDLE is the handle of an icon previously
loaded with load_icon. If ICON_HANDLE is [ ] and an
icon was previously assigned to HANDLE, the icon is
removed from the window. If ICON_HANDLE is a list,
only the first item is used.
Returns WINDOW_ICON_HANDLE, The handle of the window's icon.
This is not the same as ICON_HANDLE or HANDLE.
Errors I_NOT_ICON, I_INVALID_WINDOW
See Also #mdelete_icon#m, #micon#m, #mload_icon#m
//auto_hyper_off
#cenable_menu_item (?m1, &Copy).
Format is 'auto_hyper_off (HANDLE).'.#c
Format auto_hyper_off (HANDLE)
Action Turns the automatic hypertext feature off. When the
automatic hypertext is off, only text strings which
have been surrounded with ##m characters and hyper-
regions can be selected as hypertext.
Parameters HANDLE is a handle or a list of handles of windows
where automatic hypertext is not operable.
Note When a window is created it defaults to
auto_hyper_off so unless the automatic hypertext
feature has been activated using auto_hyper_on, this
topic is not necessary.
Errors I_INVALID_WINDOW
See Also #mauto_hyper_on#m
//auto_hyper_on
#cenable_menu_item (?m1, &Copy).
Format is 'auto_hyper_on (HANDLE).'.#c
Format auto_hyper_on (HANDLE)
Action Turns the automatic hypertext feature on. When the
automatic hypertext is on, any text strings can be
selected as hypertext by either clicking the mouse or
by pressing ENTER. If no text is highlighted, the
word under the text cursor or the mouse cursor is
selected. To select a group of words they must first
be marked by clicking and dragging the mouse or
pressing SHIFT and the CURSOR KEYS.
Parameters HANDLE is a handle or a list of handles of windows
that contain automatic hypertext.
Note The default is for the automatic hypertext function
to be off.
Errors I_INVALID_WINDOW
See Also #mauto_hyper_off#m
//bitmap
#cenable_menu_item (?m1, &Copy).
Format is 'bitmap (BITMAP_HANDLE {, COLUMN, ROW}).'.#c
Format bitmap (BITMAP_HANDLE {, COLUMN, ROW})
Action Displays the bitmap associated with the handle at the
specified screen position.
Parameters BITMAP_HANDLE is the handle of the bitmap to be
displayed. The BITMAP_HANDLE is assigned by
load_bitmap, create_bitmap or read_clipboard.
COLUMN, ROW is the bitmap location. The default is
the current position. COLUMN and ROW are relative to
the upper left corner of the display area of the
current display window.
Errors I_NOT_BITMAP
See Also #mbitmap_to_clipboard#m, #mdelete_bitmap#m,
#mload_bitmap#m, #mread_clipboard#m,
#mcreate_bitmap#m
//bitmap_to_clipboard
#cenable_menu_item (?m1, &Copy).
Format is 'bitmap_to_clipboard (BITMAP_HANDLE).'.#c
Format bitmap_to_clipboard (BITMAP_HANDLE)
Action Makes a copy of the bitmap and places it in the
clipboard.
Parameters BITMAP_HANDLE is the handle to a bitmap. If this
item is a list, only the first element is used. The
bitmap handle is assigned by load_bitmap,
create_bitmap or read_clipboard.
Errors I_NOT_BITMAP, I_CANT_OPEN_BITMAP
See Also #mbitmap#m, #mcreate_bitmap#m, #mdelete_bitmap#m,
#mload_bitmap#m, #mread_clipboard#m
//button
#cenable_menu_item (?m1, &Copy).
Format is 'button (TEXT, {EVENT_TOPIC, COLUMN, ROW, WIDTH, SELECTED, EVENT_LIST}).'.#c
Format button (TEXT, {EVENT_TOPIC, COLUMN, ROW, WIDTH,
SELECTED, EVENT_LIST})
Action A button is created at COLUMN, ROW in the current
display window. If an EVENT_LIST is specified,
EVENT_TOPIC is called whenever the selected events
occur while the focus is on the button.
Parameters BUTTON_TEXT is the text to appear on the button.
EVENT_TOPIC is the topic or list of topics to be
performed when an event on the EVENT_LIST occurs
while the focus is on the button. EVENT_TOPIC is
called as:
EVENT_TOPIC (EVENT_INFO,EVENT_NAME,HANDLE).
EVENT_INFO depends on the event that occurs. A
description of events is provided in Appendix D.
EVENT_NAME is the name of the event that occurred.
HANDLE is the handle assigned to the button.
If EVENT_TOPIC sets its value to true after being
called by a lose_focus_event, close_event,
char_event, or a sys_char_event, further
processing of the event is canceled. Whenever
EVENT_TOPIC is called its value is reset before it is
executed. If no EVENT_TOPIC is defined, no
events are recognized.
COLUMN, ROW is the button location. The default is
the current display position. COLUMN and ROW are
relative to the upper left corner of the display
area of the current display window.
WIDTH is the width of the button in system
characters. The default is the width of
BUTTON_TEXT + 2.
SELECTED is a boolean value. If the value is true,
then the button will appear highlighted. The default
is false.
EVENT_LIST is a list of events that cause the
EVENT_TOPIC to be called. The events that can be
processed are:
get_focus_event, lose_focus_event, close_event,
char_event, sys_char_event, select_event
These events are described in detail in Appendix D.
If no event is specified, the default event handled
by a button is a select_event.
Returns HANDLE, the handle of the button.
See Also #mDescription of Events#m
//calling_topic
#cenable_menu_item (?m1, &Copy).
Format is 'calling_topic (COUNT).'.#c
Format calling_topic (COUNT)
Action This is used to find the full name of the topic that
contains the current command. It also returns the
parameters that were passed to the calling topics.
Parameters COUNT is an integer (0 <= COUNT <= 65535) which
indicates the call to return.
0 the topic that contains the current command i.e.
the current topic.
1 the topic that called the current topic.
2 the topic that called the topic that contains the
current topic.
If count extends beyond !main, [ ] is returned.
Returns Returns the full name of the topic containing the
command and its evaluated parameters as a list
[full_name, parameter1, parameter2...]
Note If calling_topic topic is included in the then or
else part of the rule, or in a while or repeat
statement, that rule, while or repeat will be
considered the 0 level call.
Errors I_INVALID_ELEMENT
//chain
#cenable_menu_item (?m1, &Copy).
Format is 'chain (COMMAND {,SHOW_CODE}).'.#c
Format chain (COMMAND {,SHOW_CODE})
Action Terminates the current knowledge base and begins
executing a DOS command or Windows program. In the
runtime version it also terminates KnowledgePro.
Parameters COMMAND is any legal DOS command or program or
Windows program batch file or program name. If
this parameter is [ ] or absent, the knowledge
base is exited and COMMAND is executed. If no
extension is provided, .EXE is assumed.
SHOW_CODE is a code indicating how the program should
be displayed. If this parameter is a list, only the
first element is used. Possible values are:
0 hidden
1 normal
2 minimized (iconic)
3 maximized
4 not active window - does not get the focus
5 normal - window gets the focus
7 minimized, but window does not get focus
The default is 1.
Returns If successful, it does not return. Error conditions
are returned as numeric codes. Error codes are:
2 the program was not found
16 the program name was invalid
17 the command line is longer than 80 characters
Errors I_EXT_STRING_LONG, I_NO_TIMER
//char_to_number
#cenable_menu_item (?m1, &Copy).
Format is 'char_to_number (CHARACTER).'.#c
Format char_to_number (CHARACTER)
Action This topic is used to convert a character to its
equivalent ASCII value.
Parameters CHARACTER is a character, string or list of
characters or strings.
Returns The integer ASCII value of each of the characters.
If CHARACTER is a string or list, a list of integers
is returned.
//check_box
#cenable_menu_item (?m1, &Copy).
Format is 'check_box (TEXT {,EVENT_TOPIC, COLUMN, ROW, SELECTED, EVENT_LIST}).'.#c
Format check_box (TEXT {,EVENT_TOPIC, COLUMN, ROW, SELECTED,
EVENT_LIST})
Action A check box with the name TEXT is created at COLUMN,
ROW in the current display window.
Parameters TEXT is the text appearing with the check box.
EVENT_TOPIC is the topic to be performed when an
event on the EVENT_LIST occurs while the focus is on
the check box.
EVENT_TOPIC is called as:
EVENT_TOPIC (EVENT_INFO,EVENT_NAME,HANDLE).
EVENT_INFO depends on the event that occurs. A
description of events is provided in Appendix D.
EVENT_NAME is the name of the event that occurred.
HANDLE is the handle assigned to the check box.
If EVENT_TOPIC sets its value to true after being
called by a lose_focus_event, close_event,
char_event, or a sys_char_event, further processing
of the event is canceled. Whenever EVENT_TOPIC is
called its value is reset before it is executed. If
no EVENT_TOPIC is defined, no events are recognized.
COLUMN, ROW is the check box location. The default
is the current display position. COLUMN and ROW are
relative to the upper left corner of the display area
of the current display window.
SELECTED is a boolean value. If the boolean is true,
the check box is checked. The default is false.
EVENT_LIST is a list of events that will cause the
EVENT_TOPIC to be called. The events that can be
processed are:
get_focus_event, lose_focus_event, close_event
char_event, sys_char_event, select_event
These events are described in detail in Appendix D.
If no event is specified, the default event handled
by a check box is a select_event.
Returns HANDLE, the handle of the check box.
See Also #mget_check_box#m, #mset_check_box#m, #mDescription of Events#m
//check_menu_item
#cenable_menu_item (?m1, &Copy).
Format is 'check_menu_item (HANDLE, ITEM).'.#c
Format check_menu_item (HANDLE, ITEM)
Action A check mark is placed next to the specified item.
Checks are usually used to show menu items that can
be toggled between two states. uncheck_menu_item is
used to remove the check from an item. This topic no
effect if the menu item is already checked.
Parameters HANDLE the handle of the menu that contains the items
you want to place a check next to.
ITEM is the name of a menu item, or list of items.
See Also #mdisable_menu_item#m, #menable_menu_item#m,
#mmenu#m, #muncheck_menu_item#m
//child_windows
#cenable_menu_item (?m1, &Copy).
Format is 'child_windows ({HANDLE}).'.#c
Format child_windows ({HANDLE})
Action Used to find the child windows that belong to a
specified window or list of windows.
Parameters HANDLE a window handle or list of window handles.
The default is the active window.
Returns A list of the child windows of all the selected
windows. This includes screen objects inside the
window and windows which contain the style child.
Errors I_INVALID_WINDOW
See Also #mparent_windows#m, #mwindow_info#m
//children
#cenable_menu_item (?m1, &Copy).
Format is 'children (TOPIC).'.#c
Format children (TOPIC)
Action Returns the names of the topics which are immediate
children of the topic specified. If a list of
TOPICS is given, a list of children for each of the
topics is returned. Grandchildren of TOPIC are not
returned.
Parameters TOPIC contains the names of the topics whose children
you want to find.
Returns A list of the children of TOPIC.
See Also #mparent#m, #mmake_topic_list#m, #mshow_topic#m,
#mcalling_topics#m, #mfull_name#m
//class
#cenable_menu_item (?m1, &Copy).
Format is 'class (TOPIC).'.#c
Format class (TOPIC)
Action Used to find all of the topics from which TOPIC
inherits commands and sub-topics. When a topic
inherits commands and sub-topics from another topic
it is said to be a member of the class of the first
topic. This occurs when im_a or new is used as in
the example shown below.
Parameters TOPIC is a topic name or list of topic names of
topics whose class membership you want to find. The
default is the current topic.
Returns A list of the classes from which each topic has
inherited commands and sub-topics. If a topic
inherits from several classes, the classes are
returned as a sub-list. If a topic is not a member
of any class, [] is returned.
Error I_V_TOPIC_NOT_FOUND
See Also #mim_a#m, #mnew#m
//clear
#cenable_menu_item (?m1, &Copy).
Format is 'clear ( ).'.#c
Format clear ( )
Action Terminates the execution of the knowledge base and
removes it from memory. All windows and files are
closed and all libraries are unloaded. Open bitmaps,
icons and fonts are deleted.
Notes clear ( )
performs the same action as choosing Clear from the
main menu. In the runtime version, KnowledgePro is
exited.
See Also #mexit_kp#m, #mexit_window#m, #mstop#m
//close
#cenable_menu_item (?m1, &Copy).
Format is 'close (FILE).'.#c
Format close (FILE)
Action File or list of files named are closed.
Parameters FILE is the name of a file or a list of files you
want to close. Remember that any names containing a
period must be enclosed in single quotes.
Returns T or F for each file in FILE, depending on the
success in closing the file.
Note Closing a file tells KnowledgePro that you are
finished accessing the file. Files are closed
automatically when a knowledge base is terminated,
but it is a good idea to explicitly close all files
as soon as you have finished using them. This
releases memory used by the file for other purposes.
Also, KnowledgePro does not write directly to disk
files; it writes to a memory buffer. When the buffer
fills or the file is closed, the contents of the
buffer are written to the disk. If a system crash
occurs before the file is closed, valuable
information could be lost.
Errors I_CANT_CLOSE, I_FILE_NOT_OPEN
//close_all
#cenable_menu_item (?m1, &Copy).
Format is 'close_all ( ).'.#c
Format close_all ( )
Action Closes all open files.
Returns A list of T or F's , depending on the success in
closing the files.
Note Closing a file tells KnowledgePro that you are
finished accessing the file. Files are closed
automatically when a knowledge base is terminated,
but it is a good idea to explicitly close all files
as soon as you are finished using them. This
releases memory used by the file for other purposes.
Also, KnowledgePro does not write directly to disk
files; it writes to a memory buffer. When the buffer
fills or the file is closed, the contents of the
buffer are written to the disk. If a system crash
occurs before the file is closed, valuable
information could be lost.
Errors I_CANT_CLOSE, I_FILE_NOT_OPEN
//close_window
#cenable_menu_item (?m1, &Copy).
Format is 'close_window ({HANDLE}).'.#c
Format close_window ({HANDLE})
Action A window or screen object is closed and the memory
allocated to it is released. Garbage collection is
performed. If the window is the current display or
active window, the previous display or active window
becomes current. The window and all screen objects
receive close_events.
Parameters HANDLE is the handle or list of handles of the
windows and screen objects to close. If no handle is
specified, the current display window is closed.
Errors I_INVALID_WINDOW
See Also #mhide_window#m, #mdisable_window#m
//collect
#cenable_menu_item (?m1, &Copy).
Format is 'collect ( ) .'.#c
Format collect ( )
Action This topic forces garbage collection. Garbage
collection is the process of freeing the memory no
longer needed by the knowledge base.
See Also #mcollect_ok#m, #mcollect_not_ok#m
//collect_not_ok
#cenable_menu_item (?m1, &Copy).
Format is 'collect_not_ok ( ) .'.#c
Format collect_not_ok ( )
Action This topic turns off the ability of the system
to do garbage collection. During time critical
operations, you may want to turn off garbage
collection. Be sure to turn garbage collection back
on or unused memory will not be recovered.
See Also #mcollect#m, #mcollect_ok#m
//collect_ok
#cenable_menu_item (?m1, &Copy).
Format is 'collect_ok ( ) .'.#c
Format collect_ok ( )
Action This topic allows garbage collection to take
place, but does not force it to occur. This is the
default setting.
See Also #mcollect#m, #mcollect_not_ok#m
//combine
#cenable_menu_item (?m1, &Copy).
Format is 'combine (LIST1, LIST2 {,LIST3...}).'.#c
Format combine (LIST1, LIST2 {,LIST3...})
Action This topic is used to append one or more lists to an
initial list.
Parameters LIST1, LIST2 {,LIST3...} are lists to be combined
into a new list.
Returns The list that is formed by appending the items in
LIST2, LIST3 and so on to the list in LIST1.
//compare
#cenable_menu_item (?m1, &Copy).
Format is 'compare (COMPARISON_OPERATOR, VALUE1, VALUE2).'.#c
Format compare (COMPARISON_OPERATOR, VALUE1, VALUE2)
Alternate VALUE1 COMPARISON_OPERATOR VALUE2
Action This topic is used to perform numeric or
string comparisons between items. Lists are
compared element by element. The alternate form of
compare is most frequently used in rules.
Parameters COMPARISON_OPERATOR must be either one of the legal
COMPARISON_OPERATORS. The legal comparison_operators
are
=, is , < > , is_not , < , > , <= , =<, >=, =<
In the first format, the following comparison
operators are also legal eq, ne, lt, gt, ge, le
VALUE1, VALUE2 are the values to be compared.
Returns T for a successful comparison, otherwise F.
Note The operators eq, ne, lt, gt, le and ge may be used
in the form compare_operator (VALUE1, VALUE2). For
example,
x = ne (cat,dog).
x is assigned the value T.
//compile_string
#cenable_menu_item (?m1, &Copy).
Format is 'compile_string (TEXT) .'.#c
Format compile_string (TEXT)
Action Compiles TEXT and returns a list representing the
internal format of the commands.
Parameters TEXT is a string or list of strings to be compiled.
Returns The eternal representation of the items compiled.
Errors I_CANT_CREATE_TEMP_FILE
Also, compile_string can result in compiler error
messages.
See Also #mset_procedures#m, #mevaluate#m
//concat
#cenable_menu_item (?m1, &Copy).
Format is 'concat (TEXT1, TEXT2 {,TEXT3,...}).'.#c
Format concat (TEXT1, TEXT2 {,TEXT3,...})
Action concat is used to combine several items into a
single string. Each element of the second
list is concatenated with each element of the first
list to form the new list. If more than two
parameters are used, the elements of the third
list are concatenated with the result of
concatenating the first two lists. The fourth list
is concatenated with the result of the first
three and so on.
Parameter TEXT1, TEXT2 {,TEXT3,...} are the text that is
concatenated.
Returns The new string.
See Also concat works on strings. For a similar function
for lists, see #mcombine#m.
//continue
#cenable_menu_item (?m1, &Copy).
Format is 'continue ({NUMBER}).'.#c
Format continue ({NUMBER})
Action The continue topic is called to cancel a wait. wait
is used to stop execution of the topics in a
knowledge base, usually until the user can read a
screen or respond to a request for information.
Parameters NUMBER is a value that is passed to the wait topic.
When control returns to the wait , this number is
returned by the wait. This can be used to provide
information about which topic contained the continue
that ended the wait.
See Also #mwait#m
//create_bitmap
#cenable_menu_item (?m1, &Copy).
Format is 'create_bitmap (WIDTH, HEIGHT, PLANES, BITSPERPIXEL, BITS).'.#c
Format create_bitmap (WIDTH, HEIGHT, PLANES, BITSPERPIXEL, BITS)
Action Creates a bitmap.
Parameters WIDTH is the width of the bitmap.
HEIGHT is the height.
PLANES is the number of planes.
BITSPERPIXEL is the number of bits for each on-screen
pixel.
BITS is the bitmap data. This is a list of numbers.
Each element of the list represents a byte in the
bitmap. Each bit in the byte represents a bit on the
screen. Monochrome bitmaps are stored in a one-bit,
one-plane format. Each screen line is represented as
a continuous scan. Each scan is pathed to be a
multiple of 16 bits. Color bitmaps use a one-bit,
three plane format. Data is stored in 3 patterns,
one each for red, green and blue. All red data
first, one scan line at a time, then green and
finally blue. Each scan line is a multiple of 16
characters.
If WIDTH, HEIGHT, PLANES or BITSPERPIXEL are lists,
only the first element is used.
Returns The handle to the bitmap.
Errors I_CANT_OPEN_BITMAP
See Also #mbitmap#m, #mload_bitmap#m, #mbitmap_to_clipboard#m,
#mread_clipboard#m, #mdelete_bitmap#m
//create_font
#cenable_menu_item (?m1, &Copy).
Format is 'create_font (FONT_DESCRIPTION).'.#c
Format create_font (FONT_DESCRIPTION)
Action create_font is passed parameters that describe a
logical font. Windows uses this description to
select the physical font that is the closest to the
specified descriptions. A handle to the physical
font is returned.
Parameters FONT_DESCRIPTION is a list containing the following
elements:
HEIGHT is the desired height of the characters in
pixels. This parameter specifies line spacing for the
font.
WIDTH is the desired width of the font in pixels. If
width is 0, a font is chosen based on the height.
WEIGHT is a number from 0 to 1000. This parameter
specifies the darkness of the characters. Typical
values are:
400 - normal
700 - bold
Under Windows 2.0, any value from 0 to 550 is normal,
a value greater than 550 is bold.
ITALIC is a boolean. If ITALIC is true, the
characters are printed in italics. The default is
false.
UNDERLINE is a boolean. If UNDERLINE is true, the
characters are underlined. The default is false.
STRIKEOUT1 is a boolean. If STRIKEOUT is true, the
characters are printed with a line drawn through
them. The default is false.
CHARSET specifies the character set. Currently only
two values are used:
0 ANSI character set
255 OEM (machine dependent) character set.
QUALITY describes how closely you want to match the
specified font to the real font. Three values are
accepted:
0 default
1 draft quality
2 proof quality
Proof quality indicates that you don't want the font
increased in size to match the character height or
width that you request. Proof quality fonts are more
attractive, but may be smaller that you request.
Default font allows the quality to be determined by
the device creating the font.
PITCH_AND_FAMILY is the sum of two numbers:
the pitch:
0 default pitch - pitch set by device
1 fixed pitch - all characters the same width
2 variable pitch - characters of variable width
and the family:
0 don't care
16 roman - variable pitch with serif
32 swiss - variable pitch without serif
48 modern - fixed pitch
64 script - characters resembling italic handwriting
80 decorative - fancy characters
Fixed pitch indicates that you want all the
characters to be the same width.
FACE_NAME specifies the typeface name. Typefaces
standard with Windows include:
'Tms Rmn', Courier, Helv, Modern, Script, Roman,
Terminal, System
Returns FONT_HANDLE, the handle of the font.
Note The font must be selected with use_font before it is
used. When you are finished with a font, you should
release its memory using delete_font.
Appendix E contains a list of common Windows fonts
and the parameters used to create them. These fonts
make a good starting point for selecting attractive
fonts. The knowledge bases FONT.KB and FONTPRN.KB
are also useful when working with fonts. FONT.KB
displays and prints fonts with the specified
parameters so you can see how they look. FONTPRN.KB
lists the fonts available on your system.
If you are creating tables of data, do not use
proportional fonts. The special font names
OEM_FIXED_FONT, ANSI_FIXED_FONT, ANSI_VAR_FONT,
DEVICE_FAULT_SYSTEM and SYSTEM_FONT should not be
used with create_font. If they are used, create_font
will create an approximation to the font.
Errors I_CANT_CREATE_FONT
See Also #mset_font#m, #mdelete_font#m, #mtypeface_list#m,
#mfont_list#m
//create_topic
#cenable_menu_item (?m1, &Copy).
Format is 'create_topic (TOPIC).'.#c
Format create_topic (TOPIC)
Action Creates a new topic. If TOPIC is a list, each of the
topics specified by the list are created. If
necessary parent topics are also created. Topics are
normally created explicitly with a topic statement
or implicitly the first time they are referenced.
Parameters TOPIC is a topic name or list of topic names.
//current_directory
#cenable_menu_item (?m1, &Copy).
Format is 'current_directory ( ).'.#c
Format current_directory ( )
Action Finds the full path name of the current directory.
Returns The full path name of the current directory.
//date
#cenable_menu_item (?m1, &Copy).
Format is 'date ( ) .'.#c
Format date ( )
Action Reads the date from the system clock. The format
returned is
[ month , day , year ]
Returns A list in the format shown above which contains the
current system date.
//dde
#cenable_menu_item (?m1, &Copy).
Format is 'dde ( ).'.#c
Format dde ( )
Action Allows KnowledgePro to act as the server in DDE
conversations. A server responds to DDE requests
initiated by other applications.
KnowledgePro responds to the task name KPWIN or
KPWINRUN. The handle of a particular instance of
KPWIN can also be given at the end of the name.
KnowledgePro accepts the DDE topics system, KPWIN, or
the current knowledge base name. For the system DDE
topic, KnowledgePro responds to requests for the
items:
sysItems is the information that can be requested
from the topic system. These are sysItems, topics
and formats.
topics are system, KPWIN and the names of the
currently running knowledge bases.
formats is the list of data formats supported. These
are text, bitmap and csv (comma separated variable).
For the other DDE topics, KnowledgePro accepts
requests to return the value of KnowledgePro topics.
Note dde ( ) is not required for KnowledgePro to act as a
client to another DDE application. To use
KnowledgePro as a client use dde_open.
KnowledgePro is enabled to act as a DDE server by
default. This can also be changed from the
Options/Remote Requests option on the menu of the
development environment.
See Also #mdde_off#m
//dde_advise
#cenable_menu_item (?m1, &Copy).
Format is 'dde_advise (DDE_HANDLE, REQUEST, FORMAT).'.#c
Format dde_advise (DDE_HANDLE, REQUEST, FORMAT)
Action Request the server task to notify KnowledgePro
whenever REQUEST changes value. If the server can
respond, a dde_ok_event occurs and the DDE_TOPIC
defined in dde_open is called as:
DDE_TOPIC (INFORMATION, DDE_OK_EVENT,DDE_HANDLE).
INFORMATION contains the name of the request which
was passed as REQUEST in the call to dde_advise.
DDE_HANDLE is the handle passed in dde_advise.
If the server cannot respond to the request then a
dde_fail_event occurs and the DDE_TOPIC set by
dde_open is called as
DDE_TOPIC (INFORMATION, DDE_FAIL_EVENT, DDE_HANDLE).
INFORMATION contains the REQUEST which was named in
the call to dde_advise. REQUEST and DDE_HANDLE are
passed so you can identify which DDE request failed.
Parameters DDE_HANDLE is the DDE channel handle returned by
dde_open. This handle uniquely identifies the DDE
conversation.
REQUEST is the information requested from the server
task. The format of this parameter depends on the
application connected to the DDE_HANDLE. If this
parameter is a list, only the first item is used.
FORMAT is a format code. The following formats are
supported:
text which can also be passed as the code 1
bitmap which can also be passed as the code 2
csv comma separated variable
The default is text. If this element is a list only
the first item is used.
Errors I_INVALID_DDE_HANDLE, I_NO_ATOM, I_DDE_NO_MEM
See Also #mdde_open#m, #mdde_request#m, #mdde_unadvise#m
//dde_close
#cenable_menu_item (?m1, &Copy).
Format is 'dde_close (DDE_HANDLE).'.#c
Format dde_close (DDE_HANDLE)
Action Terminates the conversation specified by DDE_HANDLE.
No more dde events are processed for this
conversation. This does not affect KnowledgePro's
ability to act as a server for requests from other
applications.
Parameters DDE_HANDLE is the DDE channel handle returned by
dde_open. This handle uniquely identifies the DDE
conversation.
Errors I_INVALID_DDE_HANDLE
See Also #mdde_open#m
//dde_execute
#cenable_menu_item (?m1, &Copy).
Format is 'dde_execute (DDE_HANDLE, COMMANDS).'.#c
Format dde_execute (DDE_HANDLE, COMMANDS)
Action Request the server task to execute a series of
commands. If the server can execute the commands a
dde_ok_event occurs and the DDE_TOPIC set by dde_open
is called as:
DDE_TOPIC (INFORMATION, DDE_OK_EVENT, DDE_HANDLE).
In the case of a dde_execute INFORMATION contains
the empty list, [ ], since no data is returned.
When the server cannot respond to the dde_execute a
dde_fail_event occurs and the DDE_TOPIC set by
dde_open is called as
DDE_TOPIC (INFORMATION, DDE_FAIL_EVENT,DDE_HANDLE).
INFORMATION contains the empty list, [ ].
Parameters DDE_HANDLE is the DDE channel handle returned by
dde_open. This handle uniquely identifies the DDE
conversation.
COMMANDS is a list of commands to be executed by the
server task. The format of the list elements depends
on the application connected to DDE_HANDLE.
Errors I_INVALID_DDE_HANDLE, I_DDE_NO_MEM
See Also #mdde_open#m, #mdde_write#m
//dde_off
#cenable_menu_item (?m1, &Copy).
Format is 'dde_off ( ).'.#c
Format dde_off ( )
Action Causes KnowledgePro to ignore DDE messages from
client tasks. DDE can also be enabled and disabled
from Options on the main menu of the development
environment.
This command does not affect KnowledgePro's relation
as a client to another application.
See Also #mdde#m
//dde_open
#cenable_menu_item (?m1, &Copy).
Format is 'dde_open (DDE_TOPIC, APPLICATION, SUBJECT).'.#c
Format dde_open (DDE_TOPIC, APPLICATION, SUBJECT)
Action Attempts to Initiate a DDE conversation with the
specified application. The application acts as the
server and KnowledgePro acts as the client in the
conversation.
Parameters DDE_TOPIC is the topic that handles DDE events. DDE
events are DDE_OK_EVENT, DDE_FAIL_EVENT and
DDE_DATA_EVENT. If this item is a list, only the
first element is used.
APPLICATION is the name of the application which is
to act as the server. Each application which can act
as a server in a DDE conversation has an application
name to which it responds. See the documentation
accompanying the program for the application name. If
this item is a list, only the first element is used.
SUBJECT identifies the subject of the DDE
conversation. Microsoft Windows documentation calls
this the topic of the conversation. We use the term
subject to avoid confusion with KnowledgePro topics.
If this item is a list, only the first element is
used.
Returns DDE_HANDLE, a DDE channel handle. Since more than one
conversation can be started, the handle is used to
uniquely identify each particular conversation. If
the application does not respond, [ ] is returned and
no conversation is initiated.
Errors I_NO_ATOM, I_INVALID_DDE_HANDLE
Note dde_open lets KnowledgePro act as a client to other
applications. This means it can read and write data
and execute commands in other Windows DDE
applications.
A call to dde_open must be made before any of the
following functions can be called:
dde_advise dde_close dde_execute
dde_write dde_request dde_unadvise
When a dde channel is no longer needed, you should
always use dde_close to close the channel. To use
Knowledgepro as a server, you must use
dde ( ).
//dde_request
#cenable_menu_item (?m1, &Copy).
Format is 'dde_request (DDE_HANDLE, REQUEST, FORMAT).'.#c
Format dde_request (DDE_HANDLE, REQUEST, FORMAT)
Action Request the server task to provide KnowledgePro with
the data described by REQUEST. If the server can
respond to the request, a dde_data_event occurs and
the DDE_TOPIC defined in dde_open is called as
DDE_TOPIC (INFORMATION, DDE_DATA_EVENT, DDE_HANDLE).
INFORMATION is a list that contains [DATA, REQUEST,
FORMAT].
If the request can't be filled, a dde_fail_event
occurs and the DDE_TOPIC set by dde_open is called
as:
DDE_TOPIC (INFORMATION, DDE_FAIL_EVENT, DDE_HANDLE).
INFORMATION contains the name of the item requested
which was passed as REQUEST in dde_request.
Parameters DDE_HANDLE is the DDE channel handle returned by
dde_open. This handle uniquely identifies the DDE
conversation.
REQUEST is the information requested from the server
task. The format depends on the application connected
to the DDE_HANDLE. If this parameter is a list, only
the first parameter is used.
FORMAT is a format code. The following formats are
supported:
text which can also be passed as 1
bitmap which can also be passed as 2
csv comma separated variable
The default is text. If this parameter is a list only
the first element is used.
Errors I_INVALID_DDE_HANDLE, I_NO_ATOM, I_DDE_INVALID_FORMAT
See Also #mdde_open#m, #mdde_advise#m
//dde_unadvise
#cenable_menu_item (?m1, &Copy).
Format is 'dde_unadvise (DDE_HANDLE, REQUEST).'.#c
Format dde_unadvise (DDE_HANDLE, REQUEST)
Action Tells the server task to stop notifying KnowledgePro
whenever REQUEST changes value. If the server can
respond to the request, a dde_ok_event occurs and the
DDE_TOPIC defined in dde_init is called as:
DDE_TOPIC (INFORMATION, DDE_OK_EVENT, DDE_HANDLE).
INFORMATION contains the name of the request which
was passed as REQUEST in the call to dde_unadvise.
If the request can't respond to this request, a
dde_fail_event occurs and the DDE_TOPIC which was
defined in dde_open is called as:
DDE_TOPIC (INFORMATION, DDE_FAIL_EVENT, DDE_HANDLE).
INFORMATION contains the name of the request which
was passed as REQUEST in the call to dde_unadvise.
Parameters DDE_HANDLE is the DDE channel handle returned by
dde_open. This handle uniquely identifies the DDE
conversation.
REQUEST is the information requested from the server
task. The format of this parameter depends on the
application connected to the DDE_HANDLE. If this
parameter is a list, only the first parameter is
used. If REQUEST is [ ] or 0, then all advise links
with the server are terminated.
Errors I_INVALID_DDE_HANDLE, I_NO_ATOM
See Also #mdde_open#m, #mdde_advise#m
//dde_write
#cenable_menu_item (?m1, &Copy).
Format is 'dde_write (DDE_HANDLE, ITEM, DATA, FORMAT).'.#c
Format dde_write (DDE_HANDLE, ITEM, DATA, FORMAT)
Action This topic sends unsolicited data to the server task.
If the data is successfully written to the server
task a dde_ok_event occurs and the DDE_TOPIC defined
in the call to dde_open is called as:
DDE_TOPIC (INFORMATION, DDE_OK_EVENT, DDE_HANDLE).
INFORMATION contains the name of the item being
written which is passed as ITEM in the dde_write.
If the data can't be sent to the server task a
dde_fail_event occurs and the DDE_TOPIC set by
dde_open is called as
DDE_TOPIC (INFORMATION, DDE_FAIL_EVENT, DDE_HANDLE).
INFORMATION again contains the contents of ITEM
passed in the dde_write.
Parameters DDE_HANDLE is the DDE channel handle returned by
dde_open. This handle uniquely identifies the DDE
conversation.
ITEM is the item in the server task to which the data
is passed. The format depends on the application
connected to the DDE_HANDLE. If this parameter is a
list, only the first parameter is used.
DATA is the data to be sent to the application. The
format of the data depends on the receiving
application. If this parameter is a list, only the
first item is used. Comma separated variable (csv)
data should be passed as a string with embedded
commas.
FORMAT is a format code. The following formats are
supported:
text which can also be passed as 1
bitmap which can also be passed as 2
csv comma separated variable
The default is text. If this parameter is a list,
only the first element is used.
Errors I_INVALID_DDE_HANDLE, I_NO_ATOM, I_DDE_NO_MEM,
I_DDE_INVALID_FORMAT
//delay
#cenable_menu_item (?m1, &Copy).
Format is 'delay (TOPIC) .'.#c
Format delay (TOPIC)
Action Used internally to prevent the evaluation of
parameters in rules, while and repeat until
conditions have been evaluated.
Parameters TOPIC is a KnowledgePro topic.
Returns Returns the parameter passed to delay.
Note This topic is only used internally. You may
encounter it on a list of topics displayed in a debug
or during a trace. delay is useful if you are
working directly with topics in their internal
representation in perform or set_procedures.
//delete_bitmap
#cenable_menu_item (?m1, &Copy).
Format is 'delete_bitmap (BITMAP_HANDLE).'.#c
Format delete_bitmap (BITMAP_HANDLE)
Action Removes the bitmap from memory and makes its handle
invalid.
Parameters BITMAP_HANDLE is a handle or list of bitmap handles.
Note Be careful that the bitmap handle is not still being
used for display. Close any windows or clear the
window displaying the bitmap before deleting it.
KnowledgePro uses the bitmap handle for re-painting
the window.
Errors I_NOT_BITMAP
See Also #mload_bitmap#m, #mcreate_bitmap#m,
#mread_clipboard#m, #mbitmap_to_clipboard#m
//delete_font
#cenable_menu_item (?m1, &Copy).
Format is 'delete_font (FONT_HANDLE).'.#c
Format delete_font (FONT_HANDLE)
Action Removes the specified font or list of fonts and frees
any memory associated with it.
Parameters FONT_HANDLE is the handle of a font or list of
handles.
Note Do not delete any font which is still being displayed
in a window. KnowledgePro uses the font handle when
repainting windows. Close or clear any window using
the font before deleting the font.
Errors I_INVALID_FONT, I_CANT_DELETE_FONT
See Also #mcreate_font#m, #mset_font#m
//delete_icon
#cenable_menu_item (?m1, &Copy).
Format is 'delete_icon (ICON_HANDLE).'.#c
Format delete_icon (ICON_HANDLE)
Action Removes the icon from memory and makes its handle
invalid. You should delete all icons not in use to
clear the memory.
Parameters ICON_HANDLE is a handle or list of icon handles
Errors I_NOT_ICON
See Also #mload_icon#m, #micon#m, #mattach_icon#m
//different
#cenable_menu_item (?m1, &Copy).
Format is 'different (LIST1, LIST2).'.#c
Format different (LIST1, LIST2)
Action This topic returns those items that are on the list
LIST1 that are not also on LIST2. LIST1 and LIST2
are interchangeable; their order is not important.
Parameters LIST1, LIST2 Each element of LIST1 is checked for
membership in LIST2. If the item is also in LIST2, it
is not included in the new list.
Returns The list of items that is formed by each element of
LIST1 that is not an element of LIST2. The
resulting list will contain no duplicate elements.
//dir
#cenable_menu_item (?m1, &Copy).
Format is 'dir ({DOS_DIRECTORY}).'.#c
Format dir ({DOS_DIRECTORY})
Action Provides a list of all the files on one or more DOS
directories.
Parameters DOS_DIRECTORY is any legal DOS directory name or a
list of directory names. The name can include file
names that include * or ? as wildcards.
Returns A list of all the files that fit the description of
the directory and files to be searched. If a list of
DOS directories is provided as a parameter, a list of
lists is returned with the names of the files in each
of the named directories. If no parameter is given,
a list of all the files in the current drive and
directory is returned.
Error I_UNKNOWN_FILE_TYPE
See Also #mcurrent_dir#m, #mfile_menu#m, #msave_as#m
//disable_menu_item
#cenable_menu_item (?m1, &Copy).
Format is 'disable_menu_item (HANDLE, ITEM).'.#c
Format disable_menu_item (HANDLE, ITEM)
Action The specified menu item is disabled. Keyboard and
mouse input are ignored for this item.
Parameters HANDLE the handle of the menu that contains the item
to be disabled.
ITEM the name of a menu item, or list of items.
Note This command has no effect if the menu item is
already disabled.
Errors I_NO_MENU, I_INVALID_WINDOW, I_MENU_NOT_FOUND
See Also #mmenu#m, #menable_menu_item#m, #mcheck_menu_item#m,
#muncheck_menu_item#m
//disable_window
#cenable_menu_item (?m1, &Copy).
Format is 'disable_window (HANDLE).'.#c
Format disable_window (HANDLE)
Action The specified window or a screen object is disabled.
Keyboard and mouse input are ignored. The window or
screen object cannot be moved or closed, although
messages can be written to it. If a disabled window
is covered by another window, it can't be brought to
the top or be made the active window.
Parameters HANDLE is the handle of a window or other screen
object. The default is the current display window.
Note This command has no effect if the window or screen
object is already disabled.
Errors I_NO_MENU, I_INVALID_WINDOW, I_MENU_NOT_FOUND
See Also #menable_window#m, #mhide_window#m, #mshow_window#m,
#mmake_modal#m
//do
#cenable_menu_item (?m1, &Copy).
Format is 'do (TOPIC {,PARAMETER1, PARAMETER2 ...}) .'.#c
Format do (TOPIC {,PARAMETER1, PARAMETER2 ...})
Alternate TOPIC ({PARAMETER1, PARAMETER2...})
Action Performs the commands associated with TOPIC . A list
of parameters can optionally be passed to the
topics. When the topic name evaluates to a list,
each topic on the list is evaluated in order.
PARAMETER1, PARAMETER2, ... are passed to each topic
as parameters. If TOPIC does not exist, an error
message is displayed.
Parameters TOPIC is a topic or list of topic names to be
performed.
{PARAMETER1, PARAMETER2 ...} are optional parameters
that are passed to the topic or topics being
performed.
Returns The value of TOPIC.
See Also The discussion of knowledge base structure in Section
5.1 and calling topics 5.3.
//do_local
#cenable_menu_item (?m1, &Copy).
Format is 'do_local (TOPIC{, PARAMETER1, PARAMETER2..}).'.#c
Format do_local (TOPIC{, PARAMETER1, PARAMETER2..})
Action do_local is similar to the topic do. do_local calls
TOPIC and passes it PARAMETER1, PARAMETER2, etc.
When TOPIC is called, it is performed as if it is
located inside the topic containing do_local. This
relocates TOPIC in the hierarchy of the knowledge
base and changes the search order of its commands,
sub-topics and parameters. As TOPIC is executed,
first its sub-topics and parameters are created in
the current topic. Next, TOPIC's commands are
executed within the current topic. Finally, the
parameters are removed. All searches for topic
values begin with the current topic instead of the
location in which TOPIC was defined.
Parameters TOPIC a topic name or list of topic names.
PARAMETER1... parameters to be passed to each topic.
Note This function should be used with caution. Since the
scope of a topic executed with do_local is different
than scope indicated in the source code, debugging
can be difficult.
Errors I_V_TOPIC_NOT_FOUND
See Also #mim_a#m, #mnew#m
//edit_box
#cenable_menu_item (?m1, &Copy).
Format is 'edit_box ({TEXT, EVENT_TOPIC, COLUMN, ROW, WIDTH, HEIGHT, EDIT_STYLE, EVENT_LIST}).'.#c
Format edit_box ({TEXT, EVENT_TOPIC, COLUMN, ROW, WIDTH,
HEIGHT, EDIT_STYLE, EVENT_LIST})
Action Opens an edit box in the current display window.
Special edit styles can be used and default text can
be placed in the window.
Parameters TEXT is default text that appears in the edit box.
EVENT_TOPIC is the topic or list of topics to be
performed when an event on the EVENT_LIST occurs
while the focus is on the edit box. EVENT_TOPIC is
called as:
EVENT_TOPIC (EVENT_INFO,EVENT_NAME,HANDLE).
EVENT_INFO depends on the event that occurs. A
description of events is provided in Appendix D.
EVENT_NAME is the name of the event that occurred.
HANDLE is the handle assigned to the edit box.
If EVENT_TOPIC sets its value to true after being
called by a lose_focus_event, close_event,
char_event, or a sys_char_event, further processing
of the event is canceled. Whenever EVENT_TOPIC is
called its value is reset before it is executed. If
no EVENT_TOPIC is defined, no events are recognized.
COLUMN, ROW is the position of the edit box. The
default is the current display position. COLUMN and
ROW are relative to the upper left corner of the
display area of the current display window.
WIDTH, HEIGHT is the size of the edit box. Defaults
are 20 columns wide and 5 rows high.
EDIT_STYLE is a list of styles for the edit box.
Styles may be selected from the following:
Child Visible ThinFrame DialogFrame
MultiLine AutoHscroll AutoVscroll NoHideSelect
LeftText RightText CenterText
The default depends on the height of the window. If
the height is less than 2, the default style is
[Child, Visible, ThinFrame, AutoHscroll, LeftText]
If the height is 2 or greater, the style is
[Child, Visible, ThinFrame, AutoHscroll, LeftText,
MultiLine, AutoVscroll, Vscroll, Hscroll].
EVENT_LIST is a list of events that will cause the
EVENT_TOPIC to be called. The events that can be
processed are:
get_focus_event, lose_focus_event, close_event
char_event, sys_char_event These events are described
in detail in Appendix D.
If no event is specified, the default event is a
lose_focus_event.
Returns HANDLE, the handle of the edit box.
Note To get the contents of an edit box use the get_text
topic. The text in an edit box can be changed using
set_text.
See Also #medit_window#m, #medit_file#m, #medit_line#m,
#mget_text#m, #mset_text#m, #mDescription of Events#m
//edit_file
#cenable_menu_item (?m1, &Copy).
Format is 'edit_file (FILE_NAME, {EVENT_TOPIC, COLUMN, ROW, WIDTH, HEIGHT, WORD_WRAP, EVENT_LIST}).'.#c
Format edit_file (FILE_NAME, {EVENT_TOPIC, COLUMN, ROW,
WIDTH, HEIGHT, WORD_WRAP, EVENT_LIST})
Action Opens an edit window that contains a menu containing
the File, Edit and Search options. Text is read from
FILE_NAME, if it exists, and placed in the window and
the cursor is placed at the beginning of the window.
All edit windows opened with edit_file have default
window style and cannot be children of other windows.
Parameters FILE_NAME is the name of a file or list of files. If
this parameter is a list, a window is opened for each
file.
EVENT_TOPIC is the topic or list of topics to be
performed when an event on the EVENT_LIST occurs
while the focus is on the edit file. EVENT_TOPIC is
called as:
EVENT_TOPIC (EVENT_INFO,EVENT_NAME,HANDLE).
EVENT_INFO depends on the event that occurs. A
description of events is provided in Appendix D.
EVENT_NAME is the name of the event that occurred.
HANDLE is the handle assigned to the edit file.
If EVENT_TOPIC sets its value to true after being
called by a lose_focus_event, close_event,
char_event, or a sys_char_event, further processing
of the event is canceled. Whenever EVENT_TOPIC is
called its value is reset before it is executed. If
no EVENT_TOPIC is defined, no events are recognized.
COLUMN,ROW is the location of the edit window. COLUMN
and ROW are relative to the upper left corner of the
screen. The default is the same as for display
windows.
WIDTH, HEIGHT is the window size. The default is 65
columns wide and 18 rows high.
WORD_WRAP is a boolean indicating whether word
wrapping should take place at the end of a line.
When WORD_WRAP is true, horizontal scrolling is
disabled and lines are broken at the window's edge.
The default is false.
EVENT_LIST is a list of events that will cause the
EVENT_TOPIC to be called. The events that can be
processed are:
get_focus_event, lose_focus_event, close_event,
char_event, sys_char_event, resize_event, move_event,
horz_scroll_event, vert_scroll_event
These events are described in detail in Appendix D.
If no event is specified, the default event is a
close_event.
Returns HANDLE, the handle of the edit file window.
Errors I_INVALID_PARENT
See Also #medit#m, #medit_line#m, #medit_box#m, #mfile_menu#m,
#mget_text#m, #mset_text#m, #msave_edit_file#m,
#mDescription of Events#m
//edit_line
#cenable_menu_item (?m1, &Copy).
Format is 'edit_line ({TEXT, EVENT_TOPIC, COLUMN, ROW, WIDTH, EVENT_LIST}).'.#c
Format edit_line ({TEXT, EVENT_TOPIC, COLUMN, ROW, WIDTH,
EVENT_LIST})
Action Opens an edit line in the current display window.
Parameters TEXT is the text to appear in the edit line as a
default . If TEXT is a list, only the first element
is used.
EVENT_TOPIC is the topic or list of topics to be
performed when an event on the EVENT_LSIT occurs
while the focus is on the edit line. EVENT_TOPIC is
called as:
EVENT_TOPIC (EVENT_INFO,EVENT_NAME,HANDLE).
EVENT_INFO depends on the event that occurs. A
description of events is provided in Appendix D.
EVENT_NAME is the name of the event that occurred.
HANDLE is the handle assigned to the edit line.
If EVENT_TOPIC sets its value to true after being
called by a lose_focus_event, close_event,
char_event, or a sys_char_event, further processing
of the event is canceled. Whenever EVENT_TOPIC is
called its value is reset before it is executed. If
no EVENT_TOPIC is defined, no events are recognized.
COLUMN, ROW is the location of the edit line. The
default is the current display position. COLUMN and
ROW are relative to the display area of the current
display window.
WIDTH is the width of the edit line. The default is
20 characters.
EVENT_LIST is a list of events that will cause the
EVENT_TOPIC to be called. The events that can be
processed are:
get_focus_event, lose_focus_event, close_event
char_event, sys_char_event These events are described
in detail in Appendix D. If no event is specified,
the default event is a lose_focus_event.
Returns HANDLE, the handle of the edit line.
Note To obtain the value of an edit line use get_text.
set_text can be used to set the text in an edit line.
See Also #medit_box#m, #medit_file#m, #medit_window#m,
#mget_text#m, #mset_text#m, #mread_response#m,
#mDescription of Events#m
//edit_window
#cenable_menu_item (?m1, &Copy).
Format is 'edit_window ({TEXT, EVENT_TOPIC, COLUMN, ROW, WIDTH, HEIGHT, TITLE, STYLE, PARENT, WORD_WRAP, EVENT_LIST}).'.#c
Format edit_window ({TEXT, EVENT_TOPIC, COLUMN, ROW, WIDTH,
HEIGHT, TITLE, STYLE, PARENT, WORD_WRAP, EVENT_LIST})
Action Opens a window of any style for editing text. TEXT
is placed in the window and the cursor is placed at
the beginning of the text.
Parameters TEXT is the text to be edited. If this item is
missing or [ ], an empty edit window is displayed.
EVENT_TOPIC is the topic or list of topics to be
performed when an event on the EVENT_LIST occurs
while the focus is on the edit window. EVENT_TOPIC
is called as:
EVENT_TOPIC (EVENT_INFO,EVENT_NAME,HANDLE).
EVENT_INFO depends on the event that occurs. A
description of events is provided in Appendix D.
EVENT_NAME is the name of the event that occurred.
HANDLE is the handle assigned to the edit window.
If EVENT_TOPIC sets its value to true after being
called by a lose_focus_event, close_event,
char_event, or a sys_char_event, further processing
of the event is canceled. Whenever EVENT_TOPIC is
called its value is reset before it is executed. If
no EVENT_TOPIC is defined, no events are recognized.
COLUMN, ROW is the position of the edit window. If
the window has the Child style, position 1,1 is at
the upper left corner of the parent window. A Popup
or Overlapped window places position 1,1 at the upper
left hand corner of the screen. If no column and row
information is specified, successive edit windows are
overlapped on the screen.
WIDTH, HEIGHT is the size of the edit window.
Defaults are 65 columns wide and 18 rows high.
TITLE is the title on the edit window.
STYLE is the style of the edit window. The window
STYLE is a list of values chosen from the following
list:
Type of window Popup
Child
Overlapped
Initial state Visible
Maximized
Disabled
Frame ThinFrame
ThickFrame
DialogFrame
Treatment of ShowChildren
related windows Siblings
Special elements TitleBar
VertScroll
HorzScroll
ControlMenu
MaximizeBox
MinimizeBox
Combined styles
OverlappedWindow contains the styles:
[PopUp, ThickFrame, ControlMenu, MaximizeBox,
MinimizeBox, ShowChildren]
PopUpWindow contains the styles:
[PopUp, ThickFrame, ShowChildren]
ChildWindow contains the styles:
[Child, ThinFrame, ShowChildren, Siblings]
DialogWindow contains the styles:
[Popup, DialogFrame, ShowChildren]
The default STYLE for an edit window is
[Popup, Visible, ThickFrame, TitleBar, ControlMenu,
HorzScroll, VertScroll].
PARENT is the handle of the window's parent. An
Overlapped window cannot have a PARENT. A Child
style must be assigned a parent. The default is none.
WORD_WRAP is a boolean value indicating whether word
wrapping should take place at the end of a line.
When WORD_WRAP is true, horizontal scrolling is
disabled and lines are broken at the window's edge.
The default is false.
EVENT_LIST is a list of events that will cause the
EVENT_TOPIC to be called. The events that can be
processed are:
get_focus_event, lose_focus_event, close_event,
char_event, sys_char_event, move_event,
resize_event, horz_scroll_event, vert_scroll_event
These events are described in detail in Appendix D.
If no event is specified, the default event is a
close_event.
Note To get the contents of an edit window use get_text
with the handle of the edit window. set_text sets
the text in a edit window.
Errors I_INVALID_PARENT
See Also #medit_file#m, #medit_box#m, #medit_line#m,
#mget_text#m, #mset_text#m, #mDescription of Events#m
//element
#cenable_menu_item (?m1, &Copy).
Format is 'element (LIST, POSITION).'.#c
Format element (LIST, POSITION)
Action Returns the item at the specified location of a list.
Parameters LIST is the list of items to search.
POSITION is an integer or list of integers telling
which item in LIST you want to select.
Returns The element at the specified position in LIST. If
POSITION is a list, a list of the selected items is
returned. If the integer selected is greater than the
length of the list or 0, [ ] is returned.
Note The first element in a list is number 1.
Errors I_INVALID_ELEMENT
See Also #mfirst#m, #mlast#m, #mrest#m, #mwhere#m
//enable_all_windows
#cenable_menu_item (?m1, &Copy).
Format is 'enable_all_windows ( ).'.#c
Format enable_all_windows ( )
Action Enables all disabled windows and screen objects.
See Also #menable_window#m
//enable_menu_item
#cenable_menu_item (?m1, &Copy).
Format is 'enable_menu_item (HANDLE, ITEM).'.#c
Format enable_menu_item (HANDLE, ITEM)
Action The specified menu item is enabled. The user may
select the item with the keyboard or the mouse.
There is no effect if the menu item is already
enabled.
Parameters HANDLE the handle of a menu containing the item to be
enabled.
ITEM the name of a menu item, or list of menu items.
Errors I_NO_MENU, I_INVALID_WINDOW, I_MENU_NOT_FOUND
//enable_window
#cenable_menu_item (?m1, &Copy).
Format is 'enable_window ({HANDLE}).'.#c
Format enable_window ({HANDLE})
Action The specified window is enabled. Keyboard and mouse
input is processed for this window. There is no
effect if the window is already enabled. This topic
can be used to enable windows and screen objects
disabled with disable_window.
Parameters HANDLE the handle of a window or other screen
object. The default is the current display window.
Errors I_INVALID_WINDOW
//error_message
#cenable_menu_item (?m1, &Copy).
Format is 'error_message (ERROR_NAME TOPIC, PARAMETERS).'.#c
Format error_message (ERROR_NAME TOPIC, PARAMETERS)
Action Calls the internal error handling routine that
creates a message box. Displays the topic name,
parameters and the message associated with
ERROR_NAME. If no message can be found for
ERROR_NAME, the default message:
"Error code: ?error_name"
is displayed.
Parameters ERROR_NAME is the name of the error. Appendix A
lists all of the error names with their messages.
TOPIC is the name of the topic which caused the
error.
PARAMETERS is a list containing the values of the
topic's parameters
Note The default error message is displayed in a message
box with Ok and Cancel buttons. Pressing Cancel
terminates execution of the knowledge base.
See Also #mget_error_topic#m, #mset_error_topic#m
//evaluate
#cenable_menu_item (?m1, &Copy).
Format is 'evaluate (COMMAND_LIST).'.#c
Format evaluate (COMMAND_LIST)
Action This executes a list containing a KnowledgePro
command represented in internal format.
Parameters COMMAND_LIST a list of which specifies commands to be
executed. Each command is represented in its
internal format. This has the form:
[function, parameter1, parameter2, ...]
Using Debug, this list is displayed as:
function (parameter1,parameter2,...)
Returns A list containing the result of executing the command
in COMMAND_LIST.
Note compile_string can be used to turn a statement that
uses the usual syntax into its internal
representation. evaluate is not supported by the
runtime version of KnowledgePro.
Errors evaluate has no error messages but attempting to
evaluate a topic which contains an error results in
an error message from that topic.
See Also #mcompile_string#m, #mprocedure#m
//exists
#cenable_menu_item (?m1, &Copy).
Format is 'exists (TOPIC).'.#c
Format exists (TOPIC)
Action Checks to see if a specified topic exists in the
knowledge base. See Chapter 5.1.3 for a description
of the way the hierarchy of topics is searched.
Parameters TOPIC is the name of the topic or list of topics to
be checked.
Returns T for each topic contained in the knowledge
base, otherwise returns F.
//exit
#cenable_menu_item (?m1, &Copy).
Format is 'exit ( ).'.#c
Format exit ( )
Action Stops executing commands associated with the current
topic and returns control to the topic which invoked
it.
Note Executing exit ( ) from !main terminates the
knowledge base.
//exit_kp
#cenable_menu_item (?m1, &Copy).
Format is 'exit_kp ().'.#c
Format exit_kp ()
Action Exits from KnowledgePro. KnowledgePro and all
knowledge bases are cleared from memory. This
command is the same as choosing Exit from the main
menu.
See Also #mexit#m, #mstop#m, #mexit_windows#m
//exit_windows
#cenable_menu_item (?m1, &Copy).
Format is 'exit_windows ().'.#c
Format exit_windows ()
Action Terminates KnowledgePro and the current Windows
session. This command has the same effect as
choosing Exit from the MS-DOS Executive menu.
Error F_FILE_NOT_FOUND
Note The F_FILE_NOT_FOUND error occurs if the MS-DOS
Executive cannot be found.
See Also #mexit#m, #mstop#m, #mexit_kp#m
//file_menu
#cenable_menu_item (?m1, &Copy).
Format is 'file_menu ( {FILE, DIRECTORY, TEXT} ).'.#c
Format file_menu ( {FILE, DIRECTORY, TEXT} )
Action Opens a dialog box with an edit line that contains
FILE, the default file name, the name of the default
directory, a list box of files and a list box of
possible directories. The contents of the file list
box depends on the value of FILE. If FILE contains a
*, all files in the selected directory that match the
description are displayed in the list box. A file
name can also be directly typed into the edit line.
The selected directory can be changed by choosing a
directory from the list box of directories.
Parameters FILE names a default file name. This file appears in
the edit line. If FILE contains a *, a list of all
matching files in the selected directory are
displayed in a list box.
DIRECTORY the name of the directory to search for the
specified FILE.
TEXT is the message written on the top line of the
dialog window.
Returns The file name selected.
See Also #msave_as#m
//first
#cenable_menu_item (?m1, &Copy).
Format is 'first (LIST).'.#c
Format first (LIST)
Action Returns the first element from a list.
Parameters LIST is a list of items.
Returns The first item on the specified list. If the list
is empty, the empty list, [ ], is returned.
See Also #melement#m, #mlast#m, #mrest#m
//flatten
#cenable_menu_item (?m1, &Copy).
Format is 'flatten (LIST).'.#c
Format flatten (LIST)
Action Creates a new list by flattening all the sublists on
LIST. LIST itself is not changed.
Parameters LIST is the name of the list to be flattened.
Returns The flattened list.
//font_list
#cenable_menu_item (?m1, &Copy).
Format is 'font_list (DEVICE).'.#c
Format font_list (DEVICE)
Parameters DEVICE [ ] for the display or prn for the printer.
Returns A list of available font descriptions. Each font
description is a list with the format:
[WIDTH, HEIGHT, WEIGHT, ITALIC, UNDERLINE, STRIKEOUT,
CHARSET, QUALITY, PITCH_AND_FAMILY, TYPEFACE_NAME].
These are described in detail under create_font.
Errors I_PRINT_NO_DC
See Also #mcreate_font#m, #mtypeface_list#m, #muse_font#m
//free_library
#cenable_menu_item (?m1, &Copy).
Format is 'free_library (DLL_HANDLE).'.#c
Format free_library (DLL_HANDLE)
Action Decreases the reference count of the DLL by one. When
the reference count is zero, the memory occupied by
the DLL is freed.
Parameters DLL_HANDLE is a handle or list of handles of
previously loaded dynamic link libraries (DLL).
Note All DLLs previously loaded by load_library are freed
automatically before a knowledge base is executed.
Errors I_INVALID_LIBRARY
See Also #mload_library#m, #muser#m
//full_name
#cenable_menu_item (?m1, &Copy).
Format is 'full_name (TOPIC).'.#c
Format full_name (TOPIC)
Action full_name is used to find all of the ancestors of a
topic. The full name of a topic contains all of the
topic's ancestors separated by colons. The full name
specifies the location of the topic in the hierarchy
of the knowledge base.
Parameters TOPIC is the name of a topic or a list of topic
names. If topic is [ ], the full name of the current
topic is returned.
Returns The full name of the topic. The full name of a topic
consists of all of the topic's ancestors separated by
colons. If the topic can not be found, TOPIC is
returned.
See Also #mcalling_topic#m
//get_active_window
#cenable_menu_item (?m1, &Copy).
Format is 'get_active_window ().'.#c
Format get_active_window ()
Action Finds the handle of the currently active window. The
active window is the one that receives user input.
Returns The handle of the active window.
See Also #mget_display_window#m, #mget_top_window#m,
#mset_active_window#m, #mget_top_window#m
//get_check_box
#cenable_menu_item (?m1, &Copy).
Format is 'get_check_box (CHECK_BOX_HANDLE).'.#c
Format get_check_box (CHECK_BOX_HANDLE)
Action Finds the state of the check box.
Parameters CHECK_BOX_HANDLE the handle of a check box or a list
of check boxes.
Returns Returns T if a check box is checked, F if it is not.
Errors I_INVALID_WINDOW
See Also #mset_check_box#m
//get_cursor_pos
#cenable_menu_item (?m1, &Copy).
Format is 'get_cursor_pos ().'.#c
Format get_cursor_pos ()
Action Finds the location of the text cursor in the
currently active window.
Returns A list containing the column and row position of the
cursor in the currently active window. COLUMN and
ROW are measured from the upper left corner of the
window.
See Also #mset_cursor_pos#m, #mset_display_pos#m,
#mget_display_pos#m
//get_demon
#cenable_menu_item (?m1, &Copy).
Format is 'get_demon (TOPIC).'.#c
Format get_demon (TOPIC)
Action Returns the list of demons that is assigned to the
specified topic.
Parameters TOPIC is a topic name or list of topic names. The
default is the current topic.
Errors I_TOPIC_NOT_FOUND
See Also #mset_demon#m
//get_display_pos
#cenable_menu_item (?m1, &Copy).
Format is 'get_display_pos ( ) .'.#c
Format get_display_pos ( )
Action Finds the position where the next screen output will
occur. The upper left corner of the window is
position [1,1].
Returns A list containing the column and row position where
the next text or screen object is displayed in the
current display window.
Errors I_INVALID_WINDOW
See Also #mset_display_pos#m, #mget_cursor_pos#m
//get_display_window
#cenable_menu_item (?m1, &Copy).
Format is 'get_display_window ( ).'.#c
Format get_display_window ( )
Action Finds which window is the current display window.
The display window is the window where text is
displayed and new screen objects are created.
Returns The handle of the current display window.
See Also #mset_display_window#m, #mget_active_window#m,
#mset_active_window#m, #mset_top_window#m,
#mget_top_window#m
//get_error_topic
#cenable_menu_item (?m1, &Copy).
Format is 'get_error_topic ( ).'.#c
Format get_error_topic ( )
Action Finds the list of error handling topics assigned.
Returns A list of names of the user defined error handling
topics assigned by set_error_topic. If no error topic
has been assigned, [ ] is returned to indicate that
the default error handler is in effect.
See Also #merror_handler#m, #merror_message#m,
#mset_error_topic#m
//get_event_topic
#cenable_menu_item (?m1, &Copy).
Format is 'get_event_topic ().'.#c
Format get_event_topic ()
Action Finds the name of the global event handling topic.
This topic is defined by set_event_topic.
Returns The name of the global event handling topic. If no
global event topic is set, [ ] is returned.
See Also #mset_event_topic#m
//get_file_pos
#cenable_menu_item (?m1, &Copy).
Format is 'get_file_pos (FILE).'.#c
Format get_file_pos (FILE)
Action Finds the position of a file's pointer.
Parameters FILE is the name of the file or list of files.
Returns The position of the file pointer, in bytes from the
beginning of the file. If the file pointer is at the
beginning of the file, 0 is returned.
Errors I_CANT_OPEN
See Also #mset_file_pos#m, #mread#m, #mread_char#m,
#mread_line#m, #mwrite#m, #mclose#m, #mnew_file#m
//get_focus
#cenable_menu_item (?m1, &Copy).
Format is 'get_focus ( ).'.#c
Format get_focus ( )
Action Returns the handle of the window or screen object
that currently has the focus.
Returns The handle of the window or screen object with the
focus.
See Also #mset_focus#m, #mget_display_window#m,
#mset_active_window#m, #mget_top_window#m,
#mget_top_window#m
//get_list_box
#cenable_menu_item (?m1, &Copy).
Format is 'get_list_box (LIST_BOX_HANDLE).'.#c
Format get_list_box (LIST_BOX_HANDLE)
Action Retrieves the selected items from the specified list
box
Parameters LIST_BOX_HANDLE is the handle of a list box or list
of handles
Returns A list of the currently selected items from the list
box
Errors I_INVALID_WINDOW occurs if LIST_BOX_HANDLE is not a
valid window or a list box.
See Also #mlist_box#m, #mget_text#m, #mset_text#m
//get_number_of_values
#cenable_menu_item (?m1, &Copy).
Format is 'get_number_of_values (TOPIC).'.#c
Format get_number_of_values (TOPIC)
Action Returns the maximum number of values that a topic
can be assigned. This number is assigned using
set_number_of_values. When a list of TOPICS is
given, a list of values is returned.
Parameters TOPIC is the topic or list of topics whose
maximum number of legal values you want to find.
Returns A list containing the maximum number of legal values
allowed for each topic named. If a topic is not
found, [ ] is returned.
Error I_TOPIC_NOT_FOUND
See Also #mset_number_of_values#m
//get_procedures
#cenable_menu_item (?m1, &Copy).
Format is 'get_procedures (TOPIC).'.#c
Format get_procedures (TOPIC)
Action Returns the list of commands associated with TOPIC .
Parameters TOPIC is the topic or list of topics whose commands
you want to find. If TOPIC is [ ] the current topic
is used. If TOPIC cannot be found, [ ] is returned.
Returns A list of the commands associated with each topic
named. The commands are in compiled form.
KnowledgePro commands are represented internally as a
list in the form:
[topic, parameter1, parameter2...].
This list is displayed as
topic (parameter1, parameter2,...)
when it is displayed in a debugging window.
Multiple commands are represented as a list of lists:
[[topic1, parameter1, parameter2...],
[topic2, parameter1, parameter2...],...].
These lists may be manipulated using any of the
standard list topics.
Note get_procedures is not supported in the runtime
version of KnowledgePro.
See Also #mcompile_string#m, #mevaluate#m, #mperform#m,
#mset_procedures#m
//get_radio_button
#cenable_menu_item (?m1, &Copy).
Format is 'get_radio_button (HANDLE).'.#c
Format get_radio_button (HANDLE)
Action Retrieves the state of a radio button or a list of
radio buttons.
Parameters HANDLE is the handle of a radio button or a list of
radio buttons.
Returns Returns T if a radio button is selected, F if it is
not. If a list of radio buttons is passed, a list of
T and F values corresponding to the radio button list
is returned.
Errors I_INVALID_WINDOW
See Also #mget_text#m, #mradio_button#m, #mset_radio_button#m,
#mset_text#m
//get_read_only
#cenable_menu_item (?m1, &Copy).
Format is 'get_read_only (TOPIC).'.#c
Format get_read_only (TOPIC)
Action Finds whether the value of a topic or list of topics
can be changed. By default, all topics can have new
values assigned. Topics may be defined as read only
to prevent values from being overwritten. This is
done using set_read_only.
Parameters TOPIC is a topic or list of topics.
Returns T if the topic has been made read only using
set_read_only. If the values of the topic can be
changed, F is returned. If a list is passed in
TOPIC, a list is returned with a T or F for each item
in TOPIC.
Error I_V_TOPIC_NOT_FOUND
See Also #mset_read_only#m
//get_scroll_bar
#cenable_menu_item (?m1, &Copy).
Format is 'get_scroll_bar (HANDLE).'.#c
Format get_scroll_bar (HANDLE)
Action Returns the value of a scroll bar.
Parameters HANDLE is the handle of a scroll bar or list of
handles.
Returns The current position of the scroll bar slider.
Errors I_INVALID_WINDOW
See Also #mhorz_scroll_bar#m, #mset_scroll_bar#m,
#mvert_scroll_bar#m
//get_text
#cenable_menu_item (?m1, &Copy).
Format is 'get_text (HANDLE).'.#c
Format get_text (HANDLE)
Action Retrieves the text associated with the window or
screen object whose handle is passed.
Parameters HANDLE is the handle of a window or screen object or
a list of handles. The default is the handle of the
active window.
Returns The text associated with the window. The text
returned depends on the type of the window:
Window Type Returned
Button The button text
Edit Object The text appearing in the window.
Text is returned with each line
as one item of a list.
List box A list of all items contained in
the list box.
Scroll bar [ ]
Display Window The text appearing in the window.
Text is returned with each line
as one item of a list.
Note In display windows, the maximum line length is 1024
characters. Lines longer than 1024 characters are
split into several lines and trailing spaces are
deleted.
Errors I_INVALID_WINDOW
See Also #mset_text#m
//get_title
#cenable_menu_item (?m1, &Copy).
Format is 'get_title ({HANDLE}).'.#c
Format get_title ({HANDLE})
Action Gets the title of either edit or display windows that
have a style which includes a title bar.
Parameters HANDLE is the handle of a window or a list of
handles. The default is the currently active window.
Returns The title associated with the window. If the window
does not have a title, [ ] is returned.
Errors I_INVALID_WINDOW
See Also #mget_text#m, #mset_title#m
//get_top_window
#cenable_menu_item (?m1, &Copy).
Format is 'get_top_window ( ).'.#c
Format get_top_window ( )
Action get_top_window is used to find which window has the
focus or contains the screen object that has the
focus. If the window is a popup or an overlapped
window it is also the active window.
Returns The handle of the top window.
See Also #mget_active_window#m, #mget_focus#m,
#mset_top_window#m, #mDescription of Events#m
//gets
#cenable_menu_item (?m1, &Copy).
Format is 'gets (TOPIC, VALUES) .'.#c
Format gets (TOPIC, VALUES)
Alternate TOPIC gets VALUES
Action Appends the specified items to the value of the topic
or list of topics specified.
Parameters TOPIC is a topic name or list of topic names. If
TOPIC is not found it is created.
VALUES contains the list of VALUES that are appended
to the current value of the specified topics.
Errors I_READ_ONLY_TOPICS, I_TOO_MANY_VALUES
//gets_c
#cenable_menu_item (?m1, &Copy).
Format is 'gets_c (TOPIC, VALUES).'.#c
Format gets_c (TOPIC, VALUES)
Alternate TOPIC gets_c VALUES
Action Appends each element of VALUES to the value of the
corresponding topic from TOPIC. The list TOPIC is
flattened before the assignment takes place. Elements
from VALUES which do not have a corresponding topic
in the list TOPIC are ignored. Topics which do not
have a corresponding element on VALUES are assigned [].
Parameters TOPIC is a topic name or list of topic names. If a
TOPIC is not found it is created.
VALUES is the list of items that are appended to the
current values of the corresponding topics.
Errors I_READ_ONLY_TOPICS, I_TOO_MANY_VALUES
//group_box
#cenable_menu_item (?m1, &Copy).
Format is 'group_box (TEXT, COLUMN, ROW, WIDTH, HEIGHT).'.#c
Format group_box (TEXT, COLUMN, ROW, WIDTH, HEIGHT)
Action Draws a captioned box which may be used to group
buttons.
Parameters TEXT is the caption of the group box.
COLUMN, ROW is the position of the upper left corner
of the box. The default is the current position. The
position is relative to the upper left corner of the
display area of the current display window.
WIDTH, HEIGHT is the width and height of the box. The
default width is the length of TEXT + 2. The default
height is 4.
Returns The handle of the group box.
Note The group box should only be used in dialog boxes. A
bug in Windows Version 2.1, sometimes causes the
group box to be painted incorrectly in overlapped
windows. Microsoft is aware of this problem and,
hopefully, will correct it in a future version.
//hide_window
#cenable_menu_item (?m1, &Copy).
Format is 'hide_window ({HANDLE}).'.#c
Format hide_window ({HANDLE})
Action Makes a window or a screen object invisible. Events
are still processed. No activity is visible until
the window is made visible using a show_window. When
a window is hidden all its children and everything
displayed inside it are also hidden. If the
currently active window is hidden, the last window to
be active becomes the currently active window. When
a window is hidden, it receives a lose_focus_event.
If a screen object in the window had the focus, it
also receives a lose_focus_event.
Parameters HANDLE is a handle or list of handles. The default
is the current display window.
Returns [ ]
Note If the window is already hidden, the command has no
effect.
Error I_INVALID_WINDOW
See Also #mshow_window#m, #mdisable_window#m
//horz_scroll_bar
#cenable_menu_item (?m1, &Copy).
Format is 'horz_scroll_bar ({EVENT_ TOPIC, COLUMN, ROW, WIDTH, HEIGHT, MINIMUM, MAXIMUM, EVENT_LIST}).'.#c
Format horz_scroll_bar ({EVENT_ TOPIC, COLUMN, ROW, WIDTH,
HEIGHT, MINIMUM, MAXIMUM, EVENT_LIST})
Action Creates a horizontal scroll bar in the current
display window. The scroll bar slider may be moved
with the mouse or with the cursor keys.
Parameters EVENT_TOPIC is the topic or list of topics performed
when an event on the EVENT_LIST occurs while the
focus is on the scroll bar. EVENT_TOPIC is called
as:
EVENT_TOPIC(EVENT_INFO,EVENT_NAME,HANDLE).
EVENT_INFO depends on the event that occurs. A
description of events is given in Appendix D.
EVENT_NAME is the name of the event that occurred.
HANDLE is the handle assigned to the scroll bar.
If EVENT_TOPIC sets its value to true after being
called by a lose_focus_event, close_event,
char_event, or a sys_char_event, further processing
of the event is canceled before it is executed.
Whenever EVENT_TOPIC is called its value is reset.
If no EVENT_TOPIC is defined, no events are
recognized.
COLUMN, ROW is the position of the scroll bar. The
default is the current display location. COLUMN and
ROW are relative to the display area of the current
display window.
WIDTH, HEIGHT is the width and height of the scroll
bar. The default is 20, 1.
MINIMUM, MAXIMUM is the minimum and maximum slider
values. The default is 0, 100. MINIMUM and MAXIMUM
can take on values between -32768 and 32767. If
these parameters are lists, only the first element is
used.
EVENT_LIST is a list of events that cause the
EVENT_TOPIC to be called. The events that can be
processed are:
get_focus_event, lose_focus_event, close_event
char_event, sys_char_event, scroll_event These events
are described in detail in Appendix D. If no event is
specified, the default event is a scroll_event.
Returns HANDLE, the handle of the scroll bar.
Note To get the value of a scroll bar use get_scroll_bar.
To set the position of a scroll bar use
set_scroll_pos.
See Also #mget_scroll_bar#m, #mset_scroll_bar#m,
#mvert_scroll_bar#m, #mDescription of Events#m
//horz_scroll_text
#cenable_menu_item (?m1, &Copy).
Format is 'horz_scroll_text (HANDLE,COLUMNS).'.#c
Format horz_scroll_text (HANDLE,COLUMNS)
Action Scrolls the window the appropriate number of columns.
The window does not scroll beyond the maximum length
of the text currently displayed in the window.
Parameters HANDLE is the handle of a window, or list of handles.
COLUMNS is the number of columns to scroll, negative
to scroll the window left, positive to scroll right.
If this parameter is a list, only the first element
is used.
Returns The co-ordinates of the text that appears in the
upper left corner of the window.
Errors I_INVALID_WINDOW
See Also #mvert_scroll_text#m
//hyper_display
#cenable_menu_item (?m1, &Copy).
Format is 'hyper_display (TEXTCOLOR, BACKCOLOR, FONT).'.#c
Format hyper_display (TEXTCOLOR, BACKCOLOR, FONT)
Action Sets the default color and font for hypertext
displayed with ##m.
Parameters TEXTCOLOR is the color used to display hypertext. If
this parameter is a list, only the first element is
used. If it is [ ], it is ignored. TEXTCOLOR is one
of these colors: black, blue, green, red, magenta,
cyan, yellow, white
BACKCOLOR is the background color used to display
hypertext. If this parameter is a list, only the
first element is used. If it is [ ], it is ignored.
BACKCOLOR is one of these colors: black, blue,
green, red, magenta, cyan, yellow, white
FONT is a handle of a font created with CREATE_FONT,
or one of the following strings:
OEM_FIXED_FONT - a fixed width font using the OEM
character set.
ANSI_FIXED_FONT - a fixed width font using the ANSI
character set.
ANSI_VAR_FONT - a variable width font using the ANSI
character set.
DEVICE_DEFAULT_FONT - the most appropriate font for
the specified device.
SYSTEM_FONT - the system font. If this parameter is
a list, only the first element is used. If it is [ ],
it is ignored.
Note The default color of a specific hypertext phrase can
be changed by using ##f or ##b color commands
immediately following the ##m. This overrides the
usual display. ##f and ##b are described in text. The
font cannot be reset on a case by case basis.
Errors I_INVALID_FONT
See Also #mcreate_font#m, #mtext#m
//hyper_region
#cenable_menu_item (?m1, &Copy).
Format is 'hyper_region (TOPIC, COLUMN, ROW, WIDTH, HEIGHT).'.#c
Format hyper_region (TOPIC, COLUMN, ROW, WIDTH, HEIGHT)
Action Creates a rectangular "hot-spot" in the current
display window at the specified co-ordinates. The
hot spot is selected by the user by a click of the
mouse or by pressing ENTER while the cursor is in the
defined region. When selected, TOPIC is called.
This can be used with bitmaps to create hyper-
graphics.
Parameters TOPIC is a topic or list of topics which are called
when the region is selected either by pressing the
ENTER key while the caret is in the region or by
clicking the mouse in the region. If the defined
topic is not found, then the topic MARK is called and
is passed TOPIC. If super_mark is defined, it is
called instead of TOPIC.
COLUMN, ROW is the co-ordinates of the upper left
corner of the region. If either of these parameters
are a list, only the first element is used.
WIDTH, HEIGHT is the width and height of the region.
The default is the current position. COLUMN and ROW
are relative to the upper left corner of the display
area of the current display window.
See Also #mbitmap#m, #mload_bitmap#m, #mread_clipboard#m
//icon
#cenable_menu_item (?m1, &Copy).
Format is 'icon (ICON_HANDLE, COLUMN, ROW).'.#c
Format icon (ICON_HANDLE, COLUMN, ROW)
Action Displays the icon associated with the handle at the
current screen position.
Parameters ICON_HANDLE is a handle or list of handles. The icon
handle is returned from load_icon.
COLUMN, ROW is the position of the upper left corner
of the icon. COLUMN and ROW are relative to the upper
left corner of the display area of the current
display window.
Errors I_NOT_ICON
Note Get the ICON_HANDLE from load_icon.
See Also #mdelete_icon#m, #micon#m, #mload_icon#m,
#mattach_icon#m, #mset_focus#m
//im_a
#cenable_menu_item (?m1, &Copy).
Format is 'im_a (TOPIC, PARAMETERS).'.#c
Format im_a (TOPIC, PARAMETERS)
Action im_a copies the sub-topic structure of TOPIC into
the current topic. If a sub-topic of the
current_topic has the same name as a sub-topic of
TOPIC, that sub-topic is not copied. All other sub-
topics with their values and properties are copied,
PARAMETERS are passed and the commands are executed.
After the commands have finished executing, control
returns to the command after the im_a. The
effect of im_a is that TOPIC is performed as if
it resides in the current topic so any local topics
created by TOPIC are local to the current topic.
In the terms of object-oriented programming, im_a
makes the current topic a sub-class of TOPIC.
Parameters TOPIC a topic name or list of topic names.
PARAMETERS a list of parameters to be passed to
TOPIC.
Returns [ ]
Errors I_V_TOPIC_NOT_FOUND
See Also #mdo_local#m, #mnew#m
//intersect
#cenable_menu_item (?m1, &Copy).
Format is 'intersect (LIST1, LIST2 {, LIST3 ...}).'.#c
Format intersect (LIST1, LIST2 {, LIST3 ...})
Action Creates a list which contains the common items in
several lists. The resulting list contains no
duplicates.
Parameters LIST1, LIST2, {LIST3 ... } are the lists of items to
be checked for common members.
Returns All of the items that appear on each of the lists
of items.
See Also #mdifferent#m, #msublist#m
//is
#cenable_menu_item (?m1, &Copy).
Format is 'TOPIC is VALUES.'.#c
Format TOPIC is VALUES
Alternate make (TOPIC, VALUES)
Action Sets the value of the topic or topics to the VALUES
named. The old value of the topic is lost.
Parameters TOPIC is an expression that evaluates to a topic or
a list of topics. If a topic name is not found it is
created.
VALUES contains the list of VALUES assigned as the
current value of the specified topics.
Errors I_READ_ONLY_TOPIC, I_TOO_MANY_VALUES
See Also #mgets#m, #mgets_c#m, #mis_c#m
//is_c
#cenable_menu_item (?m1, &Copy).
Format is 'TOPIC is_c VALUES.'.#c
Format TOPIC is_c VALUES
Alternate make_c (TOPIC, VALUES)
Action Assigns each element of VALUES to the corresponding
topic from TOPIC. The list TOPIC is flattened to an
unnested list of names before assignment takes place.
Elements from VALUES which do not have a
corresponding topic in the list TOPIC are ignored.
Topics which do not have a corresponding element in
VALUES are assigned [ ].
Parameters TOPIC is an expression that evaluates to a topic or
a list of topics. If a topic name is not found it is
created.
ITEMS contains the list of items assigned as the
current value of the corresponding topics.
Errors I_READ_ONLY_TOPIC, I_TOO_MANY_VALUES
See Also #mgets#m, #mgets_c#m, #mis#m
//last
#cenable_menu_item (?m1, &Copy).
Format is 'last (LIST).'.#c
Format last (LIST)
Action Retrieves the last item from a list. The last
element of an empty list is [ ].
Parameters LIST is the list of items.
Returns The last item on the specified list.
See Also #melement#m, #mfirst#m, #mrest#m
//list_box
#cenable_menu_item (?m1, &Copy).
Format is 'list_box (LIST, {EVENT_TOPIC, COLUMN, ROW, WIDTH, HEIGHT, MULTISELECT, SORTED, EVENT_LIST}).'.#c
Format list_box (LIST, {EVENT_TOPIC, COLUMN, ROW, WIDTH,
HEIGHT, MULTISELECT, SORTED, EVENT_LIST})
Action A list box is created at COLUMN, ROW in the current
display window. If an EVENT_LIST is specified,
EVENT_TOPIC is called whenever the selected events
occur while the focus is on the list box.
Parameters LIST is the list of items to appear in the list box
EVENT_TOPIC is the topic or list of topics performed
when an event on the EVENT_LIST occurs while the
focus is on the list box. EVENT_TOPIC is called as:
EVENT_TOPIC (EVENT_INFO,EVENT_NAME,HANDLE)
EVENT_INFO depends on the event that occurs. A
description of events is shown provided in Appendix
D.
EVENT_NAME is the name of the event that occurred.
HANDLE is the handle assigned to the list box.
If EVENT_TOPIC sets its value to true after being
called by a lose_focus_event, close_event,
char_event, or a sys_char_event, the event is
canceled before it is executed. Whenever
EVENT_TOPIC is called its value is reset. If no
EVENT_TOPIC is defined, no events are recognized.
COLUMN, ROW is the list box location. The default
position is the current position. COLUMN and ROW are
relative to the upper left corner of the display area
of the current display window.
WIDTH, HEIGHT is the size of the list box. The
default makes the list box wide enough to fit the
longest list item and high enough to fit the number
of list items up to a maximum of 7 items. Scroll
bars let you scroll through items not visible on the
list.
MULTISELECT is a boolean value that defines whether
one or several items can be selected from the list
box. The default is false which makes a single
selection list box.
SORTED is a boolean that specifies whether the items
in the list box are sorted alphabetically. The
default is false.
EVENT_LIST is a list of events that causes the
EVENT_TOPIC to be called. The events that can be
processed are:
get_focus_event, lose_focus_event, close_event
char_event, sys_char_event, list_select_event
double_click_event These events are described in
detail in Appendix D. If no event is specified, the
default event is a double_click_event.
Returns HANDLE, the handle of the list box.
Note To get the value of the items selected in a list box
use get_list_box. To get a list of all the items in
the list box use get_text. To change the items in a
list box use set_text.
See Also #mask#m, #mget_list_box#m, #mget_text#m,
#mset_text#m, #mDescription of Events#m
//list_length
#cenable_menu_item (?m1, &Copy).
Format is 'list_length (LIST) .'.#c
Format list_length (LIST)
Action Determines the number of items on a list.
Parameters LIST is the list whose length you are trying to
determine.
Returns An integer that specifies the number of items on the
list.
//list_of_char
#cenable_menu_item (?m1, &Copy).
Format is 'list_of_char (TEXT) .'.#c
Format list_of_char (TEXT)
Action Create a list of characters from a string of text.
Parameters TEXT is the string to be turned into a list.
Returns A list made up of each individual character in the
words contained in TEXT. If TEXT is empty, [ ] is
returned. If TEXT is a list, a list of the characters
of each element is returned.
See Also #mstring_to_list#m
//list_to_string
#cenable_menu_item (?m1, &Copy).
Format is 'list_to_string (LIST {,DELIMITER, LEFT_BRACKET, RIGHT_BRACKET, QUOTE}).'.#c
Format list_to_string (LIST {,DELIMITER, LEFT_BRACKET,
RIGHT_BRACKET, QUOTE})
Action A string is created that contains each of the list
items separated by the character selected by
DELIMITER The characters specified in LEFT_BRACKET
are attached to the front of the string and those in
RIGHT_BRACKET are added to the end of a string. List
items with embedded spaces can be automatically
enclosed with a quote character if desired. LIST
itself is not changed.
Parameters LIST is the item or list of items to be converted to
a string.
DELIMITER is a string or list of strings which are
used to separate what was the individual list items.
The default is the empty string.
LEFT_BRACKET is a string or list of strings which are
placed in front of each list and sublist. The
default is the empty string.
RIGHT_BRACKET is a string or list of strings which
are placed after each list and sublist. The default
is the empty string.
QUOTE string or list of strings which are placed
around each list item. The default is the empty
string.
Returns The string that is created from the specified list.
See Also #mstring_to_list#m, #mlist_of_char#m
//load
#cenable_menu_item (?m1, &Copy).
Format is 'load (KB_FILE{,TOPIC}).'.#c
Format load (KB_FILE{,TOPIC})
Action Reads a knowledge base or list of knowledge
bases. The topics in the new knowledge base become
the children of TOPIC and the commands are attached
to the end of TOPIC's commands. If the second
parameter is not specified, the knowledge base is
loaded into the topic containing the load and the new
topics can become sub-topics of the current topic and
the commands are attached to the end of the current
topic's commands.
Parameters KB_FILE the name of a file or a list of files that
contains the knowledge base to be loaded. The file
name may be any legitimate DOS file name and may
contain drive and path information. If a path is
not supplied, the default directory is used. If
an extension is not supplied, KnowledgePro
first searches for a compiled knowledge base,
KB_FILE. CKB. If that knowledge base cannot be found,
KB_FILE.KB is compiled and loaded . If both files
exist, the file with the most recent time and date
stamp are used.
TOPIC is an optional parameter that allows you to
load the new knowledge base into a specified topic.
If this parameter is missing, the knowledge base is
loaded into the current topic. If TOPIC does not
exist, it is created and the knowledge base
contained in KB_FILE is loaded into it.
Returns T if the knowledge base was loaded properly otherwise
F.
Errors F_NO_NAME, I_CANT_OPEN, I_CANT_READ
Loading a source knowledge base may result in
compiler errors. Source knowledge bases cannot be
loaded by the runtime version of KnowledgePro.
See Also #mnew_kb#m, #msave_topic#m
//load_bitmap
#cenable_menu_item (?m1, &Copy).
Format is 'load_bitmap (FILE).'.#c
Format load_bitmap (FILE)
Parameters FILE is a file or list of files containing a bitmap
Action Reads a file containing a bitmap and creates a bitmap
in memory.
Returns BITMAP_HANDLE, the bitmap handle or list of bitmap
handles if FILE is a list.
Note When a bitmap is no longer needed, be sure to delete
it to recover its memory. Don't delete any bitmap
that is in a currently displayed window.
KnowledgePro requires the bitmap handle to repaint a
window containing a bitmap.
Errors I_NOT_BITMAP, I_CANT_OPEN_BITMAP, F_FILE_NOT_FOUND,
I_BITMAP_NO_MEM, I_CANT_READ
See Also #mbitmap#m, #mbitmap_to_clipboard#m,
#mcreate_bitmap#m, #mdelete_bitmap#m,
#mread_clipboard#m
//load_icon
#cenable_menu_item (?m1, &Copy).
Format is 'load_icon (FILE_NAME).'.#c
Format load_icon (FILE_NAME)
Action The icon in FILE_NAME is loaded into memory.
Parameters FILE_NAME the name of a file containing a valid icon
or list of files. The file name may also be one of
the following special icons:
ASTERISK_ICON an asterisk, used in informative
messages
EXCLAMATION_ICON an exclamation point, used in
warning messages
HAND_ICON a hand shaped icon, used in serious warning
messages
QUESTION_ICON a question mark, used in prompts.
Returns ICON_HANDLE, the icon handle.
Note Icon files can be created with programs such as
ICONEDIT, and ZSoft's Paintbrush for Windows. Be
sure to delete the icon after the window containing
it has been closed. This frees memory.
Errors F_FILE_NOT_FOUND, I_NOT_ICON, I_CANT_READ,
I_CANT_OPEN
See Also #mdelete_icon#m, #micon#m, #mattach_icon#m
//load_library
#cenable_menu_item (?m1, &Copy).
Format is 'load_library (FILE_NAME).'.#c
Format load_library (FILE_NAME)
Action Loads the DLL into memory. If the DLL is already in
memory, its use count is incremented.
Parameters FILE_NAME is a name or list of names of dynamic link
library (DLL) files.
Returns DLL_HANDLE, the handle of the library.
Note A DLL must be loaded before any of its functions can
be called with the user command.
Errors I_CANT_OPEN, I_INVALID_LIBRARY
See Also #mfree_library#m, #muser#m
//load_program
#cenable_menu_item (?m1, &Copy).
Format is 'load_program (PROGRAM{,SHOW_CODE}).'.#c
Format load_program (PROGRAM{,SHOW_CODE})
Action Loads the program into memory and continues execution
of the knowledge base. The loaded program is not
executed until there are no more topics to be called
or a wait is called. Under Windows 286, a program
can only run if its window is visible and not
minimized.
Parameters PROGRAM is the name of a program and its command line
parameters or list of programs and command lines. If
the program name does not contain a path, run
automatically searches the DOS PATH if the program is
not in the current directory. If the program name
does not contain an extension, .EXE is assumed.
SHOW_CODE describes how the window that contains the
application appears and whether it becomes the
currently active window. The codes are:
Display Active Window Code
Normal Yes 1
Normal No 4
Minimized Yes 2
Minimized No 7
Maximized Yes 3
Hidden No 0
The default loads the application as an icon that is
not the active window (Code 7).
Returns The task handle of the program loaded or an error
code. Error codes are always less than 32. The error
codes are:
2 Program not found.
16 The program name was invalid.
17 The command line is greater than 80 characters.
Note It is best to run a .PIF file for DOS applications.
This gives you control over memory, program switches
etc. The error code returned is the code returned by
the Windows program loader. It is usually 0, so there
is no reliable way to tell if the program has
actually executed. Windows does not return program
exit codes to KnowledgePro. Under Windows/286, the
screen may turn black when executing a DOS
application. Under Windows/386, it is possible to
execute a DOS program as an icon by setting the .PIF
file to run in background.
When a program is loaded, it is assigned a task
handle which is returned by load_program. Once you
have the task handle you can use it to get the window
handle of the task. For example:
task is load_program ('NOTEPAD.EXE').
ProgramWindow is task_windows (?task).
Using this handle, you have full control of how and
where any application is displayed on the screen.
Errors I_EXT_STRING_LONG, I_NO_TIMERS
See Also #mrun#m, #mtask_list#m, #mtask_windows#m
//lower
#cenable_menu_item (?m1, &Copy).
Format is 'lower (TEXT).'.#c
Format lower (TEXT)
Action Create a string of text by converting a string or a
list of strings to lower case. TEXT itself is not
changed.
Parameters TEXT is a text string or list of strings.
Returns The strings with characters in the range A to Z
converted to the range a to z.
See Also #mupper#m
//make
#cenable_menu_item (?m1, &Copy).
Format is 'make (TOPIC, VALUES).'.#c
Format make (TOPIC, VALUES)
Alternate TOPIC = VALUES TOPIC is VALUES
Action Sets the value of the topic or topics to the VALUES
named. The old value of the topic is lost.
Parameters TOPIC is an expression that evaluates to a topic or
a list of topics. If a topic name is not found it is
created.
VALUES contains the list of VALUES assigned as the
current value of the specified topics.
Errors I_READ_ONLY_TOPIC, I_TOO_MANY_VALUES
See Also #mgets#m, #mgets_c#m, #mmake_c#m
//make_c
#cenable_menu_item (?m1, &Copy).
Format is 'make_c (TOPIC, VALUES).'.#c
Format make_c (TOPIC, VALUES)
Alternate TOPIC is_c VALUES
Action Assigns each element of VALUES to the corresponding
topic from TOPIC. The list TOPIC is flattened to an
unnested list of names before assignment takes place.
Elements from VALUES which do not have a
corresponding topic in the list TOPIC are ignored.
Topics which do not have a corresponding element in
VALUES are assigned [ ].
Parameters TOPIC is an expression that evaluates to a topic or
a list of topics. If a topic name is not found it is
created.
ITEMS contains the list of items assigned as the
current value of the corresponding topics.
Errors I_READ_ONLY_TOPIC, I_TOO_MANY_VALUES
See Also #mgets#m, #mgets_c#m, #mmake#m
//make_modal
#cenable_menu_item (?m1, &Copy).
Format is 'make_modal (HANDLE).'.#c
Format make_modal (HANDLE)
Action Causes the window identified by HANDLE to become the
only window that accepts input. All other windows are
disabled and do not accept mouse or keyboard input.
Modal windows are frequently used for error messages
or whenever you want to force the user to respond to
the window before taking any other action.
Parameters HANDLE is the handle of a display or edit window. If
this parameter is a list, only the first element is
used.
Errors I_INVALID_WINDOW
Note In Microsoft Windows, the usual convention is to use
a dialog frame on a modal window.
See Also #mdisable_window#m, #menable_window#m
//make_topic_list
#cenable_menu_item (?m1, &Copy).
Format is 'make_topic_list ( ).'.#c
Format make_topic_list ( )
Action Opens a window and displays the topics in a vertical
list, using indentation to show the topic hierarchy.
When a topic is selected with the mouse or keyboard,
the topic show_topic is automatically called and is
passed the name of the selected topic as a parameter.
This shows an expanded view of the topics' commands,
children, values and properties.
See Also #mshow_topic#m
//memory
#cenable_menu_item (?m1, &Copy).
Format is 'memory ( ).'.#c
Format memory ( )
Action Finds the amount of free memory.
Returns The number of free bytes. This is the total remaining
memory available to the knowledge base. It is not
necessarily contiguous.
Note memory ( ) returns the total amount of memory
available on its internal list of free memory plus
the size of the largest segment that Windows can make
available to it. The total amount of free memory may
be greater due to fragmentation of Windows' memory
and "garbage" in KnowledgePro's internal memory.
See Also #mcollect#m, #mcollect_ok#m, #mcollect_not_ok#m
//menu
#cenable_menu_item (?m1, &Copy).
Format is 'menu (MENU_LIST, EVENT_TOPIC).'.#c
Format menu (MENU_LIST, EVENT_TOPIC)
Action Creates a menu in the current window with the items
in MENU_LIST as the options on the menu. When an
option is selected from the menu, EVENT_TOPIC is
called as
EVENT_TOPIC (OPTION, HANDLE).
where HANDLE is the handle of the window containing
the menu and OPTION is the item selected from the
menu. No event name is passed since the only event
that is recognized is a select_event.
Parameters MENU_LIST is a list of options for the menu. If the
list contains sublists, the first item appears on the
menu bar and the rest of the sublist become options
on a submenu. If MENU_LIST is [ ], the menu is
removed from the window.
EVENT_TOPIC the topic or list of topics invoked when
an item is selected from the menu. Unlike the other
screen objects, a menu only recognizes a select_event
which occurs when a menu item is selected.
Returns The handle of the menu.
Note An & in a menu option means that the character
following is underlined. A value of [ ] used as a
sub-menu item draws a line across the sub-menu.
Error I_INVALID_WINDOW
See Also #mcheck_menu_item#m, #mdisable_menu_item#m,
#menable_menu_item#m, #muncheck_menu_item#m
//move_window
#cenable_menu_item (?m1, &Copy).
Format is 'move_window ({HANDLE}, COLUMN, ROW).'.#c
Format move_window ({HANDLE}, COLUMN, ROW)
Action Displays the window at the new position. When a
window is moved it moved it receives a move_event.
Parameters HANDLE is the handle of a window or a list of
handles. The default is the current display window.
COLUMN, ROW is the new co-ordinates of the upper left
corner of the window. For child windows and screen
objects, this is relative to the upper left corner of
the parent window's display area. For popup and
overlapped windows, COLUMN and ROW are relative to
the upper left corner of the screen.
Errors I_INVALID_WINDOW
See Also #mresize_window#m, #mshow_window#m
//neg
#cenable_menu_item (?m1, &Copy).
Format is 'neg (NUMBER) .'.#c
Format neg (NUMBER)
Alternate -NUMBER
Action Form the negative of a number. The negation
operation is represented internally as neg (NUMBER).
Parameters NUMBER is a number.
Returns The negative value of the specified number. It
returns 0 if number is non-numeric. If number is a
list, it returns a list containing the negative of
each number.
//new
#cenable_menu_item (?m1, &Copy).
Format is 'new (NEW_TOPIC, CLASS_TOPIC, PARAMETERS).'.#c
Format new (NEW_TOPIC, CLASS_TOPIC, PARAMETERS)
Action new creates a new topic with the name NEW_TOPIC,
copies all the sub-topics of CLASS_TOPIC into
NEW_TOPIC and then executes all of the commands
attached to CLASS_TOPIC as if they exist in
NEW_TOPIC. This is done by calling
im_a (CLASS_TOPIC, PARAMETERS)
with NEW_TOPIC as the current topic. NEW_TOPIC is
a sub-class of CLASS_TOPIC.
Parameters NEW_TOPIC is the name of a topic or list of topics to
be created.
CLASS_TOPIC is the name of an existing topic. It may
also be a list of topic names.
PARAMETERS is a list of values to be passed to im_a
along with CLASS_TOPIC. These values are used in
initializing NEW_TOPIC.
Errors new calls im_a which can generate its own
I_V_TOPIC_NOT_FOUND error
See Also #mim_a#m, #mdo_local#m, #mclass#m
//new_file
#cenable_menu_item (?m1, &Copy).
Format is 'new_file (FILE).'.#c
Format new_file (FILE)
Action If the file or list of files named does not exist, it
is created and opened. If the file does exist, the
file pointer is positioned at the beginning of the
file and all existing data is lost.
Parameters FILE is the name of a file or a list of files to be
opened. Remember that any name which contains a
period must be enclosed in single quotes.
Errors I_CANT_OPEN
See Also #mclose#m, #mclose_all#m
//new_kb
#cenable_menu_item (?m1, &Copy).
Format is 'new_kb (KB_FILE) .'.#c
Format new_kb (KB_FILE)
Action This topic runs a new knowledge base. This topic is
different from load in that the new knowledge
base completely overwrites the current application.
Parameters KB_FILE must be the name of a file that contains
either a knowledge base or a compiled knowledge base.
If no suffix is used, the suffix .CKB is added. If
you are running the development version and no .CKB
file is found, the system looks for a .KB file which
is compiled and run. If both a .CKB and a .KB file
is found, the one with the latest time and date stamp
is used.
Returns Normally doesn't return. Returns [ ] if KB_FILE
can't be found.
Errors F_NO_NAME, I_CANT_OPEN
See Also #mload#m
//not
#cenable_menu_item (?m1, &Copy).
Format is 'not (BOOLEAN).'.#c
Format not (BOOLEAN)
Action Perform a not operation on each element of a
list of booleans .
Parameters BOOLEAN is a single boolean value or a list of
boolean values. For boolean values, TRUE, T or Yes
is treated as true, anything else is treated as
false.
Returns The boolean list with each element changed to its
logical complement.
//number_to_char
#cenable_menu_item (?m1, &Copy).
Format is 'number_to_char (INTEGER).'.#c
Format number_to_char (INTEGER)
Action Converts a number to its equivalent ASCII character
value.
Parameters INTEGER is a number or list of numbers.
Returns The ASCII character value of INTEGER MOD 256. If
INTEGER is a list, a list of characters is returned.
See Also #mchar_to_number#m
//numeric_sort
#cenable_menu_item (?m1, &Copy).
Format is 'numeric_sort (LIST, ORDER).'.#c
Format numeric_sort (LIST, ORDER)
Action Create a sorted list by comparing the numerical
values of the elements of LIST. Non-numerical values
are treated as 0. LIST itself is not changed.
Parameters LIST is a list of elements to be sorted. LIST is
flattened before sorting.
ORDER is a string, that specifies the order in which
the list is sorted. To sort in ascending order ORDER
should be either ASCENDING or UP. For descending
order, DESCENDING or DOWN. The default is
ASCENDING.
Returns The sorted list. The value of ORDER determines
whether the list is ascending or descending.
Note The longest list that can be sorted contains 16384
elements.
Errors I_LIST_TOO_LONG
See Also #msort#m
//one_of
#cenable_menu_item (?m1, &Copy).
Format is 'one_of (LIST, VALUES).'.#c
Format one_of (LIST, VALUES)
Action This topic is used to check if each element of
VALUES is an element of LIST.
Parameters LIST is the list to be checked.
VALUES are the VALUES to be searched for in LIST.
Returns T if each element of VALUES is contained in LIST,
otherwise F is returned.
//or
#cenable_menu_item (?m1, &Copy).
Format is 'or (BOOLEAN1, BOOLEAN2).'.#c
Format or (BOOLEAN1, BOOLEAN2)
Alternate BOOLEAN1 or BOOLEAN2
Action This is most commonly used to combine conditional
statements within a rule. The two boolean values are
ored to produce the resulting value. Lists are ored
item by item. Any element ored with a value of [ ]
yields the value of that item. The values T, True
and Yes are treated as a boolean value of true,
anything else is treated as false.
Parameters BOOLEAN1, BOOLEAN2 are single boolean values, lists
of boolean values or expressions that evaluate to
either of these.
Returns A boolean value or a list of boolean values that
is the result of oring the two lists of booleans.
or returns T if either or both elements are T
and F otherwise.
Note When or is used as an infix operator (between two
boolean expressions) the second expression is not
evaluated if the first expression evaluates to
true. The condition in the above example would be
represented internally as:
[or [eq,?type_of_stock, common], [delay
[eq,?bond_selected,municipal]]].
delay is used to prevent evaluation until the
first boolean expression is evaluated.
//parent
#cenable_menu_item (?m1, &Copy).
Format is 'parent (TOPIC).'.#c
Format parent (TOPIC)
Action Returns the name of the TOPIC 's parent. If a list
of topics is specified, a list containing the
parents of each topic is returned.
Parameters TOPIC is the name of one or more topics whose
parents you want to find. If TOPIC is absent,
the default is the current topic.
Returns The parent of the specified topic or a list of
parents. If a TOPIC does not exist, [ ] is
returned. The parent of !main is [ ].
See Also #mcalling_topic#m, #mchild#m, #mfull_name#m,
#mmake_topic_list#m
//parent_window
#cenable_menu_item (?m1, &Copy).
Format is 'parent_window (HANDLE).'.#c
Format parent_window (HANDLE)
Action Finds the parent of a window or screen object.
Parameters HANDLE is a handle or list of handles. The default is
the currently active window.
Returns The handle of the parent of the window whose handle
is passed. If HANDLE is a list, a list of parent
handles is returned. If the window has no parent, [ ]
is returned.
Errors I_INVALID_WINDOW
See Also #mchild_window#m, #mwindow_info#m
//perform
#cenable_menu_item (?m1, &Copy).
Format is 'perform (LIST).'.#c
Format perform (LIST)
Action This topic can be used to directly execute
topics expressed as strings of text. The strings are
compiled and then executed.
Parameters LIST is a list of strings which are legal
KnowledgePro commands to be performed. Note that any
single quotes appearing within the topics must be
written as two single quotes within the text string.
For example, the topic
say ('Hello there').
is written as a text string:
'say (''Hello there'').'
Returns A list made up of the results returned by each of the
command lines performed. If a line cannot be
correctly performed, an error message is displayed.
Note perform is not supported in the runtime version of
KnowledgePro.
Error I_CANT_CREATE_TEMP_FILE
Invalid commands may generate compiler errors.
See Also #mcompile#m, #mevaluate#m, #mget_procedures#m,
#mset_procedures#m
//primitive
#cenable_menu_item (?m1, &Copy).
Format is 'primitive (FUNCTION).'.#c
Format primitive (FUNCTION)
Alternate ~FUNCTION
Action Calls the internal system topic, even if a topic of
the same name is defined.
Parameters FUNCTION is the name of a KnowledgePro functions.
Returns The result of evaluating the named function.
Errors I_TOPIC_NOT_FOUND
//print
#cenable_menu_item (?m1, &Copy).
Format is 'print (TEXT).'.#c
Format print (TEXT)
Action Prints text to the printer using the print spooler if
it is installed. Output is sent to the system's list
device. This is typically the line printer. A
dialog box is displayed to allow the user to cancel
the output. A form feed is generated after each
print.
Parameters TEXT is the lists of items to write to the printer.
The text may include embedded control codes. The
following codes are available:
##n start a new line
##p start a new page
##l put each list item on a new line (default)
##s put each list item on the same line
##o no spaces after a list item
##i insert a space after each list item (default)
##t tab five spaces
#### print the character ##
##xINTEGER begin printing at column INTEGER
##yINTEGER begin printing at row INTEGER
##gHANDLE display a bitmap. HANDLE is the handle
returned by load_bitmap
##INTEGER print the ASCII character of INTEGER
##cTEXT##c TEXT is compiled and evaluated
##vTEXT##v TEXT is compiled, evaluated and any value
returned is displayed
Errors I_PRINT_NO_DC, I_PRINT_GEN_ERROR, I_PRINT_ABORT,
I_PRINT_USER_ABORT, I_PRINT_OUT_OF_DISK,
I_PRINT_OUT_OF_MEMORY, I_NOT_BITMAP
See Also #mwrite#m
//radio_button
#cenable_menu_item (?m1, &Copy).
Format is 'radio_button (RADIO_LIST, {EVENT_TOPIC, EVENT_LIST}) .'.#c
Format radio_button (RADIO_LIST, {EVENT_TOPIC, EVENT_LIST})
Action A set of radio buttons are created in the current
display window.
Parameters RADIO_LIST a list of radio button descriptions. Each
description is a list [RADIO_TEXT, COLUMN, ROW,
SELECTED ] where
RADIO_TEXT is the text appearing with the radio
button.
COLUMN, ROW is the radio button location. The default
is the current position. COLUMN and ROW are relative
to the upper left corner of the display area of the
current display window.
SELECTED is a boolean value. If true, the radio
button is checked. The default is false.
EVENT_TOPIC is the topic or list of topics performed
when an event on the EVENT_LIST occurs while the
focus is on a radio button. EVENT_TOPIC is called
as:
EVENT_TOPIC(EVENT_INFO,EVENT_NAME,HANDLE).
EVENT_INFO depends on the event that occurs. A
description of events is provided in Appendix D.
EVENT_NAME is the name of the event that occurred.
HANDLE is the handle assigned to the radio button.
If EVENT_TOPIC sets its value to true after being
called by a lose_focus_event, close_event,
char_event, or a sys_char_event, further processing
of the event is canceled before it is executed.
Whenever EVENT_TOPIC is called its value is reset.
If no EVENT_TOPIC is defined, no events are
recognized.
EVENT_LIST is a list of events that will cause the
EVENT_TOPIC to be called. The events that can be
processed are:
get_focus_event, lose_focus_event, close_event
char_event, sys_char_event, select_event These events
are described in detail in Appendix D. If no event is
specified, the default event is a select_event.
Note To get the values of the group of radio buttons
created by radio_button, use get_radio_button. To
get the text of one of the buttons use get_text. To
change the text use set_text.
See Also #mget_radio_button#m, #mget_text#m,
#mset_radio_button#m, #mset_text#m, #mDescription of Events#m
//read
#cenable_menu_item (?m1, &Copy).
Format is 'read (FILE {,START_TEXT, END_TEXT, SEARCH, REPLACE}).'.#c
Format read (FILE {,START_TEXT, END_TEXT, SEARCH, REPLACE})
Action Reads an entire text file, a specified portion of a
file or a part of a file that contains a specified
search string. The search string can also be
replaced. The text read is returned as a list of
lines. After text is read, the file pointer is
located immediately following the text returned.
Parameters FILE is the name of the file or list of files to be
read.
START_TEXT is a a string. The file is searched
until START_TEXT is found in the file. The text in
the file which follows START_TEXT up to END_TEXT is
the selected text. The default starting location is
at the current file location.
END_TEXT is a string. The text starting at
START_TEXT appearing up to but not including END_TEXT
is the selected text. The default is the end of the
file.
SEARCH is a string that is searched for in the
selected text START_TEXT and END_TEXT. If the search
string is found in the text, all text between
START_TEXT and END_TEXT is returned. If the search
string does not appear in the delimited text, no text
is returned by the read. If SEARCH is [ ], all the
text between START_TEXT and END_TEXT is returned.
The default is [ ].
REPLACE is a string which replaces each occurrence of
SEARCH in the text returned.
Returns A list containing the text read from the file. If
the file cannot be found, or the file pointer is at
the end of the file, an end of file character (ASCII
26) is returned.
Note When a file is first opened to be read, the file
pointer is at the beginning of the file. When a
portion of a file is read, the file pointer is moved
to the first character following the text returned by
read. If you want the next read to start at the
beginning of the file, you must call the topic close
before the next read is called or reset the file
pointer using set_file_pos.
The character ##n can be used in a read topic to
signify an end of line. For example:
read (TEST,,##n##n)
reads a file TEST from the current file pointer to
the first blank line.
Errors I_CANT_OPEN
See Also #mclose#m, #mclose_all#m, #mfile_menu#m,
#mnew_file#m, #mread_char#m, #mread_line#m
//read_char
#cenable_menu_item (?m1, &Copy).
Format is 'read_char (FILE {,COUNT}) .'.#c
Format read_char (FILE {,COUNT})
Action Reads COUNT characters from a file.
Parameters FILE is the name of the file or list of files to be
read.
COUNT is the number of characters to read. It must
be in the range 1 to 65535. The default is 1. If
this parameter is a list, the first element is used.
Returns The next COUNT characters from the file are returned.
If the file does not exist or you are attempting to
read beyond the last character of the file, an end
of file character (ASCII 26) is returned. The first
command using read_char reads the first characters
from the file. The subsequent use of read_char reads
sequential characters and advances the file pointer.
To reset the file pointer to the beginning of the
file, close the file and then re-read it or use
set_file_pos to reset the file pointer.
Errors I_CANT_OPEN I_INVALID_COUNT
See Also #mclose#m, #mclose_all#m, #mfile_menu#m,
#mnew_file#m, #mread#m, #mread_line#m
//read_clipboard
#cenable_menu_item (?m1, &Copy).
Format is 'read_clipboard ( ).'.#c
Format read_clipboard ( )
Action Reads data from the clipboard. Data may be pasted
from another application or may be placed there with
the text_to_clipboard topic.
Returns A list whose first element is the data read from the
clipboard and second element is a flag which
describes the format of the data returned. If a flag
of 0 is returned, the data is a text string. If the
flag is 1, the data is a handle to a bitmap. If the
clipboard is empty, [ ] is returned.
Text is stored as a single string that must be less
than 64K. The text may contain carriage return line
feed pairs to delimit lines.
Errors I_BAD_CLPBD_DATA
the data in the clipboard could not be read.
I_CANT_OPEN_BITMAP
unable to copy the bitmap data
See Also #mbitmap_to_clipboard#m, #mtext_to_clipboard#m
//read_line
#cenable_menu_item (?m1, &Copy).
Format is 'read_line (FILE {,COUNT}).'.#c
Format read_line (FILE {,COUNT})
Action Reads the next COUNT lines from a file.
Parameters FILE is the name of the file or list of files to be
read.
COUNT is the number of lines to read.
Returns The next COUNT lines from the file are returned as a
list of lines. If the file does not exist or you are
attempting to read beyond the last character of the
file, an end of file character (ASCII 26), is
returned. The first command using read_line reads
the first lines from the file. Subsequent commands
using read_line read sequential lines and
advance the file pointer. To reset the file
pointer to the beginning of the file, close the
file and then re-read it or use set_file_pos to
reset the file pointer. A line is a string of
characters followed by a carriage return linefeed
pair. The carriage return, linefeed are not
returned.
Errors I_CANT_OPEN I_INVALID_COUNT
See Also #mclose#m, #mclose_all#m, #mfile_menu#m,
#mnew_file#m, #mread#m, #mread_char#m
//read_response
#cenable_menu_item (?m1, &Copy).
Format is 'read_response ({QUESTION, TOPIC, DEFAULT_TEXT }).'.#c
Format read_response ({QUESTION, TOPIC, DEFAULT_TEXT })
Action Places a question and an edit line on the screen and
waits for the user to type in an answer. This is
similar to ask except that the screen is not
cleared and a list box is not provided. The edit line
is placed immediately following the question, and an
optional default answer may be supplied. The user's
response remains on the screen.
Parameters QUESTION is the question that appears on the screen
as a prompt for the user.
TOPIC is the topic or list of topics where the answer
is saved. If no TOPIC is named, the answer is
assigned to the current topic.
DEFAULT_TEXT is a default answer. If the user
presses ENTER, the default is selected. This answer
may be edited using the keyboard editing keys. The
following control codes can be embedded within the
text of QUESTION to control the display of
information on the screen :
##n start a new line
##p start a new page
##e erase the contents of the window
##l put each list item on a new line (default)
##s put each list item on the same line
##o no spaces after a list item
##i insert a space after each list item (default)
##t tab five spaces
##m begin or end marked text
##w wait for user input
#### display the character ##
##INTEGER print the ASCII character
##xINTEGER move to column INTEGER
##yINTEGER move to row INTEGER
##gHANDLE display a bitmap. HANDLE is the handle
returned.
##fCOLOR change foreground color to COLOR
##bCOLOR change background color to COLOR
##d return to default colors
##cTEXT##c TEXT is compiled and evaluated
##vTEXT##v TEXT is compiled, evaluated and any value
returned is displayed
See Section 3.5 for information on using control
codes.
The following colors may be placed after the ##f and
##b:
black, blue, green, cyan, red, magenta,
yellow, white At least one blank space must follow
the name of the color.
Returns The user's response.
See Also #mask#m, #medit_line#m
//remove
#cenable_menu_item (?m1, &Copy).
Format is 'remove (LIST, VALUES) .'.#c
Format remove (LIST, VALUES)
Action This topic is used to create a new list which is made
of LIST with VALUES removed. LIST itself is not
changed.
Parameters LIST is the list from which the items are removed.
VALUES are the VALUES which are removed. Each
element of VALUES is removed from LIST.
Returns A list formed by the remaining items of LIST is
returned. Elements of VALUES which cannot be found
on LIST are ignored.
Note Each element of VALUES is removed from LIST. In order
to remove a sublist, the element being removed
must be a sublist. For example, to remove the
sublist [b,c ] from the list [a , [ b , c ] , d ] :
z = remove([a,[b,c],d],[[b,c]]).
In this case, the value of z is [a , d ] . In the
expression
y = remove ([a,[b,c],d],[b,c]).
y is given the value [a,[b,c],d] . KnowledgePro
attempts to first remove b from the first list and
does not find a match. Similarly, it is unable to
find a match for c. To remove every occurrence of an
item use replace and replace the item with the empty
list, [].
See Also #mremove_elements#m, #mreplace#m,
#mreplace_elements#m
//remove_topic
#cenable_menu_item (?m1, &Copy).
Format is 'remove_topic (TOPIC) .'.#c
Format remove_topic (TOPIC)
Action Erases the specified topic or topics from the
knowledge base. The memory used by the released
topics is made available for use by the knowledge
base.
Parameters TOPIC names the topic or topics you want to remove
from memory. All children of TOPIC are also
removed. If TOPIC cannot be found, the topic is
ignored.
Note You should not remove any of the topics that begin
with !. These topics are created by KnowledgePro as
the knowledge base runs.
Errors I_REMOVE_CURRENT_TOPIC I_REMOVE_MAIN_TOPIC
//repeat
#cenable_menu_item (?m1, &Copy).
Format is 'repeat (COMMANDS, CONDITION).'.#c
Format repeat (COMMANDS, CONDITION)
Alternate repeat COMMANDS until CONDITION
Action repeat executes a set of commands and then tests a
condition. If the value of the condition is false,
the commands are performed again. This sequence is
repeated until the condition becomes true. Since the
entire sequence of commands is executed before the
condition is tested, the commands are always
performed at least once.
Parameters COMMANDS is a legal KnowledgePro command or list of
commands to be performed as long as the boolean
expression remains true.
CONDITION is a boolean expression or a list of
expressions that evaluate to a boolean value. If the
boolean expression results in a list of values, all
values on the list must be true for the expression to
be true.
Note When the alternate form is used, the evaluation of
CONDITION is delayed until the action is performed
once. CONDITION is evaluated after COMMANDS each time
COMMANDS is performed.
See Also #mwhile#m
//replace
#cenable_menu_item (?m1, &Copy).
Format is 'replace (LIST, OLD_ITEMS, NEW_ITEMS {, NUMBER }) .'.#c
Format replace (LIST, OLD_ITEMS, NEW_ITEMS {, NUMBER })
Action Forms a new list by replacing items on a list with
new items. The original LIST is not changed.
Parameters LIST is a list.
OLD_ITEMS contains the items to be replaced. LIST is
searched for the first sublist corresponding to
OLD_ITEMS. The sublist is replaced by NEW_ITEMS. If
OLD_ITEMS is [ ], then NEW_ITEMS is appended to the
list.
NEW_ITEMS is the replacement list. If NEW_ITEMS is
[ ], OLD_ITEMS are deleted from the list.
NUMBER is the number of times the replacement is to
be performed. NUMBER must be in the range 1 to
32767.
Returns The original list with OLD_ITEMS replaced by
NEW_ITEMS.
If COUNT is [ ] or not present, the replacement is
performed once. If COUNT is less than 1, an error
message is displayed and the original list is
returned.
Errors Specifying a count less than 1 or greater than 32767.
I_INVALID_ELEMENT
See Also #mcombine#m, #mremove#m, #mremove_elements#m,
#mreplace_elements#m
//replace_elements
#cenable_menu_item (?m1, &Copy).
Format is 'replace_elements (LIST, POSITION, NEW_ITEMS).'.#c
Format replace_elements (LIST, POSITION, NEW_ITEMS)
Action Create a new list by replacing items at a specific
location in a list with a new list item. If POSITION
is [ ], the NEW_ITEMS are appended to LIST. If an
item in POSITION is longer than the length of LIST
the new elements are appended to LIST. LIST itself
is not changed.
Parameters LIST is the list with items to be replaced.
POSITION is a list of the locations of the elements
in LIST to be replaced.
NEW_ITEMS is the list of VALUES to be placed on the
list.
Returns A new list with the elements of the original list
replaced by the new items.
Error An integer less than 1 is included on POSITION.
I_INVALID_ELEMENT
See Also #mcombine#m, #mremove#m, #mremove_elements#m,
#mreplace#m
//reset
#cenable_menu_item (?m1, &Copy).
Format is 'reset (TOPIC).'.#c
Format reset (TOPIC)
Action Removes any values that have been assigned to a
topic or a list of topics and marks the topic as
unevaluated. When a topic has been reset, it does
not have a value associated with it. The values of
all descendants are also reset.
Parameters TOPIC is the topics or list of topics to be reset.
//resize_window
#cenable_menu_item (?m1, &Copy).
Format is 'resize_window ({HANDLE}, WIDTH, HEIGHT).'.#c
Format resize_window ({HANDLE}, WIDTH, HEIGHT)
Action Displays the window or screen object with a new width
and height. When a window is resized it receives a
resize_event.
Parameters HANDLE is the handle or list of handles of windows
or screen objects. The default is the current
display window.
WIDTH, HEIGHT is the new width and height of the
window or screen object.
Errors I_INVALID_WINDOW
See Also #mmove_window#m, #mshow_window#m
//rest
#cenable_menu_item (?m1, &Copy).
Format is 'rest (LIST).'.#c
Format rest (LIST)
Action Make a new list by removing the first element from a
list. LIST itself is not changed.
Parameters LIST is a list.
Returns The list formed by removing the first element from
LIST.
See Also #melement#m, #mfirst#m, #mlast#m
//rule
#cenable_menu_item (?m1, &Copy).
Format is 'rule (CONDITION, COMMAND1 {, COMMAND2}).'.#c
Format rule (CONDITION, COMMAND1 {, COMMAND2})
Alternate if CONDITION then COMMAND1 {else COMMAND2}
Action Tests the conditional statements. If the result of
the test is true, the list of commands in COMMAND1
is performed. If the boolean result is F, the list
of commands in COMMAND2 is performed if it is
present.
Parameters CONDITION is a command that evaluates to a boolean
value. If the boolean is a list of values, all
values on the list must be true for the expression to
be true.
COMMAND1 is one command or several commands connected
by and. These commands are performed if CONDITION is
evaluated to be true.
COMMAND2 is one command or several commands
connected by and. These commands are performed if
CONDITION is evaluated to be false.
Returns The result of evaluating either COMMAND1 or
COMMAND2.
Note When the alternate form is used, the
evaluation of parameters in COMMAND1 and COMMAND2
is delayed until after the boolean expression is
evaluated. The conditional expressions are
evaluated using delayed evaluation. The first
boolean condition is evaluated. If it is T, the next
condition is evaluated. COMMAND2 is performed
if any conditional expression results in F.
//run
#cenable_menu_item (?m1, &Copy).
Format is 'run (PROGRAM {,SHOW_CODE}).'.#c
Format run (PROGRAM {,SHOW_CODE})
Action Executes the program. The knowledge base does not
continue until the program terminates.
Parameters PROGRAM is the name of a program and its command line
parameters or list of programs and command lines. If
the program name does not contain a path, run
automatically searches the DOS PATH if the program is
not in the current directory. If the program name
does not contain an extension, .EXE is assumed.
SHOW_CODE describes how the window that contains the
application appears and whether it becomes the
currently active window. The codes are:
Display Active Window Code
Normal Yes 1
Normal No 4
Minimized Yes 2
Minimized No 7
Maximized Yes 3
Hidden No 0
The default value loads the application as a normal
window that is the active window (Code 1).
Returns [ ] or an error code. Error codes are always less
than 32. Possible error codes are:
2 Program not found.
16 The program name was invalid.
17 The command line is greater than 80 characters.
18 No timers available
Note It is best to run the .PIF file for DOS applications.
This gives you control over memory, program switches
etc.
The error code returned is the code returned by the
Windows program loader. It is usually 0, so there is
no reliable way to tell if the program has actually
executed. Windows does not return program exit codes
to KnowledgePro.
Under Windows/286, the screen may turn black when
executing a DOS application. Under Windows/386, it is
possible to execute a DOS program as an icon by
setting the .PIF file to run in background and using
SHOE_CODE of 2.
Errors I_EXT_STRING_LONG, I_NO_TIMERS
See Also #mload_program#m
//save_as
#cenable_menu_item (?m1, &Copy).
Format is 'save_as (FILE {,TEXT}).'.#c
Format save_as (FILE, {TEXT})
Action A dialog window is opened and the user has the
opportunity to specify a file name, change the name
of the file or cancel the operation. If the user
selects ENTER when the focus is on the edit box or
presses OK, the specified file name is selected. If
the file exists, the user is asked if the file should
be overwritten. If the user selects no, the dialog
window reappears.
Parameters FILE is a file name or list of file names. If the
names do not contain a drive and path specifier, the
current directory is used. If this parameter is a
list, only the first element is used.
TEXT is the message written on the top line of the
dialog window.
Returns If the user enters and selects a file name, it is
returned, otherwise [ ] is returned.
See Also #mfile_menu#m, #msave_edit_file#m
//save_edit_file
#cenable_menu_item (?m1, &Copy).
Format is 'save_edit_file (HANDLE).'.#c
Format save_edit_file (HANDLE)
Action Saves the text from an edit window to a file.
save_edit_file uses the title of the edit window as
the name of the file which will contain the text. If
the window has no title or its title is "Untitled-
xxx", where xxx is an integer, save_as is called to
prompt the user for a file name.
Parameters HANDLE is the handle of an edit window. created
using edit_window or edit_file.
Returns T if the text was saved, otherwise F.
Errors I_CANT_OPEN, I_CANT_WRITE, I_CANT_CLOSE,
I_INVALID_WINDOW
See Also #mfile_menu#m, #mget_edit#m, #msave_as#m
//save_topic
#cenable_menu_item (?m1, &Copy).
Format is 'save_topic (FILE, TOPIC).'.#c
Format save_topic (FILE, TOPIC)
Action Saves the specified topic and all of its descendants
in compiled form in FILE. If FILE already exists, it
is overwritten. The commands, values, and properties
(demons, number of values etc.) of the topics are
saved. When the topic is loaded with a load command,
its values etc. are restored.
Parameters FILE is the name of a file to contain the compiled
knowledge base. If FILE is a list, only the first
element is used. The file name may be any legitimate
DOS file name and may contain drive and path
information. If a path is not supplied, the default
directory is used. If an extension is not supplied,
an extension of "CKB" will be appended to the file
name.
TOPIC is a topic name or list of topic names. If
topic is [ ] or missing, the current topic is saved.
Returns T if the save was successful, otherwise F is
returned.
Note save_topic (MYKB, '!main')
saves the entire knowledge base currently in memory
in the file MYKB.CKB.
Errors I_CANT_OPEN, I_TOPIC_NOT_FOUND, I_CANT_WRITE,
F_NO_NAME
See Also #mload#m
//say
#cenable_menu_item (?m1, &Copy).
Format is 'say (TEXT).'.#c
Format say (TEXT)
Action Puts a message on the screen in the currently active
window. Display codes may be embedded in the text. A
small window with a button labeled CONTINUE is placed
in the lower right corner of the screen. After the
text and button are displayed the topic wait is
called and the knowledge base is halted until the
user selects the CONTINUE button.
Parameters TEXT are the strings or list of strings to be
displayed. The following control codes can be
embedded within the text to control the display of
information on the screen:
##n start a new line
##p start a new page
##e erase the contents of the screen
##l put each list item on a new line (default)
##s put each list item on the same line
##o no spaces after a list item
##i insert a space after each list item (default)
##t tab five spaces
##m begin or end marked text
#### display the character ##
##INTEGER print the ASCII character of INTEGER
##xINTEGER move to column INTEGER
##yINTEGER move to row INTEGER
##gHANDLE display a bitmap. HANDLE is the handle
returned by load_bitmap.
##fCOLOR change foreground color to COLOR
##bCOLOR change background color to COLOR
##d return to default colors
##cTEXT##c TEXT is compiled and evaluated
##vTEXT##v TEXT is compiled, evaluated and any value
returned is displayed
The following colors may be placed after the ##f and
##b:
black, blue, green, cyan, red, magenta,
yellow, white
At least one blank space must follow the name of the
color. Colors may also be specified by numbers.
When using ##cTEXT##c or ##vTEXT##v, TEXT must
evaluate to legitimate KnowledgePro commands.
Errors say calls text which can generate its own error
messages.
See Also #mcontinue#m, #mtext#m, #mwait#m
//set_active_window
#cenable_menu_item (?m1, &Copy).
Format is 'set_active_window (HANDLE).'.#c
Format set_active_window (HANDLE)
Action Sets the window which receives keyboard input. The
active window is brought to the top of the other
windows. If it has a title bar, the title bar is
displayed with the active title bar color. Only a
popup or overlapped window can be made the active
window.
Parameters HANDLE is the handle of the window you want to make
the active window.
Note Setting the active window does not change the current
display window. The window that becomes the active
window receives a get_focus_event.
See Also #mget_active_window#m, #mset_display_window#m,
#mset_top_window#m
//set_check_box
#cenable_menu_item (?m1, &Copy).
Format is 'set_check_box (HANDLE, BOOLEAN).'.#c
Format set_check_box (HANDLE, BOOLEAN)
Action Used to check and uncheck selected check boxes
Parameters HANDLE is the identifier of the check box. If it is a
list, each check box is set.
BOOLEAN is a boolean value that specifies the value
of each check box named by HANDLE. When the value is
true, the check box is checked. A false value
unchecks an already checked check box. If this
parameter is a list, only the first element is used.
Errors I_INVALID_WINDOW
See Also #mget_check_box#m, #mcheck_box#m
//set_cursor_pos
#cenable_menu_item (?m1, &Copy).
Format is 'set_cursor_pos (COLUMN, ROW)..'.#c
Format set_cursor_pos (COLUMN, ROW).
Action Moves the cursor in the active window to COLUMN, ROW.
Parameters COLUMN, ROW is the new cursor position relative to
the upper left corner of the active window.
See Also #mget_cursor_pos#m, #mset_display_pos#m,
#mget_display_pos#m
//set_demon
#cenable_menu_item (?m1, &Copy).
Format is 'set_demon (TOPIC, DEMON_LIST).'.#c
Format set_demon (TOPIC, DEMON_LIST)
Action set_demon creates a list of demons that is associated
with a topic. Whenever a system topic is called that
changes the value of TOPIC, such as make, gets,
make_c, gets_c, ask or read_response, the list of
demon topics is called before the value of TOPIC is
changed.
Parameters TOPIC is the topic or list of topics which is to have
the demon attached. If TOPIC doesn't exist, it is
created. If TOPIC is [ ] , the current topic is
assigned the demon.
DEMON_LIST is a list of topic names assigned as
demons to TOPIC. Whenever the value of TOPIC is about
to be changed, the demon list of topics is called
before the change is made. Each demon is called as:
DEMON (full_name (TOPIC), OLD_NAME, NEW_VALUE).
OLD_VALUE is the current value of TOPIC. When DEMON
is called because of a make or make_c, NEW_VALUE is
the value which replaces OLD_VALUE if the make or
make_c is completed. If get or get_c calls DEMON,
NEW_VALUE is OLD_VALUE with the assigned value
appended to it. FULL_NAME returns the full name of
the topic attached to the demon. When DEMON is
assigned a value of true, the new value is not
assigned to the topic. It is assumed that the demon
has handled all processing of the topic.
Note Demon topics should be reachable from the topic which
contains the make, make_c, get or get_c, ask or
read_response topics which assign values to TOPIC.
See Also #mget_demon#m
//set_display_pos
#cenable_menu_item (?m1, &Copy).
Format is 'set_display_pos (COLUMN,ROW).'.#c
Format set_display_pos (COLUMN,ROW)
Action Sets the default position where text or a screen
object is displayed in the current display window.
Attempts to move outside of the boundaries of the
current window cause the default to be set to the
nearest edge of the window.
Parameters COLUMN, ROW are the co-ordinates where the next
object is displayed on the screen. This is relative
to the upper left corner of the window.
See Also #mget_cursor_pos#m, #mget_display_pos#m,
#mset_cursor_pos#m, #mset_top_window#m
//set_display_window
#cenable_menu_item (?m1, &Copy).
Format is 'set_display_window (HANDLE).'.#c
Format set_display_window (HANDLE)
Action The specified window is made the current display
window. This is the window where all text and screen
objects are created.
Parameters HANDLE is the handle of the window which is made the
current display window. If HANDLE is a list, only the
first element is used. HANDLE cannot be the handle of
an edit window.
Notes Changing the current display window does not affect
which window is the currently active window. The
display window is where screen objects and text are
created. The active window is the one that receives
all user input.
Errors I_INVALID_WINDOW
See Also #mget_display_window#m, #mset_active_window#m,
#mget_active_window#m
//set_error_topic
#cenable_menu_item (?m1, &Copy).
Format is 'set_error_topic (ERROR_HANDLER).'.#c
Format set_error_topic (ERROR_HANDLER)
Action Sets the topic to be called when an error occurs.
Parameters ERROR_HANDLER is a list of topic names or [ ]. If
ERROR_HANDLER is [ ], the default error handler will
be called.
Note When an error occurs, ERROR_HANDLER is reset and
called as:
ERROR_HANDLER (ERROR_CODE,TOPIC_NAME,PARAMETERS).
where:
ERROR_CODE is the error code associated with this
error.
TOPIC_NAME is the name of the command which caused
the error.
PARAMETERS is a list containing the command's
parameters.
In most cases, commands in which an error occurs
return [ ]. If ERROR_HANDLER is assigned a value
while processing an error, that value is returned as
the value of the command which caused the error.
See Also #merror_message#m, #mget_error_topic#m
//set_event_topic
#cenable_menu_item (?m1, &Copy).
Format is 'set_event_topic (EVENT_TOPIC, EVENT_LIST).'.#c
Format set_event_topic (EVENT_TOPIC, EVENT_LIST)
Action Defines an event handling topic for a particular
event or list of events. When any of the defined
events occurs, this is the first topic performed.
Parameters EVENT_TOPIC is the topic or list of topics to be
performed when an event on the EVENT_LIST occurs.
EVENT_TOPIC is called as:
EVENT_TOPIC(EVENT_INFO,EVENT_NAME,HANDLE).
EVENT_INFO depends on the event that occurs. A
description of events is provided in Appendix D.
EVENT_NAME is the name of the event that occurred.
HANDLE is the handle assigned to the button.
EVENT_TOPIC should set its value to true if it
processes the event and no further action is
required. Ignoring the event or assigning any other
value causes KnowledgePro to continue with the
default action. Whenever EVENT_TOPIC is called as
the result of an event its value is reset. If
no EVENT_TOPIC is defined, no events are recognized.
EVENT_LIST is a list of events. The events generated
and how they are generated depends on the window or
screen object which has the focus. Events are
described in Appendix D.
Note set_event_topic ().
Removes any links between events and topics created
with previous calls to set_event_topic.
Before a global event handling topic can be created
there must be at least one visible window created in
the knowledge base. If you don't want this window to
appear on screen, you can use column and row co-
ordinates such as 500,500 and it will not be drawn
on-screen.
//set_file_pos
#cenable_menu_item (?m1, &Copy).
Format is 'set_file_pos (FILE, NUMBER {, START}).'.#c
Format set_file_pos (FILE, NUMBER {, START})
Action Moves a file's pointer to a certain location.
Parameters FILE is the name of the file or list of files whose
pointer is moved.
NUMBER is the number of characters (bytes) to move
the file pointer. To move the file pointer
backwards, make this number negative.
START is a string which evaluates to BEGINNING,
CURRENT, or END. The pointer is moved NUMBER bytes
from the beginning of the file, the current location
of the file pointer, or the end of the file,
respectively. The default is BEGINNING.
Returns The position of the pointer after being moved. This
is equal to the number of bytes from the beginning of
the file. If the file pointer is at the beginning of
the file, the result is 0.
Note It is possible to set a file's pointer beyond the end
of the file. If this is done, and then a read is
attempted, an end of file character (ASCII) is
returned. If a write is attempted when the file
pointer is beyond the end of the file, the file is
first extended with null characters (ASCII 0) to the
position of the file pointer, and then the write is
performed.
It is not possible to set the file pointer before the
beginning of a file. If such an operation is
attempted, the file pointer is set at the beginning
of the file.
Errors I_CANT_OPEN
See Also #mget_file_pos#m, #mnew_file#m, #mread#m,
#mread_line#m, #mread_char#m, #mwrite#m, #mclose#m
//set_focus
#cenable_menu_item (?m1, &Copy).
Format is 'set_focus (HANDLE).'.#c
Format set_focus (HANDLE)
Action Sets the screen object which receives input. When
the focus is set to an overlapped or popup window,
the window comes to the top and becomes the active
window. When it is set to a child window, the window
becomes the top window. The object receiving the
focus receives a get_focus_event.
Parameters HANDLE is the handle of the window or object which is
to receive the focus. If HANDLE is a list, only the
first element is used.
Returns The handle of the currently active window.
Errors I_INVALID_WINDOW
See Also #mget_focus#m, #mset_active_window#m,
#mset_top_window#m
//set_number_of_values
#cenable_menu_item (?m1, &Copy).
Format is 'set_number_of_values (TOPIC, INTEGER) .'.#c
Format set_number_of_values (TOPIC, INTEGER)
Action Sets the number of different values that can be
assigned to a topic. This topic has no effect on
values already assigned to a topic, but an
error message is displayed if a subsequent attempt
is made to assign more than the legal number of
values.
Parameters TOPIC specifies the name of the topic or topics whose
maximum number of values you wish to specify. If
TOPIC does not exist it is created. If TOPIC is [ ],
the current topic is set.
INTEGER specifies the number of values the topic or
lists of topics can be assigned.
Errors I_INVALID_ELEMENT
See Also #mget_number_of_values#m, #mvalue_of#m
//set_procedures
#cenable_menu_item (?m1, &Copy).
Format is 'set_procedures (TOPIC, COMMANDS) .'.#c
Format set_procedures (TOPIC, COMMANDS)
Action The commands specified by COMMANDS is attached to
TOPIC.
Parameters TOPIC specifies the name of the topic or topics
whose topic list you want to set.
COMMANDS is a list which specifies the commands to be
attached to TOPIC . Each element of the list is a
list in the internal format for commands.
KnowledgePro commands are represented internally as a
list in the form:
[function, parameter1, parameter2...]
Using Debug, this list is displayed as:
function (parameter1, parameter2,...)
This list can be constructed and manipulated using
any of the standard list topics.
Note If you want to assign commands to a topic without
evaluating the command, delay can be used.
set_procedures (x,[delay (ask('What is your name?',
name)),delay (say ('Hello there'))]).
set_procedures is not supported in the runtime
version of KnowledgePro.
See Also #mcompile#m, #mevaluate#m, #mperform#m,
#mget_procedures#m
//set_radio_button
#cenable_menu_item (?m1, &Copy).
Format is 'set_radio_button (HANDLE, BOOLEAN).'.#c
Format set_radio_button (HANDLE, BOOLEAN)
Action Used to check and uncheck selected radio buttons
Parameters HANDLE is the identifier of the button. If it is a
list of radio buttons not in the same group, each
button is set.
BOOLEAN is a boolean value that specifies the value
of each radio button named by HANDLE. When the value
is T, the radio button is checked. A F value
unchecks a checked radio button.
Errors I_INVALID_WINDOW
See Also #mget_radio_button#m, #mradio_button#m, #mset_text#m
//set_read_only
#cenable_menu_item (?m1, &Copy).
Format is 'set_read_only (TOPIC, {BOOLEAN}).'.#c
Format set_read_only (TOPIC, {BOOLEAN})
Action Sets TOPIC to be either a read and write topic or
read only. The value of a read only topic cannot be
changed. If TOPIC cannot be found, it is created.
Since topics are read and write by default, this is
usually only used to set a topic to read only or to
reset a topic previously set to read only.
Parameters TOPIC is the name of the topic or list of topics to
set as read and write. If [ ], the current topic is
used.
BOOLEAN is T to set the specified topics as read
only. This means new values cannot be assigned to
TOPIC. BOOLEAN is F to set TOPIC back to read and
write. The default value is t.
Note Read and write is the default for all topics.
See Also #mget_read_only#m
//set_scroll_bar
#cenable_menu_item (?m1, &Copy).
Format is 'set_scroll_bar (HANDLE, POSITION).'.#c
Format set_scroll_bar (HANDLE, POSITION)
Action Sets the scroll bar slider to POSITION.
Parameters HANDLE the handle of a scroll bar or list of handles.
POSITION is the new slider position. POSITION must be
in the range set when the scroll bar was created. If
POSITION is below the minimum slider value it is set
to the minimum. If POSITION is beyond the slider
maximum it is set to the maximum value. POSITION
must be in the range -32768 to 32767. If this
parameter is a list, only the first element is used.
Returns The new position of the slider.
Errors I_INVALID_WINDOW
See Also #mget_scroll_bar#m, #mhorz_scroll_bar#m,
#mvert_scroll_bar#m
//set_text
#cenable_menu_item (?m1, &Copy).
Format is 'set_text ({HANDLE}, TEXT).'.#c
Format set_text ({HANDLE}, TEXT)
Action The action depends on the type of the window:
Window Type Action
button, radio button, TEXT replaces the text of the
or check box screen object. If TEXT is a list,
only the first item is used.
edit objects and TEXT replaces the current text.
display windows Screen objects in a display window
are not affected.
list box TEXT replaces the items in
the list box.
scroll bar No effect.
Parameters HANDLE is the handle of the window or a list of
handles. If it is a list, each window or screen
object on the list is assigned TEXT. The default is
the current display window.
TEXT is the text to be assigned to the windows or
screen objects.
Errors I_INVALID_WINDOW
See Also #mget_text#m
//set_title
#cenable_menu_item (?m1, &Copy).
Format is 'set_title ({HANDLE}, TEXT).'.#c
Format set_title ({HANDLE}, TEXT)
Action TEXT replaces the window title. In a display window
or an edit window.
Parameters HANDLE is the handle of the window or a list of
handles. If it is a list, each window on the list is
assigned the new title. The default handle is the
handle of the current display window.
TEXT is the window title. If this parameter is a
list, only the first element is used.
Errors I_INVALID_WINDOW
Set Also #mget_title#m
//set_top_window
#cenable_menu_item (?m1, &Copy).
Format is 'set_top_window (HANDLE).'.#c
Format set_top_window (HANDLE)
Action Places the focus in the specified window. If the
window is a popup or an overlapped window it becomes
the active window. set_top_window has the same
results as a set_focus. If the window has a title
bar it is made the active title bar color. If it has
a dialog frame, the frame is made the active title
bar color. The window set to the top receives a
get_focus_event. The window or screen object which
had the focus receives a lose_focus_event.
Parameters HANDLE is the handle of the window which is made the
top window.
Errors I_INVALID_HANDLE
See Also #mget_top_window#m, #mset_active_window#m,
#mset_display_window#m, #mset_focus#m, #mDescription of Events#m
//show_topic
#cenable_menu_item (?m1, &Copy).
Format is 'show_topic (TOPIC).'.#c
Format show_topic (TOPIC)
Action Opens a dialog window containing information about
the topic. This is the same information displayed
when a topic is selected from the list of topics
displayed by Debug/Topics on the main menu of the
development environment. The user can change the
characteristics of the topic displayed.
Parameters TOPIC is a topic name or list of topic names whose
descriptions are to be displayed.
Returns A boolean that indicates whether the topic was
changed.
Note This topic is meant for use during debugging only.
The user can change the topic's value, commands etc.,
but the knowledge base source files is not be
updated.
When make_topic_list is called, it creates a list of
topics in the knowledge base. If the user clicks on
one of these topics, show_topic is automatically
called to display the details of the selected topic.
Error I_CANT_WRITE I_V_TOPIC_NOT_FOUND
See Also #mmake_topic_list#m
//show_window
#cenable_menu_item (?m1, &Copy).
Format is 'show_window ({HANDLE, SHOW_CODE}).'.#c
Format show_window ({HANDLE, SHOW_CODE})
Action Controls the way in which a window appears on the
screen. Used for showing hidden windows, maximizing
windows, making windows iconic and restoring windows.
When a window is moved or resized by a show_window,
it receives a move_event or a resize_event.
Parameters HANDLE is a handle or list of handles of windows or
screen objects. The default is the current display
window.
SHOW_CODE describes how the window appears and
whether it becomes the active window. The codes
are:
Display Active Window Code
Normal Yes 1
Normal No 4
Minimized Yes 2
Minimized No 7
Maximized Yes 3
Hidden No 0
Current State Yes 5
Current State No 8
The default value is 1. If this
parameter is a list, only the first element is used.
Errors I_INVALID_WINDOW
See Also #mdisable_window#m, #menable_window#m,
#mhide_window#m
//single_step
#cenable_menu_item (?m1, &Copy).
Format is 'single_step ( ).'.#c
Format single_step ( )
Action Causes KnowledgePro to stop and wait for a user
response after each knowledge base step. After each
topic is executed, but before the result is returned
to the calling function, the topic call
wait (continue).
is executed.
Note This command is usually used during a trace.
The command:
text (?name).
pauses twice. First when ?name is executed, and again
before the text is displayed.
See Also #msingle_step_off#m, #mtrace#m
//single_step_off
#cenable_menu_item (?m1, &Copy).
Format is 'single_step_off ( ).'.#c
Format single_step_off ( )
Action Turns single step mode off.
See Also #msingle_step#m
//sort
#cenable_menu_item (?m1, &Copy).
Format is 'sort (LIST, ORDER).'.#c
Format sort (LIST, ORDER)
Action Creates an alphabetically sorted list from LIST.
Sublists are flattened for the sort. LIST itself is
not changed.
Parameters LIST is a list of elements to be sorted. LIST is
flattened before sorting.
ORDER is a string that specifies the order in which
the list is sorted. To sort in ascending order ORDER
should be either ASCENDING or UP. For descending
order, DESCENDING or DOWN. The default is ASCENDING.
Returns The sorted list. The value of ORDER determines
whether the list is ascending or descending.
Note The longest list that can be sorted contains 16384
elements.
Errors I_LIST_TOO_LONG
See Also #mnumeric_sort#m
//stop
#cenable_menu_item (?m1, &Copy).
Format is 'stop (MESSAGE).'.#c
Format stop (MESSAGE)
Action Halts execution of the knowledge base.
Parameters MESSAGE is an optional text string which is displayed
before the system halts.
Note In the KnowledgePro runtime system, stop exits
KnowledgePro.
Errors When a message is displayed before execution is
halted stop calls the system topic text, which can
generate error messages.
See Also #mexit#m
//string_copy
#cenable_menu_item (?m1, &Copy).
Format is 'string_copy (TEXT, START, LENGTH).'.#c
Format string_copy (TEXT, START, LENGTH)
Action Copies a specified part of a string.
Parameters TEXT is string or list of strings from which parts
are to be copied.
START is the starting position within the main
string.
LENGTH is the total length of the substring to be
copied.
Returns The part of the string starting at the position
specified by START and having the total length
specified by LENGTH. If the string is a list then a
list of substrings is returned. The first character
in the string is position 1. If START is a list, a
list of substrings is returned with the starting
points at each of the locations on the list of START.
If LENGTH is a list, a list of substrings is
returned with the length of each item on the list of
LENGTH.
If any of the parameters are [ ], START < 1, LENGTH <
1 or START > the length of TEXT then [ ] is
returned.
If LENGTH > the length of TEXT then all of the
characters up to the end of TEXT are returned.
Error I_INVALID_ELEMENT
See Also #mstring_replace#m
//string_length
#cenable_menu_item (?m1, &Copy).
Format is 'string_length (TEXT).'.#c
Format string_length (TEXT)
Action Finds the number of characters contained in a string.
Parameters TEXT is a string or a list of strings.
Returns The length of the string item. If TEXT is a list,
a list containing the lengths of each of the strings
is returned.
//string_replace
#cenable_menu_item (?m1, &Copy).
Format is 'string_replace (TEXT_STRING, OLD_TEXT, NEW_TEXT {,COUNT, CASE_SENSITIVE}).'.#c
Format string_replace (TEXT_STRING, OLD_TEXT, NEW_TEXT
{,COUNT, CASE_SENSITIVE})
Action Makes a new string by replacing part of one string
with another string. The original TEXT_STRING is not
changed.
Parameters TEXT_STRING is the string in which the substring to
be replaced occurs.
OLD_TEXT is the substring in TEXT_STRING which is to
be replaced.
NEW_TEXT is the string which is to replace OLD_TEXT
in TEXT_STRING.
COUNT is a count of the number of times the
replacement is to be performed. COUNT must be in
the range 1 to 32767. If COUNT is a list, only the
first element is used.
CASE_SENSITIVE is a boolean value indicating whether
or not the search for the string to be replaced is
case sensitive. The default is F. This parameter
does not affect NEW_TEXT.
Returns For each string in TEXT_STRING a list of
strings is returned with COUNT occurrence of OLD_TEXT
replaced by NEW_TEXT.
If the new string, NEW_TEXT is [ ], then OLD_TEXT is
deleted from TEXT_STRING COUNT times.
If COUNT is [ ] or not present, the replacement is
performed once. If COUNT is less than 1 or greater
than 32767, an error message is displayed and the
original string is returned.
Errors I_INVALID_COUNT, I_INVALID_ELEMENT
See Also #mstring_copy#m
//string_to_list
#cenable_menu_item (?m1, &Copy).
Format is 'string_to_list (TEXT{,DELIMITER}).'.#c
Format string_to_list (TEXT{,DELIMITER})
Action Makes a new list out of a string by turning the
individual words in the string into elements of a
list. By default, words are any sequence of
characters delimited by spaces. However, the
DELIMITER parameter lets you define different or
additional characters as delimiters.
Parameters TEXT a string or list of strings.
DELIMITER is an optional list of characters that can
be used to specify different or additional
deliminating characters.
Returns A list whose elements are the individual words
from the parameter TEXT.
//string_where
#cenable_menu_item (?m1, &Copy).
Format is 'string_where (TEXT, FIND{,COUNT, CASE_SENSITIVE}).'.#c
Format string_where (TEXT, FIND{,COUNT, CASE_SENSITIVE})
Action Find a substring in a string.
Parameters TEXT is the main string.
FIND is the search string.
COUNT specifies the number of searches to do. If you
want to search for all occurrences of an item, enter
a large number such as 32000 for COUNT.
CASE_SENSITIVE is a boolean value. If T, the search
for FIND in text is case sensitive. The default if
F.
Returns The position of the substring in the main
string. If either string is [ ], a value of 0 is
returned. If the substring is a list, a list of
positions is returned for each string. If COUNT is
used a list of the locations is returned. If COUNT
is present, it must be in the range 1 to 32767. If
COUNT is not present, it is assumed to be 1.
Errors I_INVALID_ELEMENT
//sublist
#cenable_menu_item (?m1, &Copy).
Format is 'sublist (LIST, START, LENGTH).'.#c
Format sublist (LIST, START, LENGTH)
Action Retrieves the sublist starting at a specified
location in a list.
Parameters LIST is the list that contains the sublist.
START is a list of starting points for the sublist or
set of sublists.
LENGTH is a length or a list of lengths of the
sublists returned.
Returns A sublist starting at START and containing LENGTH
elements. If an element of START is greater than the
length of LIST, [ ] is returned. If the specified
list extends beyond the length of LIST, the sublist
to the end of LIST is returned.
Errors I_INVALID_ELEMENT, I_INVALID_LENGTH
See Also #mdifferent#m, #mintersect#m, #mreplace#m,
#mreplace_elements#m
//system_info
#cenable_menu_item (?m1, &Copy).
Format is 'system_info ( ).'.#c
Format system_info ( )
Action Provides information about the system in use.
Returns A list describing the system being used. The list
contains:
Element Contents
1 the total number of columns on the display
2 the total number of rows on display
3 the average width in pixels of the
default system character set
4 the height in pixels of the default
system character set
5 the KnowledgePro version number
6 the revision date of KnowledgePro
7 the KnowledgePro system type either
DEVELOPMENT or RUNTIME
8 the environment for KnowledgePro
(Windows). This is always WINDOWS
9 the Microsoft Windows version number
10 the current knowledge base name
11 the task handle of KnowledgePro
12 the number of pure colors which can be
displayed on the monitor in use
See Also #mmonitor_type#m, #mwindow_info#m
//task_list
#cenable_menu_item (?m1, &Copy).
Format is 'task_list ( ).'.#c
Format task_list ( )
Action This is used to get the task handles of all the tasks
that are currently running. When a new task is
loaded it is assigned a task handle which is placed
on the task list. The task handle can be used with
task_windows to find the handle of the window that
contains an application.
Returns A list of the handles of all the currently active
tasks.
See Also #mtask_window#m
//task_windows
#cenable_menu_item (?m1, &Copy).
Format is 'task_windows (TASK_HANDLE).'.#c
Format task_windows (TASK_HANDLE)
Action This is used to find the handles of the windows in a
task.
Parameters TASK_HANDLE a task handle or list of task handles.
The task handle is a number that uniquely identifies
the task. If this parameter is [ ], the current task
(KnowledgePro) is used. The task handle of each
application currently loaded is kept on a task list.
The contents of the task list can be found using
task_list.
Returns A list of the windows of all the tasks. Child windows
are not listed.
Errors I_INVALID_HANDLE
See Also #mtask_list#m
//text
#cenable_menu_item (?m1, &Copy).
Format is 'text (TEXT).'.#c
Format text (TEXT)
Action Display TEXT in the active window. TEXT is displayed
at the current position.
Parameters TEXT a list of text items to be displayed.
Note text writes to the current display window. Hypertext
in the window can be selected by pointing and
clicking the mouse or by moving the cursor to the
hypertext and pressing ENTER. In text created while
the auto_hyper_on feature has been selected, text can
be selected as hypertext by dragging the mouse over
it and then clicking the mouse or pressing ENTER.
The selected text is displayed in reverse video. If
auto_hyper is on and no text is selected, the click
selects the word pointed at and ENTER selects the
word under the cursor.
When hypertext is selected
1] super_mark is called as:
super_mark (TEXT, HANDLE, COLUMN, ROW).
2] if super_mark doesn't exist, a topic with the
same name as the selected text is called as
SELECTED_TEXT (TEXT, HANDLE, COLUMN, ROW).
3] if the topic with the same name as text doesn't
exist, mark is called as
mark (TEXT, HANDLE, COLUMN, ROW).
4] if this fails, an I_HYPERTEXT_ERROR error is
generated.
The following control codes can be embedded within
the text of TEXT to control the display of
information on the screen :
##n start a new line
##p start a new page
##e erase the contents of the window
##l put each list item on a new line
(default)
##s put each list item on the same line
##o no spaces after a list item
##i insert a space after each list item
(default)
##t tab five spaces
##m begin or end marked text
#### display the character ##
##INTEGER print the ASCII character of INTEGER
##xINTEGER move to column INTEGER
##yINTEGER move to row INTEGER
##gHANDLE display a bitmap. HANDLE is the
handle returned by load_bitmap.
##fCOLOR change foreground color to COLOR
##bCOLOR change background color to COLOR
##d return to default colors
##cTEXT##c TEXT is compiled and evaluated
##vTEXT##v TEXT is compiled, evaluated and any value
returned is displayed
The following colors may be placed after the ##f and
##b:
black, blue, green, cyan, red, magenta, yellow, white
At least one blank space must follow the name of the
color.
When using ##cTEXT##c or ##vTEXT##v, TEXT must
evaluate to legitimate KnowledgePro commands. The
text is compiled, evaluated and the result is
displayed.
Error I_INVALID_WINDOW I_CANT_CREATE_TEMP_FILE
I_MISSING_HASHC
See Also #mauto_hyper_off#m, #mauto_hyper_on#m,
#mdisplay_pos#m, #mdisplay_pos#m, #msay#m,
#muse_font#m
//text_to_clipboard
#cenable_menu_item (?m1, &Copy).
Format is 'text_to_clipboard (TEXT).'.#c
Format text_to_clipboard (TEXT)
Action Stores ASCII text in the clipboard. If text is a
list, the list is flattened and each element of the
list is stored as a line of text.
Parameters TEXT text to be stored in the clipboard.
See Also #mbitmap_to_clipboard#m, #mread_clipboard#m
//time
#cenable_menu_item (?m1, &Copy).
Format is 'time ( ).'.#c
Format time ( )
Action Reads the time from the system clock. The format
used is [ hours, min, sec, hundredths ]. Hundredths
is in 1/100ths of a second.
Returns A list in the format above which contains the current
system time.
See Also #mdate#m
//trace
#cenable_menu_item (?m1, &Copy).
Format is 'trace ({FILE}).'.#c
Format trace ({FILE})
Action When trace is turned on, each step of the
execution of a knowledge base is displayed either
on the screen or to a specified file.
Parameters FILE is the name specified if you want to save the
trace to a file. If no file name is specified,
the results of the trace are sent to a window which
is opened on the screen. To send a trace to the
printer, use PRN as a file name.
Error I_CANT_OPEN
See Also #msingle_step#m, #mtrace_off#m
//trace_off
#cenable_menu_item (?m1, &Copy).
Format is 'trace_off ( ) .'.#c
Format trace_off ( )
Action Stops tracing the execution of a knowledge base.
See Also #mtrace#m
//typeface_list
#cenable_menu_item (?m1, &Copy).
Format is 'typeface_list (DEVICE).'.#c
Format typeface_list (DEVICE)
Action Used to find the name of the typefaces available for
a device.
Parameters DEVICE either [ ], for the display or PRN for
the printer.
Returns A list of type face names available for the device.
Any of these typefaces can be used in create_font.
Errors I_PRINT_NO_DC
See Also #mcreate_font#m, #mfont_list#m, #muse_font#m
//uncheck_menu_item
#cenable_menu_item (?m1, &Copy).
Format is 'uncheck_menu_item (HANDLE, ITEM).'.#c
Format uncheck_menu_item (HANDLE, ITEM)
Action The check mark next to the specified menu item is
removed.
Parameters HANDLE is the handle of the menu that contains the
ITEM to be unchecked.
ITEM is the name of a menu item, or list of items.
Note This command has no effect if the menu item is not
checked.
Errors I_NO_MENU, I_INVALID_WINDOW, I_MENU_NOT_FOUND
See Also #mcheck_menu_item#m, #mdisable_menu_item#m,
#menable_menu_item#m, #mmenu#m
//union
#cenable_menu_item (?m1, &Copy).
Format is 'union (LIST1{,LIST2, LIST3...}) .'.#c
Format union (LIST1{,LIST2, LIST3...})
Action This function produces a list of items that
contains the union of two or more lists of items.
This is different from combine in that duplicate
items are not kept on the list produced.
Parameters LIST1 {, LIST2, LIST3 ...} are the lists to be
united.
Returns A list of all of the items that appear on the
specified lists. The resulting list contains no
duplicates.
Note union can be used to remove duplicate items from a
list. For example,
x is union ([a,a,b,c,c,d]).
x is assigned the value [a,b,c,d ] .
See Also #mcombine#m
//update_window
#cenable_menu_item (?m1, &Copy).
Format is 'update_window ({HANDLE}).'.#c
Format update_window ({HANDLE})
Action Updates the window or screen object by repainting it.
Windows are not normally painted until KnowledgePro
enters a wait loop or reaches the end of the
knowledge base. This means that messages written to
windows do not appear immediately. update_window can
be used to force KnowledgePro to paint a window or
screen object immediately.
Parameters HANDLE is the handle or list of handles of a window
or screen object. The default is the current
display window.
Error I_INVALID_WINDOW
See Also #mshow_window#m, #mset_active_window#m,
#mset_top_window#m
//upper
#cenable_menu_item (?m1, &Copy).
Format is 'upper (TEXT).'.#c
Format upper (TEXT)
Action Converts the string or a list of strings to upper
case.
Parameters TEXT is a text string or list of strings.
Returns A new string or list of strings with characters in
the range "a" to "z" converted to the range "A" to
"Z".
See Also #mlower#m
//use_font
#cenable_menu_item (?m1, &Copy).
Format is 'use_font (FONT_HANDLE {, DEVICE}).'.#c
Format use_font (FONT_HANDLE {, DEVICE})
Action All further text output is written with the specified
font.
Parameters FONT_HANDLE the handle of a font created with
create_font or one of the following standard fonts:
OEM_FIXED_FONT
specifies a fixed width font using the OEM character set.
ANSI_FIXED_FONT
specifies a fixed width font using the ANSI character set.
ANSI_VAR_FONT
specifies a variable width font using the ANSI character set.
DEVICE_DEFAULT_FONT
the most appropriate font for the specified device
SYSTEM_FONT
specifies the system font. This is the default.
DEVICE
selects the device which will use the font.
Use [ ] for the display or PRN for the printer.
Fonts can only be printed using print.
Returns The font handle.
Errors I_INVALID_FONT
//user
#cenable_menu_item (?m1, &Copy).
Format is 'user (DLL_HANDLE, FUNCTION, PARAMETERS).'.#c
Format user (DLL_HANDLE, FUNCTION, PARAMETERS)
Action Calls a function in the dynamic link library (DLL),
passing it PARAMETERS.
Parameters DLL_HANDLE is the handle of a DLL, previously loaded
by load_library. If this parameter is a list, only
the first element is used.
FUNCTION is the name or ordinal value of an exported
function from the DLL If this parameter is a list,
each function is called and passed parameters.
PARAMETERS are optional values which may be passed to
the external function.
Returns The value returned from FUNCTION.
Note Due to a problem in Microsoft Windows 2.1, Microsoft
recommends exporting functions from a DLL by ordinal
value rather than by name. Windows does not always
properly maintain the names of exported functions.
KnowledgePro reports this error as
I_INT_MEMORY_ERR.
Errors I_INVALID_FUNCTION, I_INVALID_LIBRARY
USER will also returns errors from functions.
See Also #mload_library#m
//value_of
#cenable_menu_item (?m1, &Copy).
Format is 'value_of (TOPIC {,PARAMETER1, PARAMETER2 ,...}).'.#c
Format value_of (TOPIC {,PARAMETER1, PARAMETER2 ,...})
Alternate ?TOPIC ({PARAMETER1, PARAMETER2,...})
Action Find the list of items assigned to a topic. If TOPIC
has already been evaluated, the current value is
returned. The system searches the hierarchy for
TOPIC. If TOPIC is not yet evaluated, the commands
associated with it are immediately executed until the
maximum number of legal values for the topic has
been reached, or an exit, stop, exit_kp or
exit_windows is executed.
If the number of legal values was not set, all of
the commands in the topic are executed. This
command implements a backward chaining function.
The optional PARAMETERS are parameters which can be
passed to the topic if it is evaluated at this
time. If TOPIC can't be found, an error message is
given.
Parameters TOPIC is a topic or list of topics whose values you
want to find. If these values have not yet
been determined the topics' commands are executed.
{PARAMETER1, PARAMETER2 , ... } are parameters
passed to TOPIC when it is executed.
Returns The value or list of values of the specified
topic or topics.
Note ?x(a,b)
is equivalent to
do (?x,a,b).
x is evaluated and then the result of this evaluation
is passed the parameter a and b and is executed.
?(x(a,b))
is evaluated to
value_of (do (x,a,b)).
Error I_V_TOPIC_NOT_FOUND
//vert_scroll_bar
#cenable_menu_item (?m1, &Copy).
Format is 'vert_scroll_bar ({EVENT_TOPIC, COLUMN, ROW, WIDTH, HEIGHT, MINIMUM, MAXIMUM, EVENT_LIST}).'.#c
Format vert_scroll_bar ({EVENT_TOPIC, COLUMN, ROW, WIDTH,
HEIGHT, MINIMUM, MAXIMUM, EVENT_LIST})
Action Creates a vertical scroll bar at COLUMN, ROW
position in the current display window. The scroll
bar slider is moved with the mouse or with the cursor
keys.
Parameters EVENT_TOPIC is the topic or list of topics performed
when an event on the EVENT_LIST occurs while the
focus is on the scroll bar. EVENT_TOPIC is called as:
EVENT_TOPIC (EVENT_INFO,EVENT_NAME,HANDLE).
EVENT_INFO depends on the event that occurs. A
description of events is given in Appendix D.
EVENT_NAME is the name of the event that occurred.
HANDLE is the handle assigned to the scroll bar.
If EVENT_TOPIC sets its value to true after being
called by a lose_focus_event, close_event,
char_event, or a sys_char_event, further processing
of the event is canceled before it is executed.
Whenever EVENT_TOPIC is called its value is reset.
If no EVENT_TOPIC is defined, no events are
recognized.
COLUMN, ROW is the position of the scroll bar. The
default is the current display location. COLUMN and
ROW are relative to the display area of the current
display window.
WIDTH, HEIGHT is width and height of the scroll bar.
The default is 1, 20.
MINIMUM, MAXIMUM is the minimum and maximum slider
values. The default is 0, 100. MINIMUM and MAXIMUM
can take on values between -32768 and 32767. If
either of these parameters is a list, only the first
element is used.
EVENT_TOPIC is a list of events that causes the
EVENT_TOPIC to be called. The events that can be
processed are:
get_focus_event, lose_focus_event, close_event
char_event, sys_char_event, scroll_event These events
are described in detail in Appendix D. If no event is
specified, the default event is a scroll_event.
Returns HANDLE, the handle of the scroll bar.
Note To get the value of a scroll bar use get_scroll_bar.
To set the position of a scroll bar use
set_scroll_pos.
See Also #mget_scroll_bar#m, #mset_scroll_bar#m,
#mhorz_scroll_bar#m, #mDescription of Events#m
//vert_scroll_text
#cenable_menu_item (?m1, &Copy).
Format is 'vert_scroll_text (HANDLE, LINES).'.#c
Format vert_scroll_text (HANDLE, LINES)
Action Scrolls the window the appropriate number of lines.
The window is not scroll beyond the last line
currently displayed in the window.
Parameters HANDLE is the handle of a window, or list of handles.
LINES is the number of lines to scroll, negative to
scroll the window up, positive to scroll down.
Returns The co-ordinates of the upper left hand corner of the
window.
Errors I_INVALID_WINDOW
//wait
#cenable_menu_item (?m1, &Copy).
Format is 'wait ({TEXT, TIME}).'.#c
Format wait ({TEXT, TIME})
Action wait prevents the next topic in the knowledge base
from being called. Events are processed during the
wait. When wait is passed an optional TEXT
parameter, a small windows with a button labeled with
TEXT is placed at the bottom right of the screen.
When the button in the window is selected the wait is
canceled. When wait is passed an optional parameter
TIME, the knowledge base pauses for TIME seconds, and
then automatically continues. If neither parameter
is passed to wait, then the continue command must be
called to cancel wait and resume normal processing of
the knowledge base topics.
Parameters TEXT causes a small window with a button labeled TEXT
to be placed at the bottom right of the screen. If
this item is a list, only the first element is used.
If it is [ ], no window appears.
TIME is the time in seconds to wait. The time
waited is in increments of a tenth of a second, and
the shortest time waited is one tenth of a second.
After TIME seconds, the wait is canceled. All events
which occurred but were not processed before the wait
are processed during the wait, even if TIME elapses
while processing those events.
Returns This function does not return until TIME expires or
the topic continue is called from the knowledge base
as a result of a user action. If canceled by
continue, wait returns a number passed to it by
continue. This number can let you keep track of
which continue canceled the wait.
Note When multiple wait calls are being processed, only
the most recently executed wait is active. You must
close the wait windows in order. Attempts to close
any but the most recent wait window are ignored.
See Also #mcontinue#m
//where
#cenable_menu_item (?m1, &Copy).
Format is 'where (LIST, VALUES{, COUNT}).'.#c
Format where (LIST, VALUES{, COUNT})
Action Finds the position of an element or list of elements
in a list.
Parameters LIST is the list to be searched for the occurrence
of the items specified by VALUES.
VALUES is the list of items to search for in LIST.
COUNT specifies the number of searches to do . If
you want to search for all occurrences of an item,
enter a large number such as 32000 for COUNT.
Returns The position in LIST of VALUES. When VALUES is
not found on LIST , a 0 is returned. The first
element in a list is at position 1. If INTEGER is
used, a list of the locations is returned. When
INTEGER is present, it must be in the range 1 to
32767. If INTEGER is not present, it is assumed to
be one.
Errors I_INVALID_COUNT, I_INVALID_ELEMENT
//while
#cenable_menu_item (?m1, &Copy).
Format is 'while (CONDITION, COMMANDS).'.#c
Format while (CONDITION, COMMANDS)
Alternate while CONDITION then COMMANDS
Action This topic tests CONDITION. If the value of
CONDITION is true, a COMMANDS is performed.
CONDITION is tested again and if CONDITION is still
true, the commands are repeated. This sequence is
repeated until CONDITION becomes false.
Parameters CONDITION is an expression that evaluates to a
boolean value. If the expression results in a list
of values, all values on the list must be true for
the expression to be true.
COMMANDS is a command or list of commands to be
performed as long as the boolean expression remains
true.
See Also #mrepeat#m
//window
#cenable_menu_item (?m1, &Copy).
Format is 'window ({EVENT_TOPIC, COLUMN, ROW, WIDTH, HEIGHT, TITLE, STYLE, PARENT, TEXTCOLOR, BACKGROUNDCOLOR, EVENT_LIST}).'.#c
Format window ({EVENT_TOPIC, COLUMN, ROW, WIDTH, HEIGHT,
TITLE, STYLE, PARENT, TEXTCOLOR,
BACKGROUNDCOLOR, EVENT_LIST})
Action Creates a window with the specified parameters. The
new window becomes the current display window. If a
Visible style is included, it is also the active
window.
Parameters EVENT_TOPIC is the topic or list of topics performed
when an event on the EVENT_LIST occurs while the
focus is on the window. EVENT_TOPIC is called as:
EVENT_TOPIC (EVENT_INFO,EVENT_NAME,HANDLE).
EVENT_INFO depends on the event that occurs. A
description of events is given in Appendix D.
EVENT_NAME is the name of the event that occurred.
HANDLE is the handle assigned to the WINDOW. If
EVENT_TOPIC sets its value to true after being called
by a lose_focus_event, close_event, char_event, or a
sys_char_event, further processing of the event is
canceled before it is executed. Whenever
EVENT_TOPIC is called its value is reset. If
no EVENT_TOPIC is defined, no events are recognized.
COLUMN, ROW is the position of upper left corner of
the window frame in system character co-ordinates. If
the window has a Child style, COLUMN and ROW are
relative to the upper left corner of the parent. If
the window has an Overlapped or PopUp style or is the
default style, COLUMN and ROW are relative to the
upper left corner of the screen. Decimal values can
be used.
WIDTH, HEIGHT is the width and height of the window
in system character co-ordinates. Decimal values can
be used.
TITLE is the window title. It can contain up to 80
characters. If this parameter is a list, only the
first element is used.
STYLE is a list of styles for the window. Styles can
be selected from the following list:
Type Overlapped
PopUp
Child
Initial state Visible
Disabled
Maximized
Special elements TitleBar
VertScroll
HorzScroll
ControlMenu
MaximizeBox
MinimizeBox
Frame ThinFrame
ThickFrame
DialogFrame
Treatment of
related windows ShowChildren
Siblings
Combined styles
OverlappedWindow contains the styles:
[Overlapped, ThickFrame, ControlMenu, MaximizeBox,
MinimizeBox, ShowChildren, TitleBar]
PopupWindow contains the styles:
[Popup, ThickFrame, ShowChildren]
ChildWindow contains the styles:
[Child, ThinFrame, ShowChildren, Siblings]
DialogWindow contains the styles:
[Popup, DialogFrame, ShowChildren]
The default style for a display window is
[Popup, Visible, Siblings, ShowChildren, TitleBar,
VertScroll, HorzScroll, ControlMenu]
Combining inappropriate styles may cause unexpected
results.
PARENT is the handle of the window's parent. An
Overlapped window cannot have a parent. A Child
style must be assigned a parent. The window has no
parent as a default. If this parameter is a list,
only the first element is used.
TEXTCOLOR is the RGB value of the color of the text
or one of the predefined colors listed below. If
this parameter is a list, only the first element is
used.
black, blue, green, red, magenta, cyan, yellow, white
BACKCOLOR is the RGB value of the color of the window
background or one of the predefined colors listed
below.
Solid colors
black, blue, green, red, magenta, cyan, yellow,
white, darkblue, brown, darkpurple, purple, pink,
bluegreen, brightgreen, lightgreen, lightblue,
lightyellow
Composite colors
blue2, green2, orange, magenta2, bluegreen2,
mossgreen, gray, purple2, pink2
EVENT_LIST is a list of events that cause the
EVENT_TOPIC to be called. The events that can be
processed are:
get_focus_event, lose_focus_event, close_event,
char_event, sys_char_event, move_event,
resize_event, horz_scroll_event, vert_scroll_event
These events are described in detail in Appendix D.
If no event is specified, the EVENT_TOPIC is not
called.
Returns The window handle.
See Also #mclose_window#m, #mshow_window#m, #mmake_modal#m,
#mmove_windows#m, #mattach_icon#m, #mDescription of Events#m
//window_info
#cenable_menu_item (?m1, &Copy).
Format is 'window_info (HANDLE).'.#c
Format window_info (HANDLE)
Parameters HANDLE is the handle or list of handles. If no
HANDLE is given, the active window is used.
Action Provides information about the specified window.
Returns A list containing:
Element Contents
1 column of the upper left corner of
the window
2 row of the upper left corner of the window
3 width of the window
4 height of the window
5 the window class. The class defines how a
window looks and behaves. KnowledgePro classes
are 'KP Display', 'KP Edit', Button, Listbox,
Scrollbar and Edit. Other applications may have
their own unique classes.
6 a number representing the window style
7 the handle of the window's parent. [] if the
window has no parent
8 the window's title or if the window is a control,
the text of the window
9 the handle of the window
The column, row, width and height are all measured in
system characters.
Errors I_INVALID_WINDOW
//window_list
#cenable_menu_item (?m1, &Copy).
Format is 'window_list ( ).'.#c
Format window_list ( )
Action Finds a list of the display windows that have been
opened in a knowledge base.
Returns The list of handles of the display windows that
have been opened in the application. Window
handles are returned in the order in which they were
opened.
//write
#cenable_menu_item (?m1, &Copy).
Format is 'write (FILE, TEXT).'.#c
Format write (FILE, TEXT)
Action Writes text to a file. If you write to a file that
has not yet been opened, it is automatically
opened and the lines are appended to the end of the
file. If the file does not exist it is created. If
you want to write over an existing file, you must
use the new_file topic to re-initialize the file.
write can also be used to send text to these devices:
PRN or LST: printer
CON or CON: screen
AUX or AUX: communications PORT1, COM1
Parameters FILE is the name of the file or list of files.
TEXT is the text to write to the file. The text
may include embedded control codes. The following
codes are available:
##n start a new line
##p start a new page
##l put each list item on a new line (default)
##s put each list item on the same line
##o no spaces after a list item
##i insert a space after each list item (default)
##t tab five spaces
#### display the character ##
##INTEGER print the ASCII character of INTEGER
##cTEXT##c TEXT is compiled and evaluated
##vTEXT##v TEXT is compiled, evaluated and any value
returned is displayed
When writing to the screen, these codes can also be
included:
##e erase the contents of the window
##m begin or end marked text
##xINTEGER move to column INTEGER
##yINTEGER move to row INTEGER
##fCOLOR change foreground color to COLOR
##cCOLOR change background color to COLOR
For screen or printer:
##gHANDLE display a bitmap. HANDLE is the handle
returned by load_bitmap.
Returns True if the write is successfully completed. False if
the write can not be carried out.
Error I_CANT_OPEN, I_CANT_CREATE_TEMP_FILE, I_CANT_WRITE,
I_MISSING_HASHC, I_CANT_CLOSE
If the file doesn't exist, write calls the system
topic new_file which can produce its own error
messages.
Note Text sent to the printer with write can't display
fonts or use ##x and ##y. Use print for this
functionality.
See Also #mtext#m, #mprint#m
//Description of Events
Events recognized by all windows and screen objects
#mchar_event#m
#mclose_event#m
#mget_focus_event#m
#mlose_focus_event#m
#msys_char_event#m
Events recognized by display and edit windows
#mmove_event#m
#mresize_event#m
#mhorz_scroll_event#m
#mvert_scroll_event#m
Events recognized by screen objects
#mdouble_click_event#m
#mlist_select_event#m
#mselect_event#m
#mscroll_event#m
//get_focus_event
get_focus_event
Recognized by: All windows and screen objects.
Description: A get_focus_event occurs when a window or
screen object becomes the focus of user input.
When a screen object gets the focus a dotted
rectangular cursor appears in it. When a
window gets the focus, the text cursor appears
inside it.
Mouse: Click the mouse directly on the screen object
or window. If you click on a screen object,
the object, not the window containing it, gets
the focus. To place the focus in the window,
click on any area which does not contain a
screen object. In some screen objects a mouse
click also cause the following events to occur:
button, check box, select_event
radio button
list box list_select_event
scroll bar scroll_event
Any mouse action which closes a window causes
the last window that had the focus to receive a
get_focus_event and be made the active window.
Keyboard: Press TAB or SHIFT TAB to move the focus within
a window. In a newly created window the cursor
is in the upper left corner of the window.
When TAB is pressed the focus moves through
hypertext and then through the screen objects
in the order they were created and then back to
the window. SHIFT TAB moves in the reverse
order. The cursor keys move the focus through
a group of radio buttons.
When F6 is pressed, the focus moves to the next
display window in the application. Screen
objects do not receive a get_focus_event when
F6 is pressed. Any keyboard action that closes
a window causes the last window to have the
focus to receive a get_focus_event.
CTRL F6 moves between the application and the
development environment.
If a different Windows application is selected
the screen object or window that has the focus
receives a lose_focus_event. If you press ALT
TAB from the other application, the window or
screen object that lost the focus receives a
get_focus_event when you return to the
knowledge base.
Knowledge Base: set_focus moves the focus to the the specified
screen object. This object receives a
get_focus_event. A window receives a
get_focus_event whenever it becomes the active
window. A window becomes the active window
when:
it is made the active window with
set_active_windows
it is shown using show_window with a display
code of 1, 2, 3 or 5.
the currently active window is closed and the
window was the last window that was active.
When a child window is made the top window with
set_top_window it receives a get_focus_event.
Info Passed: The empty list, [ ].
//lose_focus_event
lose_focus_event
Recognized by: All windows and screen objects
Description: A lose_focus_event occurs when a window or
object is about to lose the focus.
This occurs when the focus is moved to another
window or screen object in the knowledge base
to the development environment or to another
Windows application. The last window or screen
object to have the focus is the one which
receives the lose_focus. Whenever a window is
closed, any object in it that had the focus
loses the focus as well as the window itself.
A lose_focus_event can be canceled by setting
the value of the event handling topic to true.
This causes the focus to be re-set to the
object.
Mouse: Click the mouse on any other screen object.
Use the mouse to close the window or the window
containing a screen object with the focus.
Keyboard: Press TAB or SHIFT TAB. In an edit line,
press ENTER. In a group of radio buttons press
any cursor key. Press F6 to move the focus to a
new window.
Press CTRL F6 to move the focus to the
development environment. Press ALT TAB to move
to another Windows application. Use the
keyboard to close the window with the focus or
the window containing the screen object which
has the focus.
Knowledge Base: set_focus to a different screen object.
close_window to close the object or the window
containing the screen object with the focus.
Make a new window the active window using
set_active_window or show_window with a display
code of 1, 2, 3, or 5. Make a child window the
top window using set_top_window.
Info Passed: The empty list, [ ].
//close_event
close_event
Recognized by: All window and screen objects
Description: A close_event occurs when a window or screen
object is removed from the screen. When a
window is closed, all child windows and screen
objects are also closed. A close_event can be
canceled by setting the value of the event
handling topic to true.
Mouse: Close a window using the control menu.
Keyboard: Close the window using the control menu.
Knowledge Base: close_window
Info Passed: The empty list, [ ].
//char_event
char_event
Recognized by: All window and screen objects
Description: A char_event occurs whenever a key which
generates an ASCII code is passed. The screen
object or window which has the focus receives
the event. A char_event can be canceled by
setting the value of the event handling topic
to true.
Keyboard: Press a key or combination of keys that return
an ASCII value.
Info Passed: The ASCII value of the key or keys pressed.
//sys_char_event
sys_char_event
Recognized by: All window and screen objects
Description: The window or screen object with the focus
receives a sys_char_event whenever certain
combinations of ALT, FUNCTION KEY, CURSOR KEYS,
CTRL and SHIFT are passed. A sys_char_event
can be canceled by setting the value of the
event handling topic to true.
Keyboard: CURSOR KEY, FUNCTION KEY, ALT, SHIFT, CTRL and
combinations of these keys
Info Passed: A string containing the names of each key
pressed followed by a space. Key names are
shown in Appendix C.
//move_event
move_event
Recognized by: Windows and edit windows created with
edit_window and edit_file.
Description: A move_event occurs when a window or an edit
window with the focus is moved. Windows can
be moved by the user or under knowledge base
control.
Mouse: Move the window. If the window did not have
the focus, it also receives a get_focus_event
and the last object or window to have the focus
receives a lose_focus_event.
Keyboard: Move a window or edit window using the Control
Menu.
Knowledge Base: move_window, show_window with a display code
which changes the location of the window.
Info Passed: a list containing the new column and row.
//resize_event
resize_event
Recognized by: Windows and edit windows created with
edit_window and edit_file.
Description: A resize_event occurs when a window or an edit
window with the focus is resized. This can be
done by the user or under knowledge base
control.
Mouse: Move the window. If the window did not have
the focus, it also receives a get_focus_event
and the last object or window to have the focus
receives a lose_focus_event.
Keyboard: Resize a window or edit window using the
Control Menu.
Knowledge Base: resize_window, show_window with a display code
which changes the size of the window.
Info Passed: A list containing the new width, the new height
and a code describing the state of the window.
The possible codes are:
0 resized
1 iconic
2 maximized
3 another window maximized
4 another window restored from an icon
Codes 3 and 4 occur when the size of the window
is changed as the result of another window
being maximized or restored.
//horz_scroll_event
horz_scroll_event
Recognized by: Windows and edit windows created with
edit_window and edit_file.
Description: A horz_scroll_event occurs when the window or
edit window with the focus is scrolled using
window scroll bars or under knowledge base
control. If a window which does not have the
focus is moved using the mouse, it also
receives a get_focus_event and the last object
or window to have the focus receives a
lose_focus_event.
Mouse: Click on the horizontal scroll bar. If the
window did not have the focus, it also receives
a get_focus_event and the last object or window
to have the focus receives a lose_focus_event.
Keyboard: RIGHT ARROW, LEFT ARROW, END, HOME, typing text
that extends beyond the right edge of the
screen object
Knowledge Base: horz_scroll_text
Info Passed: The number of characters scrolled. This number
is negative when the text scrolls to the left.
//vert_scroll_event
vert_scroll_event
Recognized by: Windows and edit windows created with
edit_window and edit_file.
Description: A vert_scroll_event occurs when the window or
edit window with the focus is scrolled using
window scroll bars or under knowledge base
control.
Mouse: Click on the vertical scroll bar. If a window
which does not have the focus is moved using
the mouse, it also receives a get_focus_event
and the last object or window to have the focus
receives a lose_focus_event.
Keyboard: UP ARROW, DOWN ARROW, PGUP, PGDN, CTRL PGUP,
CTRL PGDN, typing text that extends below the
bottom edge of the screen object
Knowledge Base: vert_scroll_text
Info Passed: The number of lines scrolled. This number is
negative when the text scrolls up.
//select_event
select_event
Recognized by: button, check box, radio button
Description: A select_event occurs when a button, check box
or radio button is selected by the user.
Mouse: Click on the object. This causes both a
select_event and a get_focus_event to occur.
Keyboard: TAB or SHIFT TAB is used to move the focus to
the object. ENTER or SPACE BAR are used to
select a button or a check box. When TAB or
SHIFT TAB moves to a group of radio buttons, it
goes to the currently selected radio button or,
if none is selected, the first of the group.
Once the focus is on one of a group of radio
buttons, the cursor keys move through the radio
buttons creating both a get_focus_event and a
select_event at each move.
Info Passed: The text of the object selected
//list_select_event
list_select_event
Recognized by: list box
Description: When the focus is on a list box and an item in
the list box is highlighted, a
list_select_event occurs. List boxes can be
defined to allow one or many items to be
highlighted.
Mouse: Click the mouse on an item in the list box. To
highlight several items, hold down the shift
key while clicking the mouse. If the list box
did not have the focus, a get_focus_event also
occurs.
Keyboard: Press the CURSOR KEYS to move the highlight
through the list box. To highlight several
items, hold down the CTRL key and press the
CURSOR KEYS to move a dotted cursor through the
items. Press SPACE to highlight the item.
Info Passed: A list of the selected items.
//double_click_event
double_click_event
Recognized by: list box
Description: A double_click_event occurs when the
highlighted items in the list box with the
focus are selected.
Mouse: Double click to select a single item. Hold
down the SPACE BAR and double click to select
multiple items. If the list box did not have
the focus, a get_focus_event also occurs.
Keyboard: Press ENTER
Info Passed: The items selected
//scroll_event
scroll_event
Recognized by: scroll bars
Description: A scroll event occurs when the slider on a
vertical or horizontal scroll bar is moved.
Mouse: Click on scroll bar. If the scroll bar did not
have the focus, a get_focus_event also occurs.
Keyboard: CURSOR KEY
Info Passed: The location of the slider.
//