🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #915

Can I pass variables to system()?

#915
From: Joseph A. Hollowood
Date: Sun, 30 Aug 1992 21:06
15 lines
889 bytes
How can I make the following work?

The user types in a month (int) and a year (int) and I
pass those values to system("cal [month] [year]").

Here's the code I was experimenting with, but it wasn't
working...

   int theMonth = [inputFields intValueAt:0];
   int theYear = [inputFields intValueAt:1]; 
   system("cal $theMonth $theYear > /tmp/calOutputFile"); 

Please email any replies to me personally.

Joe
Technical Details
Message-ID: <secOX9200WB2EMBEpC@andrew.cmu.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!ogicse!das-news.harvard.edu!cantaloupe.srv.cs.cmu.edu!crabapple.srv.cs.cmu.edu!andrew.cmu.edu!jh6l+

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!ogicse!das-news.harvard.edu!cantaloupe.srv.cs.cmu.edu!crabapple.srv.cs.cmu.edu!andrew.cmu.edu!jh6l+
From: jh6l+@andrew.cmu.edu (Joseph A. Hollowood)
Newsgroups: comp.sys.next.programmer
Subject: Can I pass variables to system()?
Message-ID: <secOX9200WB2EMBEpC@andrew.cmu.edu>
Date: 30 Aug 92 21:06:17 GMT
Article-I.D.: andrew.secOX9200WB2EMBEpC
Organization: Junior, Math/Computer Science, Carnegie Mellon, Pittsburgh, PA
Lines: 15