The posted error message still puzzles me. My recollection has it that Jess reports quite accurately the statement where the exception was raised, not just the outermost control statement. Moreover, all levels between the outermost and innermost statement are displayed as well, so that you can accurately trace the execution path.
If can provoke the reported error using this code: (deffunction foo ()) (bind ?list (list a b c)) (try (foreach ?elem ?list (printout t ?elem crlf) (bind ?x (call foo ())) ) catch (printout t (call ?ERROR toString) crlf) ) But I get this lucid information (Jess 7.1p2): class jess.JessException Jess reported an error in routine Value.stringValue while executing (call foo ) while executing (bind ?x (call foo )) while executing (foreach ?elem ?list (printout t ?elem crlf) (bind ?x (call foo ))). Message: '' is a list, not a string. Was the original post produced by some older Jess version? -W On 10/03/2012, Hunter McMillen <mcmil...@gmail.com> wrote: > I am receiving the error in the subject line when one of my rules is > firing. I can't seem to find any other forum posts about it, here is my > rule: > > (defrule build-supply-depot > (minerals (value ?x&:(> ?x 100))) > => > (try > (foreach ?u (?*bwapi* getMyUnits) > (if (= (?u getTypeID) ?*SCV_ID*) then > (bind ?p (call get-next-build-tile())) > (call ?*bwapi* drawCircle ?p.x ?p.y 100 111 FALSE FALSE) > (call ?*bwapi* build (?u getID) ?p.x ?p.y > (UnitType$UnitTypes.Terran_Supply_Depot ordinal)) > (break))) > catch > (printout t (call ?ERROR toString) crlf) > ) > ) > > and here is the exact error message: > > while executing (foreach ?u (call ?*bwapi* getMyUnits) > (if (= (call ?u getTypeID) ?*SCV_ID*) > then > (bind ?p (call get-next-build-tile )) > (call ?*bwapi* drawCircle ?p.x ?p.y 100 > 111 FALSE FALSE) > (call ?*bwapi* build (call ?u getID) > ?p.x ?p.y (UnitType$UnitTypes.Terran_Supply_Depot ordinal)) > (break))). > > Message: '' is a list, not a string. > > But the error doesn't give me a line number. > > Any help would be appreciated. > Thanks, > Hunter McMillen > -------------------------------------------------------------------- To unsubscribe, send the words 'unsubscribe jess-users y...@address.com' in the BODY of a message to majord...@sandia.gov, NOT to the list (use your own address!) List problems? Notify owner-jess-us...@sandia.gov. --------------------------------------------------------------------