EXPLANATION: If you enter the command MATCHPAR and the five parameters
10|1|yes.txt|no.txt|e:/index/, you will see the following result:

These are the parameters

First: 10

Second: 5.300000

Third: yes.txt

Forth: no.txt

Fifth: e:/index/


MORE EXPLANATION FOR THE SERIOUS PROGRAMMER: The definition of the index cell master.in is shown below:

0	// current state

0	// next state

1	// 1 input message(s)

0:0.60,X1|X2|X3|X4|X5 // matchpar

0        //	no. predicate

0	// 0 output ic(s)

0	// 0 output message(s)

1	// 1 action(s)

0,X1|X2|X3|X4|X5 // MATCHPAR matchpar.c

The ic accepts five parameters X1, X2, X3, X4 and X5. The IC Manager has thirty predefined paramters X0-X9, Y0-Y9, Z0-Z9. The letters X, Y and Z must be in upper-case, otherwise there will be an error message when you try to run te program. The corresponding action is 'a' and it is defined in the C program matchpar.c as follows:

/* a c function for my action*/

void matchpar(plist,f_func,active_ic)

para_list* plist;

f_type* f_func;

active_index *active_ic;

{

	printf(" < HTML > ");

        printf("These are the parameters");

        printf(" < p > ");

        printf("First: %d", get_int_par(1,plist,active_ic));

        printf(" < p > ");

        printf("Second: %f", get_float_par(2,plist,active_ic));

        printf(" < p > ");

	printf("Third: %s", get_string_par(3,plist,active_ic));

        printf(" < p > ");

	printf("Forth: %s", get_string_par(4, plist,active_ic));

        printf(" < p > ");

	printf("Fifth: %s", get_string_par(5, plist,active_ic));

        printf(" < p > ");  

	printf(" < a href=\"inter.cgi?tao_name=main.taoml\" > Go Back < /a > ");	

	printf(" < /HTML > ");

}    

The above program illustrates how you can extract the five parameters X1, X2, X3, X4 and X5. Once the paramters are extracted, the program a() can perform whatever processing that is necessary. The action MATCHPAR, the program matchpar() and the file matchpar.c should have the same name.

At run time, the IC Manager will produce the following debugging information in a file called file.ic:


next available ic: 2

id: 1

ic type: master

current state: 0

initial state: 0

max. time: 100

input list: 0

output list: 0

same ic: 0


The URL of the Growing Book on the PC "bach" is http://bach.cs.pitt.edu/index.html

The programs are in the directory bach: e:\Inetpub\wwwroot

The course materials are in the directory bach e:\index


Project suggestions for the Growing Book Command Processor

BACK TO TOP GROWING BOOK (PC) SENTIENT MAP (PC)