Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
need help in CLIPS programming
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
raninder dhillon  
View profile  
 More options Feb 6, 1:15 am
From: raninder dhillon <raninderdhil...@gmail.com>
Date: Sun, 5 Feb 2012 22:15:54 -0800 (PST)
Local: Mon, Feb 6 2012 1:15 am
Subject: need help in CLIPS programming
hello..
I am facing some problem using CLIPS software. Actually i am making
some project in CLIPS which will read values from a text file , apply
rules on that values and store result in another text file. I am
using .bat file to read values,and loading .clp file for rules. The
problem is read-number function reads one value at a time. to read 10
values, i want to make use of loop

(open "ex.txt" num "r")
(bind ?count 0)
(while (<= ?count 9)
(bind ?ans(read-number num))

now ?ans stores one value,and next time when count becomes 1,it reads
another value such that previous value of ?ans get overwritten. I dont
want to use statement (bind ?ans(read-number num) 10 times... i want
to use ans as an array variable,so that all 10 values get stored on
which i can further apply rules. but i am unable to find array option
in CLIPS. can you help me how to do this?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
CLIPS Support  
View profile  
 More options Feb 10, 12:56 am
From: CLIPS Support <garydri...@gmail.com>
Date: Thu, 9 Feb 2012 21:56:43 -0800 (PST)
Local: Fri, Feb 10 2012 12:56 am
Subject: Re: need help in CLIPS programming
If you write all of the values to a single line, you can read the
entire line using the deadline function and convert it to a multifield
value using the explode$ function.

CLIPS> (open "data.txt" data "w")
TRUE
CLIPS> (printout data "1 2 3 4 5 6 7 8 9 10" crlf)
CLIPS> (close data)
TRUE
CLIPS> (open "data.txt" data)
TRUE
CLIPS> (explode$ (readline data))
(1 2 3 4 5 6 7 8 9 10)
CLIPS> (close data)
TRUE
CLIPS>

On Feb 6, 12:15 am, raninder dhillon <raninderdhil...@gmail.com>
wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Raninder Dhillon  
View profile  
 More options Feb 10, 4:35 am
From: Raninder Dhillon <raninderdhil...@gmail.com>
Date: Fri, 10 Feb 2012 05:35:54 -0400
Local: Fri, Feb 10 2012 4:35 am
Subject: Re: need help in CLIPS programming

Thanks sir..i tried your suggestion but the problem is after reading values
one by one, i have to assert as facts like reading first no. suppose 2, i
have  to store it as var1 2 as fact, then  next value suppose 5 as another
fact var2 5 ans so on...till 10 values. After asserting as 10 variables, i
have to apply rules on them like
(defrule check1
(var1 ?v1)
(var2 ?v2)
test(> ?vr1 ?vr2)=> (printout t "rule violated" crlf))

how can this be done??


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »