With slight changes (the second line of code uses ?mf before it's bound to anything,) this works fine for me -- i.e., if I uncomment the second line and comment the first one, the rule prints
Found entry 0.325 Found entry 0.04 Found entry -0.015 Found max value of 0.325 I preceded the whole thing by (store DataString "0.325 0.040 -0.015"). I think Ruff, Jeff wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] > Thanks for responding. I have included a snipit of the code explaining > what I have done. > Jeff Ruff > ChipData > > > My string I am passing to JESS is 0.325 0.040 -0.015 <<<result > from fetch DataString > > (assert (string (fetch DataString))) > (assert (Length (length$ ?mf))) > (bind ?mf (explode$ (fetch DataString))) > > (defrule multiTextEntry > (string ?str) > (Length ?len &:(and (> ?len 1)(= ?len 3))) > (test (str-index (new java.lang.Character 45) ?str)) > => > (foreach ?x ?mf > (printout t "Found entry " ?x crlf) <<<< correctly shows the three > values > ) > > (printout t "Found max value of " (max$ (create$ 34 56 98 100)) crlf) > <<<<<<< works > ;(printout t "Found max value of " (max$ (explode$ ?str)) crlf) <fails > > ) > > (deffunction funcall (?fnc $?args) > (eval (format nil "(%s %s)" ?fnc (implode$ ?args))) > ) > > (deffunction max$ (?1) > (funcall max ?1) > ) > > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Wednesday, March 19, 2003 10:30 AM > To: [EMAIL PROTECTED] > Subject: Re: JESS: Help is applying max to mutifield > > > I think Ruff, Jeff wrote: > [Charset iso-8859-1 unsupported, filtering to ASCII...] > > First thanks for the quick repsonse to my question. > > In testing the solution provided [thanks mike bobak] below, I find > that > > if I create a multifield with numeric values it works. In reading the > > doc, max requires numeric values. However, my multifield is numeric > > values represented as a string. How do I change a string multifield to > a > > numeric multifield? Must I explode the string multifield and then > create > > a new multifield, casting the value as a float [will this satisfy the > > numeric requirement?]. > > Thanks in advance. > > Jeff Ruff > > ChipData > > I'm not quite sure what you're asking -- an example of what you're > trying to do would help. > > > > > > > --------------------------------------------------------- > Ernest Friedman-Hill > Distributed Systems Research Phone: (925) 294-2154 > Sandia National Labs FAX: (925) 294-2234 > PO Box 969, MS 9012 [EMAIL PROTECTED] > Livermore, CA 94550 http://herzberg.ca.sandia.gov > > -------------------------------------------------------------------- > To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]' > in the BODY of a message to [EMAIL PROTECTED], NOT to the list > (use your own address!) List problems? Notify > [EMAIL PROTECTED] > -------------------------------------------------------------------- > > -------------------------------------------------------------------- > To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]' > in the BODY of a message to [EMAIL PROTECTED], NOT to the list > (use your own address!) List problems? Notify [EMAIL PROTECTED] > -------------------------------------------------------------------- > --------------------------------------------------------- Ernest Friedman-Hill Distributed Systems Research Phone: (925) 294-2154 Sandia National Labs FAX: (925) 294-2234 PO Box 969, MS 9012 [EMAIL PROTECTED] Livermore, CA 94550 http://herzberg.ca.sandia.gov -------------------------------------------------------------------- To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]' in the BODY of a message to [EMAIL PROTECTED], NOT to the list (use your own address!) List problems? Notify [EMAIL PROTECTED] --------------------------------------------------------------------
