Do_Section_of Action

The action do_section_of takes one argument: a parameter of the type category. The action is an alternative to the often used sentences in section declarations:

if <category parameter name> = <option1> do <option1>

if <category parameter name> = <option2> do <option2>

...

Instead of listing all the if-statements corresponding to the possible options, you can simply write:

do_section_of <category parameter name>

In a consultation session the value of the parameter will determine to which section, the control will be transferred. If the parameter hasn't got a value, ESTA evaluates the parameter first and the obtained value is then used as reference to the corresponding section. The functionality of the do_section_of and the do action is exactly the same. The difference is that you don't have to write all the equal sentences with the do-statements, but instead only one sentence. Remember that the option names of the category parameter must correspond to section names in the knowledge base.

Examples

This example is taken from the supplied knowledge base CAR.KB:

section start 'main section'

do_section_of problem

parameter problem : 'the problem with your car'

type category

explanation

'Identify the problem with your car as closely as you can. Only those listed are dealt with in this knowledge base.'

options

starting_problems - 'starting problems'

overheating - 'the engine gets overheated'

smell_of_gasoline - 'the car smells of gasoline'

bad_running - 'the engine runs badly'

brakes - 'the brakes'

vibration - 'excessive vibrations'

wiper_motor - 'the wiper motors'

light_problem - 'the lights'

horn_problem - 'a faulty horn'.

question

'What is the problem with your ' car ' ?'

picture 'car'