home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / windows / kpwdemo.zip / DEMO.HYP < prev    next >
Text File  |  1990-06-28  |  12KB  |  355 lines

  1. //Features
  2.  
  3.  Point and click for information on the following features:
  4.  
  5.          #mScreen Design#m
  6.          #mHypertext#m
  7.          #mGraphics#m
  8.          #mText Handling#m
  9.          #mCalling Other Programs#m
  10.          #mObject-Oriented Programming#m
  11.          #mList Manipulation#m
  12.          #mExpert Systems#m
  13.          #mDDE#m
  14.          #mDLL#m
  15.  
  16. //Screen Design
  17.  
  18.  Using KnowledgePro (Windows), all Windows screen objects can
  19.  be created with a single line of code.  For example:
  20.     
  21.       button (Print, goPrint, 10, 5).
  22.  
  23.  creates a button with the text Print at column 10 row 5.  
  24.  When the button is selected, the topic goPrint is called.  
  25.  Perhaps goPrint may print the contents of a file:
  26.  
  27.       topic goPrint.
  28.          print (read (myfile)).
  29.       end.
  30.  
  31.  The tool DESIGN is included to help you design 
  32.  attractive screen displays. Screen objects can be created, 
  33.  moved and edited on screen. The code to create the screen is 
  34.  produced and can be copied directly into your application.  
  35.  Select HELP in DESIGN for a description of how to use the 
  36.  application and how to link screen objects to topics.
  37.  
  38. //Text Handling
  39.  
  40.  A full set of string handling and text file searching functions 
  41.  makes KnowledgePro adept at handling text.  
  42.  
  43.  Text files can be read by characters, lines or beginning and 
  44.  ending with a specified search string.  For example, consider 
  45.  the command:
  46.    
  47.       text (read (myfile, ##n##n, ##n##n, PRESIDENT)).
  48.  
  49.  This will display the first paragraph in MYFILE which contains 
  50.  the word PRESIDENT. ##n is a line feed so ##n##n  means that a 
  51.  paragraph ends with a blank line.  
  52.    
  53.  Text can also be replaced.  This command replaces PRESIDENT 
  54.  with CHAIRMAN in the entire text file:
  55.  
  56.       newText is read (MYFILE,,,PRESIDENT,CHAIRMAN).
  57.  
  58.  If you want to over-write the old file you can use WRITE:
  59.  
  60.       new_file (MYFILE).
  61.       write (MYFILE, ?newText).
  62.  
  63.  Once text is read in it can be manipulated using the string 
  64.  handling functions.  You can search for certain characters 
  65.  within a string:
  66.  
  67.       x is 'this is a sample string'.
  68.       find is string_where (?x, am).
  69.  
  70.  The topic FIND is assigned the value 12 which is the 
  71.  starting position of the string.
  72.  
  73.  You can concatenate strings:
  74.  
  75.       x is TOM.
  76.       y is concat ('HELLO ',?x).
  77.  
  78.  y is assigned the new string 'HELLO TOM'.
  79.  
  80.  Characters in strings can be replaced by others:
  81.  
  82.       x is 'THIS IS A TEST'.
  83.       y is string_replace (?x,IS, 'IS NOT').
  84.  
  85.  The value of x is changed to 'THIS IS NOT A TEST'.
  86.  
  87.  Strings can be changed into lists of words or characters for 
  88.  added flexibility.
  89.  
  90.  Using the string handling functions, KnowledgePro can create 
  91.  files, code, and DDE commands to front end other programs.  For 
  92.  example, we've heard from several users who have used 
  93.  KnowledgePro as a front end for neural net programs, databases 
  94.  and statistical analysis programs.  At the back end, 
  95.  KnowledgePro can read the output from other programs, interpret 
  96.  it and present it to the user intelligently based on other 
  97.  information gathered in the application. 
  98.  
  99.    #mString Handling and File Access Functions#m
  100.  
  101. //Calling Other Programs
  102.  
  103.  Using KnowledgePro you can load, run and interact with
  104.  other Windows applications.  #mDDE#m is supported, allowing 
  105.  you to exchange data with windows programs.
  106.  
  107.  You can also run DOS programs and Dynamic Link Libraries (#mDLL#m) 
  108.  from within KnowledgePro.
  109.  
  110. //Object-oriented Programming
  111.  
  112.  A topic is a type of object.  It can inherit values from one or 
  113.  more other topics and commands.  For example, if the topic A has
  114.  the following structure:
  115.  
  116.       topic A.
  117.          text (hello).
  118.  
  119.          topic B.
  120.          end.
  121.  
  122.          topic C.
  123.          end.
  124.      end.
  125.  
  126.  We can create a new topic D which inherits all of topic A's 
  127.  properties:
  128.  
  129.       new (D,A).
  130.  
  131.  Topic D can be called an instance of topic A.   When topic D is 
  132.  created, all of the sub-topics of A along with their properties, 
  133.  values and attached commands are copied into the hierarchy 
  134.  of D.  Next, the commands attached to A are copied into D 
  135.  and executed.
  136.  
  137.  A sub-class of a topic can also be executed:
  138.  
  139.       topic E.
  140.          im_a (A).
  141.      
  142.          topic (B).
  143.          end.
  144.  
  145.      end.
  146.  
  147.  When E is executed the im_a makes it a sub-class of A.  This 
  148.  means that all of A's sub-topics which do not already exist in 
  149.  E are copied.  Since E already has a sub-topic B, that is not 
  150.  copied.  This permits sub-classes to have certain behaviors 
  151.  that are unique from the general class.  Next, the commands 
  152.  attached to A are copied to the end of the commands already in 
  153.  E and are performed when they are reached.
  154.  
  155.  Object-oriented programming puts a twist on the way you think 
  156.  about programs but, if you're doing complicated programs it's 
  157.  worth the effort.  It is especially helpful in programs where 
  158.  certain procedures are performed repetitively but with a slight 
  159.  difference each time.
  160.  
  161.  On those occasions when you find yourself trying to decide 
  162.  whether to duplicate code or to put in flags to signify special 
  163.  cases, think about a switch to an object oriented approach.
  164.  
  165.  Chapter 6 of the user's manual contains two detailed examples 
  166.  of object-oriented programs and, for you experienced 
  167.  programmers, DESIGN, which is included with this demo,
  168.  is almost entirely based on object-oriented techniques.
  169.  
  170. //DDE
  171.  
  172.  KnowledgePro can be used to send DDE messages to other 
  173.  applications or, in the development environment, can receive 
  174.  DDE messages to execute any knowledge base commands.
  175.  
  176.  If you have Microsoft Excel in a directory which is included in
  177.  your path you can #mclick here#m to see an example of DDE
  178.  which is provided in the application DDESHOW.SRC.
  179.  
  180.  Here's a simple example of the use of DDE to install an icon on 
  181.  the Windows 3.0 program manager:
  182.  
  183.      channel is dde_open (dde_topic, progman, progman).
  184.      command1 is '[ShowGroup(Windows Applications,2)]'.
  185.      command2 is '[ShowGroup(Windows Applications,1)]'.
  186.      command3 is '[AddItem(\kpwin\kpwin.exe,KnowledgePro,\kpwin\kpwin.ico)]'.
  187.      dde_execute (?channel,[?command1,?command2,?command3]).
  188.  
  189.      topic dde_topic.
  190.      end.
  191.  
  192.  The format of the information passed to dde_open depends
  193.  on the server application, in this case the Program Manager.
  194.  The handle of the channel is stored here in the topic channel.  
  195.  This handle is used to refer to the open channel.  We execute
  196.  one command to show the Program Group and then install the 
  197.  icon.  The syntax of the information is provided by the server 
  198.  application.
  199.  
  200.  Since Windows applications can be run from KnowledgePro, 
  201.  their windows manipulated and data passed using DDE, 
  202.  KnowledgePro can be used to seamlessly link together any 
  203.  Windows applications which support DDE.  
  204.  
  205.  DOS applications can be run from KnowledgePro and data 
  206.  exchanged via text files, allowing them to be included as need.
  207.  
  208. //DLL
  209.  
  210.  KnowledgePro supports dynamic link libraries, enabling you to 
  211.  directly extend its functionality.  Included with the full system 
  212.  are a collection of source files for creating user-defined functions.  
  213.  These are contained in the files LIBINIT.ASM, KPDEFS.H, 
  214.  KPUTIL.C, KPUSER.C, KPUSER.DEF and KPUSER.MAK.  These 
  215.  are discussed in detail in Chapter 8 of the user's manual.
  216.  
  217.  We have used DLL libraries to create KnowledgePro functions 
  218.  for accessing full-motion video, and integrating the code supplied 
  219.  by vendors was accomplished in just a few hours.
  220.  
  221.  As Windows toolkits proliferate, DLL libraries will become an 
  222.  exciting way to enhance the system.
  223.  
  224. //List Manipulation
  225.  
  226.  Lists are an important part of KnowledgePro.  They let you 
  227.  compare, match and keep track of information.  For example:
  228.  
  229.       choices is [DESIGN,FONT,COLOR].
  230.       kbs is ['DESIGN.KB','FONT.KB','COLOR.KB'].
  231.       ask ('Which would you like to see?', want,?choices).
  232.       new_kb (element (?kbs, where (?choices, ?want))).
  233.  
  234.  Here, ASK puts a question on the screen along with a list box 
  235.  of possible answers which are defined in the topic CHOICES. The 
  236.  answer selected is saved in the topic WANT.  
  237.  
  238.  We search the list of choices to find where the user's selection 
  239.  occurred and load the knowledge base that matches that choice.
  240.  
  241.  Many things that can be done to one item can also de done to a 
  242.  list of items:
  243.  
  244.       message is read ([FILE1, FILE2]).
  245.  
  246.  This reads the contents of each of the named files into the 
  247.  topic MESSAGE.  In the next example, each topic in the first 
  248.  list is assigned the corresponding value from the second list:
  249.  
  250.       [a,b,c,d] is_c [1,2,3,4].
  251.  
  252.  Lists can also be turned into strings of text and characters and 
  253.  strings can be turned into lists.  This is very powerful for 
  254.  analyzing and manipulating text files.
  255.  
  256.    #mList handling commands#m
  257.  
  258. //List handling commands
  259.  
  260.    Lists
  261.  
  262.      Find: 
  263.        First item #x40first
  264.        Last item #x40last 
  265.        Specific item #x40element   
  266.        All except #x40rest 
  267.        Length of a list #x40list_length
  268.        Where an item is on a list #x40where
  269.        If an item is on a list #x40one_of 
  270.  
  271.      Sort: 
  272.        Alphabetic #x40sort 
  273.        Numeric #x40numeric_sort   
  274.  
  275.      New lists From old: 
  276.        Remove an item #x40remove 
  277.        Replace matching items #x40replace
  278.        Replace specific elements #x40replace_elements
  279.        Items not shared by lists #x40different
  280.        Items on all lists #x40intersect  
  281.        Sublist #x40sublist
  282.        Combine lists #x40combine  
  283.        Combine lists, no doubles #x40union 
  284.  
  285.  
  286. //String Handling and File Access Functions
  287.  
  288.    Find: 
  289.  
  290.      Length #x40string_length 
  291.      Location of a substring #x40string_where 
  292.      Concatenate #x40concat 
  293.      Copy part of a string #x40string_copy 
  294.      Replace part of a string #x40string_replace   
  295.  
  296.    Conversion between Lists and Strings
  297.  
  298.      ASCII Values to characters #x40number_to_char
  299.      Characters to ASCII values #x40char_to_number
  300.      String to list of characters #x40list_of_char  
  301.      String to lower case #x40lower  
  302.      String to upper case #x40upper  
  303.      String to list #x40string_to_list 
  304.      List to string #x40list_to_string
  305.   
  306.  
  307.    Text Files
  308.      Read:
  309.        Paragraph #x40read
  310.        Line #x40read_line  
  311.        Character #x40read_char 
  312.      Write #x40write 
  313.      Open #x40new_file 
  314.      Close one or more #x40close 
  315.      Close all #x40close_all
  316.      Set file pointer #x40set_file_pos
  317.      Get file pointer #x40get_file_pos   
  318.  
  319. //Code Included
  320.  
  321.  The code is included for all the knowledge bases shipped with 
  322.  the system.  This can be a good source of ideas for your own 
  323.  applications.  
  324.  
  325.  Code files always end with .KB for stand alone applications
  326.  and .SRC for knowledge bases which are called by another 
  327.  application. 
  328.  
  329.  The code for this application is in DEMO.KB. 
  330.  The code for the tools is in .SRC files.
  331.  
  332. //Ordering Information
  333.  
  334.   KnowledgePro (Windows) is available for $695 plus 
  335.   shipping and handling from:
  336.  
  337.   Knowledge Garden Inc.
  338.   473A Malden Bridge Road
  339.   Nassau, NY  12123
  340.       
  341.   Phone: #x14 518-766-3000 
  342.   Fax: #x14 518-766-3003
  343.   EMail:#x14 Compuserve 72470,3032
  344.  
  345.   Call for educational discounts, site license information
  346.   and dealer inquiries.
  347.  
  348. //Expert Systems
  349.  
  350.   KnowledgePro is an ideal language for creating 
  351.   stand-alone expert systems and for applications
  352.   with embedded expert system capabilities.  Both
  353.   backward chaining and frame-based systems can
  354.   be constructed.
  355. //