Newsgroups: comp.lang.prolog
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel!gatech!howland.reston.ans.net!news.nic.surfnet.nl!tudelft.nl!akkerman
From: akkerman@dutiah.twi.tudelft.nl (Gertjan Akkerman)
Subject: Re: How can I use a variable?
Message-ID: <D80Cvv.J4I@news.tudelft.nl>
Sender: news@news.tudelft.nl (UseNet News System)
Nntp-Posting-Host: dutiah.twi.tudelft.nl
Organization: Delft University of Technology
References: <Pine.OSF.3.90.950503115559.2809A-100000@tom.fe.up.pt>
Date: Wed, 3 May 1995 15:11:54 GMT
Lines: 24

In article <Pine.OSF.3.90.950503115559.2809A-100000@tom.fe.up.pt>,
Guozhong Zhou  <zhou@tom.fe.up.pt> wrote:
>When I call a unix command using predicate:
>system('vi FILENAME')
>,
>how can I do it if FILENAME is a variable other than a constant 
>file name?
>
>Thanks.

I would not know how to do this in one line.
I would do something like:

	name(FILENAME, FileString),
	append("vi ", FileString, CommandString),
	name(CommandAtom, CommandString),
	system(CommandAtom).

(I did not test this, but you get the idea. The precise details will
 vary among Prolog systems.)

>Guozhong Zhou

	Gertjan Akkerman ( akkerman@dutiba.twi.tudelft.nl )
