PHP Classes

File: SetVars.know

Recommend this page to a friend!
  Classes of Bob Wedwick  >  PHP Expert System Engine  >  SetVars.know  >  Download  
File: SetVars.know
Role: Auxiliary data
Content type: text/plain
Description: Xbert rule set
Class: PHP Expert System Engine
Ask questions and make decisions based on answers
Author: By
Last change:
Date: 4 years ago
Size: 1,582 bytes
 

Contents

Class file image Download
/*,, SetVars.know - This is an example of how to use the XbertClass.php
Testing ability to set and test local and global variables for Xbert.
For this example values are numeric, but could be alpha.
Names for variables are denoted with < and > delimiters.
The $ is not used so it can be used in the text of knowledge files.
*/
# ,,"The next line sets the response to the first question as 'YES', so the user does not even see it."
	,RES, Yes
12	,Asky,Validate the ability to set and test variables?
	,glo, <se> 135
	,glo, <sw> 225
	,glob, <north> 0
	,glob, <east> 90
	,global, <south> 180
	,glob, <west> 270
	,glob, <oldwest> 270
	,loc, <ne> 45
	,loc, <nw> 315
	,loc, <oops> ....OOPS....
	,loc, <passed> ....Test passed....
11	,asky,Change global values so tests will fail?
	,csv, SetVars2.know
# test for vars being equal
10	,EQU,  <oldwest> <west>
	,pau,<passed> EQU <oldwest> <west>
	,goto, 9
10	,pau,<oops> EQU <oldwest> <west>
# test for vars being not equal
9	,,* * * *
	,NEQ, <sw> <se>
	,pau,<passed> NEQ <sw> <se>
	,goto, 8
9	,pau,<oops> NEQ <sw> <se>
#  test less than
8	,,* * * *
  	,LES, <north> <south>
	,pau,<passed> LES <north> <south>
	,fall, 7
8	,pau,<oops> LES <north> <south>
# test less < =
7	,,* * * *
  	,LTE, <sw> 225
	,pau,<passed> LTE <sw> 225
	,goto, 6
7	,pau,<oops> LTE <sw> 225
# test greater than or equal
6	,,* * * *
	,GTE, <west> 260
	,pau,<passed>  GTE <west> 260
	,goto, 5
6	,pau,<oops> GTE <west> 260
# test greater than
5	,,* * * *
	,GRE, <south> <east>
	,pau,<passed> GRE <south> <east>
	,goto, 4
5	,pau,<oops> GRE <south> <east>
1	,pau, ALL DONE
For more information send a message to info at phpclasses dot org.