> Can anybody help us launch an external application in the manner outlined
> below. The problem we have is that if we type commands into the interpreter
> shell they work, but if the same commands are in a program we get an error.
[snip]
> Program Code:
>
> library(popstring).
>
> launch:-
> prolog_eval(sysobey(popstring 'ls')).
>
> Trace:
> ?- reconsult(system).
>
> ;;; PROLOG SYNTAX ERROR - OPERATOR, ',', OR ')' EXPECTED
> ;;; FOUND : .
> ;;; READING: library ( consstring ( 41 , 1 ) <<HERE>> .
> ;;; FILE : /home/sean/pop/proto/system.pl LINE NUMBER: 11
>
> Thanks
>
> Sean & Frank
It's breaking because you defined the -popstring- macro before loading
"system.pl" (perhaps in your "init.pl"), so:
library(popstring)
breaks because -popstring- macro starts looking for a Pop-11 string. You
can either:
o Quote the library name, eg: ?- library('popstring.pl').
o Make sure you load "system.pl" before the macro is defined.
Adrian
aids (adrianh@cogs.susx.ac.uk) ObDisclamer: Poplog used to pay my wages
Phone: +44 (0)1273 678367 URL: http://www.cogs.susx.ac.uk/users/adrianh/
|