home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / next / programm / 5874 < prev    next >
Encoding:
Internet Message Format  |  1992-08-30  |  864 b 

  1. Path: sparky!uunet!ogicse!das-news.harvard.edu!cantaloupe.srv.cs.cmu.edu!crabapple.srv.cs.cmu.edu!andrew.cmu.edu!jh6l+
  2. From: jh6l+@andrew.cmu.edu (Joseph A. Hollowood)
  3. Newsgroups: comp.sys.next.programmer
  4. Subject: Can I pass variables to system()?
  5. Message-ID: <secOX9200WB2EMBEpC@andrew.cmu.edu>
  6. Date: 30 Aug 92 21:06:17 GMT
  7. Article-I.D.: andrew.secOX9200WB2EMBEpC
  8. Organization: Junior, Math/Computer Science, Carnegie Mellon, Pittsburgh, PA
  9. Lines: 15
  10.  
  11. How can I make the following work?
  12.  
  13. The user types in a month (int) and a year (int) and I
  14. pass those values to system("cal [month] [year]").
  15.  
  16. Here's the code I was experimenting with, but it wasn't
  17. working...
  18.  
  19.    int theMonth = [inputFields intValueAt:0];
  20.    int theYear = [inputFields intValueAt:1]; 
  21.    system("cal $theMonth $theYear > /tmp/calOutputFile"); 
  22.  
  23. Please email any replies to me personally.
  24.  
  25. Joe
  26.