Search found 47 matches
- 19 Mar 2014 16:05
- Forum: Visual Prolog
- Topic: How to initialize single fact in a class that do not create object?
- Replies: 2
- Views: 2197
- 19 Mar 2014 6:55
- Forum: Visual Prolog
- Topic: unexpected end of file erro when read from external file
- Replies: 4
- Views: 3072
Code fix
The following code will works good for you, Use the same and let me know for any further support %Write data to another file only when it is not the end of stream class predicates copyLine : (inputStream I, outputStream O). clauses copyLine(I, O) :- if not(I:endOfStream()) then Line = I:readLine(), ...
- 10 Mar 2014 12:15
- Forum: Visual Prolog
- Topic: Discontiguous facts
- Replies: 6
- Views: 3140
I have a project in which I am dynamically saving facts (functors) . The facts so saved are not contiguous. Because of this when another part of the project uses these facts it is unable to process the newly added facts. How can I have prolog pick all the facts. I know there is a discontiguous dire...
- 7 Mar 2014 14:53
- Forum: Visual Prolog
- Topic: Advanced List handling
- Replies: 19
- Views: 9087
- 4 Mar 2014 10:14
- Forum: Visual Prolog
- Topic: Advanced List handling
- Replies: 19
- Views: 9087
- 4 Mar 2014 5:54
- Forum: Visual Prolog
- Topic: Advanced List handling
- Replies: 19
- Views: 9087
- 3 Mar 2014 10:19
- Forum: Visual Prolog
- Topic: stackoverFlow Error for some Shortest Path
- Replies: 7
- Views: 4232
You have to do something like below after you found the shortest path, connected(Window,_Source,_Target):- if shortestPath <> [] then %finalized path should be in the list shortestPath = [Source|Targets], %get the source TempSource = varM{string}::new(Source), list::forAll(Targets, {(HTarget):- %loo...
- 3 Mar 2014 9:49
- Forum: Visual Prolog
- Topic: stackoverFlow Error for some Shortest Path
- Replies: 7
- Views: 4232
- 28 Feb 2014 19:46
- Forum: Visual Prolog
- Topic: depth first search problem
- Replies: 1
- Views: 2040
- 27 Feb 2014 15:18
- Forum: Visual Prolog
- Topic: error c504
- Replies: 2
- Views: 2237
predicates findPath : (string Start, string End) -> string* Path determ. clauses findPath(Start, End) = list::reverse(findPath2(Start, End, [Start])). %Input to this predicate is string list - so you must return string list from the findPath2/.. predicate predicates findPath2 : (string Start, strin...
- 27 Jan 2014 9:34
- Forum: Visual Prolog
- Topic: Read from an external file.
- Replies: 17
- Views: 8192
- 17 Jan 2014 10:26
- Forum: Visual Prolog
- Topic: How can we define a user defined exception for the error code ?
- Replies: 2
- Views: 2002
- 17 Jan 2014 10:10
- Forum: Visual Prolog
- Topic: How can we define a user defined exception for the error code ?
- Replies: 2
- Views: 2002
How can we define a user defined exception for the error code ?
I see that, errorExit(1000) is used to raise the exception - What does the Error code(1000) means ? How can I get the error message ? Is there any way user can define our own exception to the error code ? class predicates testException : (integer ) . clauses testException(Var):- try if Var <> 1 then...
- 16 Jan 2014 14:38
- Forum: Visual Prolog
- Topic: define clause with value from edit control
- Replies: 6
- Views: 3508
- 16 Jan 2014 11:55
- Forum: Visual Prolog
- Topic: define clause with value from edit control
- Replies: 6
- Views: 3508
Please go through the following URL to get a detail knowledge on assert and retract, Assert: http://wiki.visual-prolog.com/index.php?title=Language_Reference/Built-in_entities/Predicates#assert Retract: http://wiki.visual-prolog.com/index.php?title=Language_Reference/Built-in_entities/Predicates#ret...