Help with str-compare

577 views
Skip to first unread message

guillermo.debiase

unread,
Nov 3, 2010, 9:24:05 PM11/3/10
to CLIPSESG
I have the following code

(=(str-compare "incendio" sub-string(1 8 ?data)) 0)

but clips returns the following error

[EXPRNPSR1] A function name must be a symbol

Can Help me.

Best regards

Daniel Brassel Buss

unread,
Nov 3, 2010, 9:48:28 PM11/3/10
to clip...@googlegroups.com
The "sub-string" is a function to?
In that case, shouldn't your code be:

(= (str-compare "incendio" (sub-string 1 8 ?data)) 0)

-----Mensaje original-----
De: clip...@googlegroups.com [mailto:clip...@googlegroups.com] En nombre
de guillermo.debiase
Enviado el: miércoles, 03 de noviembre de 2010 10:24 p.m.
Para: CLIPSESG
Asunto: Help with str-compare

Can Help me.

Best regards

--
You received this message because you are subscribed to the Google Groups
"CLIPSESG" group.
To post to this group, send email to CLIP...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/CLIPSESG?hl=en

--> IF YOU NO LONGER WANT TO RECEIVE EMAIL <--
Visit this group at http://groups.google.com/group/CLIPSESG?hl=en
Click on "Edit my membership" link.
Select the "No Email" radio button.
Click the "Save these settings" button.

--> IF YOU WANT TO UNSUBSCRIBE <--
Visit this group at http://groups.google.com/group/CLIPSESG?hl=en
Sign in
Click on "Edit my membership" link.
Click the "Unsubscribe" button.
Note: This appears to be the most reliable way to unsubscribe

Alternately, send email to CLIPSESG-u...@googlegroups.com. You will
receive an email which you must respond to as well to unsubscribe. Clicking
the link mentioned in the unsubscribe reply does not appear to work
reliably.

guillermo.debiase

unread,
Nov 4, 2010, 7:52:05 AM11/4/10
to CLIPSESG
Daniel:
The sub-string function will retrieve a portion of a string from
another string.
Syntax
(sub-string <integer-expression> <integer-expression> <string-
expression>)

Tanks!!!!

On 3 nov, 22:48, "Daniel Brassel Buss" <dbras...@gmail.com> wrote:
> The "sub-string" is a function to?
> In that case, shouldn't your code be:
>
> (= (str-compare "incendio" (sub-string 1 8 ?data)) 0)
>
> -----Mensaje original-----
> De: clip...@googlegroups.com [mailto:clip...@googlegroups.com] En nombre
> de guillermo.debiase
> Enviado el: miércoles, 03 de noviembre de 2010 10:24 p.m.
> Para: CLIPSESG
> Asunto: Help with str-compare
>
> I have the following code
>
> (=(str-compare "incendio" sub-string(1 8 ?data)) 0)
>
> but clips returns the following error
>
> [EXPRNPSR1] A function name must be a symbol
>
> Can Help me.
>
> Best regards
>
> --
> You received this message because you are subscribed to the Google Groups
> "CLIPSESG" group.
> To post to this group, send email to CLIP...@googlegroups.com
> For more options, visit this group athttp://groups.google.com/group/CLIPSESG?hl=en
>
> --> IF YOU NO LONGER WANT TO RECEIVE EMAIL <--
> Visit this group athttp://groups.google.com/group/CLIPSESG?hl=en
> Click on "Edit my membership" link.
> Select the "No Email" radio button.
> Click the "Save these settings" button.
>
> --> IF YOU WANT TO UNSUBSCRIBE <--
> Visit this group athttp://groups.google.com/group/CLIPSESG?hl=en

guillermo.debiase

unread,
Nov 4, 2010, 8:00:49 PM11/4/10
to CLIPSESG
Now another question.
I am newbie in clips, when I try to do this

(defrule guardar_riesgo_incendio
(=(str-compare "incendio" (sub-string 1 8 ?data)) 0)
=>
(printout t ?data crlf))

clips returns the following error
[PRNTUTIL2] Syntax Error: Check appropriate syntax for the field
field of a pattern.

Can you help me!!

On 3 nov, 22:48, "Daniel Brassel Buss" <dbras...@gmail.com> wrote:
> The "sub-string" is a function to?
> In that case, shouldn't your code be:
>
> (= (str-compare"incendio" (sub-string 1 8 ?data)) 0)
>
> -----Mensaje original-----
> De: clip...@googlegroups.com [mailto:clip...@googlegroups.com] En nombre
> de guillermo.debiase
> Enviado el: miércoles, 03 de noviembre de 2010 10:24 p.m.
> Para: CLIPSESG
> Asunto: Help withstr-compare
>
> I have the following code
>
> (=(str-compare"incendio" sub-string(1 8 ?data)) 0)
>
> but clips returns the following error
>
> [EXPRNPSR1] A function name must be a symbol
>
> Can Help me.
>
> Best regards
>
> --
> You received this message because you are subscribed to the Google Groups
> "CLIPSESG" group.
> To post to this group, send email to CLIP...@googlegroups.com
> For more options, visit this group athttp://groups.google.com/group/CLIPSESG?hl=en
>
> --> IF YOU NO LONGER WANT TO RECEIVE EMAIL <--
> Visit this group athttp://groups.google.com/group/CLIPSESG?hl=en
> Click on "Edit my membership" link.
> Select the "No Email" radio button.
> Click the "Save these settings" button.
>
> --> IF YOU WANT TO UNSUBSCRIBE <--
> Visit this group athttp://groups.google.com/group/CLIPSESG?hl=en

Alex Gian

unread,
Nov 4, 2010, 8:19:37 PM11/4/10
to clip...@googlegroups.com
You must use the "test" conditional element on the LHS of the rule when
checking a boolean value,
i.e. (test(=(str-compare .... etc.

guillermo.debiase

unread,
Nov 5, 2010, 8:55:20 PM11/5/10
to CLIPSESG
thank you very much!!!!!
Reply all
Reply to author
Forward
0 new messages