basic I/O

From: Lura (rroditi_at_bezeqint.net)
Date: 04/07/04


Date: 7 Apr 2004 11:05:24 -0700

Hello!
I start to learn I/O in prolog.
I have SWI prolog compiler.
I try the following program to get number from user and output cube:
cube :-
  write('next item: '),
  read(X),
  process(X).
  
process(stop) :- !.

process(N) :-
  C is N * N * N,
  write('cube of '),write(N),write(' is '),
  write(C),nl,
  cube.

but when i try it i can't accept result. every time i'am in first 'read'.
?- cube.
next item: 2
|: 3
|: 3

thanks