Try:

 (bind ?combinded-ostring (str-cat ?ostring ?answer))

alan

-----Original Message-----
From: Jim VanDragt [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 26, 2003 6:51 PM
To: [EMAIL PROTECTED]
Subject: JESS: Problems Combining Jess Variables



Good Evening All, 

I'm attempting my first Jess script tonight and need a little help.  I'm
trying to create a new variable (see Problem Line below) by combining
?ostring and ?answer. When I (run) this batch file I receive a Jess error
(see below). 

How do you combine to variables such as ?ostring and ?answer ? 

TIA 




--------------------------- Script Snippet ---------------------------- 

(deftemplate work-surface 
    (slot shape (default rectangular)) 
    (slot product-line (default not-defined)) 
    (slot order-string (default Z)) 
    (slot shape-code (default R)) 
    (slot top-material (default not-defined)) 
    (slot front-edge (default not-defined)) 
    (slot question-to-ask (default product-line)) 
) 


(defrule rectangular-work-surface-front-edge-laminate "For top material
Laminate" 
    (vocabulary (product work-surface)) 
    ?ws <- (work-surface (shape rectangular) (order-string ?ostring)
(question-to-ask ?question) (top-material l)) 
    (test (eq ?question front-edge)) 
  => 

    (printout t crlf "Select Front Edge Material" crlf) 
    (printout t "===================" crlf) 
    (printout t "A - Square-Edge Front, Vinyl" crlf) 
    (printout t "C - Square-Edge Front, Wood" crlf) 
    (printout t "D - Bullnose Front, Laminate" crlf) 
    (printout t "E - Bullnose Front, Wood" crlf) 
    (printout t "F - Bullnose Front, Vinyl" crlf) 
    (printout t "G - Passage Edge Front, Vinyl" crlf) 
    (printout t "K - Contoured Edge Front, Vinyl" crlf) 
    (printout t "" crlf) 


    (bind ?answer (read)) 

    (modify ?ws (top-material ?answer) (question-to-ask nil)) 
    (bind ?combinded-ostring (+ ?ostring ?answer))    <<<<<<<
------------------------ Problem Line 

) 


--------------------------- Error Snippet ------------------------------ 

Jess reported an error in routine Value.numericValue 
....... 
  Message: Not a number: "Z" (type = ATOM). 
  Program text: ( batch /jess61p4/jimsjess/firstone.clp ) 
..... 




Jim Van Dragt
Herman Miller Inc.
(616) 654-5285

--------------------------------------------------------------------
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]
--------------------------------------------------------------------

Reply via email to