home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / prolog / 1648 < prev    next >
Encoding:
Internet Message Format  |  1992-09-03  |  1.5 KB

  1. Path: sparky!uunet!gatech!psuvax1!rutgers!ub!acsu.buffalo.edu!ubvmsd.cc.buffalo.edu!v104n55k
  2. From: v104n55k@ubvmsd.cc.buffalo.edu (David I Schwartz)
  3. Newsgroups: comp.lang.prolog
  4. Subject: Re: Time and Date in Quintus P.
  5. Message-ID: <Bu0yr6.LAC@acsu.buffalo.edu>
  6. Date: 3 Sep 92 23:04:00 GMT
  7. References: <1992Sep3.201023.6191@tom.rz.uni-passau.de>
  8. Sender: nntp@acsu.buffalo.edu
  9. Organization: University at Buffalo
  10. Lines: 28
  11. News-Software: VAX/VMS VNEWS 1.41
  12. Nntp-Posting-Host: ubvmsd.cc.buffalo.edu
  13.  
  14. In article <1992Sep3.201023.6191@tom.rz.uni-passau.de>, baier@forwiss.uni-passau.de (Joern Baier) writes...
  15. >Hi!
  16. >For an application I need the time and date in Quintus Prolog. I wrote a
  17. >small predicate date/1 but I'm not content with it, because I have to
  18. >create an extra file. How can I get a random number in PROLOG to create
  19. >unique file names?
  20. >The main problem is that 'unix(system(date))' sends its output directly
  21. >to the user, regardless of the current output.
  22. >I enclose the protocol of a session below.
  23. >Thanx in advance,
  24. >            Joern
  25. >-------------------------------Cut here!------------------------------
  26. >gandalf:~/prolog/dp 103> prolog
  27. >Quintus Prolog Release 2.5.1 (DECstation 3100, Ultrix 3.1)
  28. >| ?-  tell(test_2),current_output(O),unix(system(date)),told.
  29. >Thu Sep  3 22:01:06 MET DST 1992
  30.  
  31. Check out your library files. In version 3.1.1, there are predicates for 
  32. dates (date.pl) and random number generators (random.pl). I think these
  33. may be in your directory already. You'll have to look in these library
  34. files to see which predicates you'll need.
  35.  
  36. Dave
  37.