try this:

engine.executeCommand("(assert (conventionalAddress (number_prefix
NIL) (street_number 48) (street_name Marlow) (street_type Street)
(suburb_name Wembley) (city_name Perth) (state_name \"Western
Australia\") (post_code 6014) ))");

If you read Ernest's reply you'll find that he has already suggested it.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Matthew Hutchinson
Sent: 15 April 2005 04:18
To: [email protected]
Subject: Re: JESS: "assert" statements that have slots with multi-word
strings


Perhaps a better question would be whether this should work:

engine.executeCommand("(assert (conventionalAddress (number_prefix
NIL) (street_number 48) (street_name Marlow) (street_type Street)
(suburb_name Wembley) (city_name Perth) (state_name "Western
Australia") (post_code 6014) ))");

Specifically, the state_name slot. All I want to do is store the state
name Western Australia as a string in the slot. But when I don't use
quotation makrs the compiler does not compile and when I do use them
it also doesn't compile. If I use just one word (e.g. state_name WA)
it works fine. What is the proper way to contain more than 1 word in a
string slot?

Thanks,
Matt





On 4/14/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> I think Matthew Hutchinson wrote:
> >
> > but with .executeCommand the same " " around the string causes the
> > program to crash.
>
> I can't say for sure, but I think what you're calling a "crash" here
> is a Java compiler error, and this is a Java syntax question, not a
> Jess question so much.
>
> If you want to write a Java string containing a double quote, you have
> to "escape" it with a backslash:
>
> String aString = "\"Balderdash!\", he exclaimed.";
>
> This applies in your case too; i.e.,
>
> Rete engine = ...
> engine.executeCommand("(assert (foo \"bar\"))");
>
> ---------------------------------------------------------
> Ernest Friedman-Hill
> Advanced Software 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]
> --------------------------------------------------------------------
>
>


--
Matthew Hutchinson
Ph.D. Candidate

Department of Spatial Sciences
Curtin University of Technology
GPO Box U1987
Perth, Western Australia 6845

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

Reply via email to