Hi Gary,
The < function reads garbage data because a part of the fact is trashed during executing the DuplicateCommand().
The patch below is one solution for it.
--- tmpltfun-orig.c
2022-12-14 00:44:10.000000000 +0900
+++ tmpltfun.c
2024-02-02 21:45:49.010835668 +0900
@@ -809,7 +809,10 @@
/*===================================================*/
IncrementClearReadyLocks(theEnv);
+ newFact->theProposition.header.type = MULTIFIELD_TYPE;
+ RetainMultifield(theEnv,&newFact->theProposition);
EvaluateExpression(theEnv,testPtr->argList,&computeResult);
+ ReleaseMultifield(theEnv,&newFact->theProposition);
SetEvaluationError(theEnv,false);
DecrementClearReadyLocks(theEnv);
2024年1月30日火曜日 6:06:03 UTC+9 CLIPS Support: