home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / mac / programm / 18805 < prev    next >
Encoding:
Internet Message Format  |  1992-11-23  |  1.9 KB

  1. Path: sparky!uunet!news.univie.ac.at!chx400!news.unige.ch!ugun2b!cuisunh!tamone
  2. Newsgroups: comp.sys.mac.programmer
  3. Subject: Simple question with MPW Pascal tool
  4. Message-ID: <1992Nov23.112943.19200@uni2b.unige.ch>
  5. From: tamone@cuisunh.unige.ch (TAMONE Francois)
  6. Date: 23 Nov 92 11:29:42 +0200
  7. Reply-To: tamone@cuisunh.unige.ch (TAMONE Francois)
  8. Distribution: world
  9. Organization: University of Geneva, Switzerland
  10. Nntp-Posting-Host: cuisunh.unige.ch
  11. Lines: 44
  12.  
  13.  
  14. Hi,
  15.  
  16. I have a trivial question about MPW pascal I/O in a tool type application.
  17.  
  18. I just wanted to make a simple program to compute some composed interest rate.
  19.  
  20. The problem is I can't read an integer or a real and write them properly.
  21. In standard Pascal and most implementation in the Galaxy, when you have a var
  22. integer or real name 'var1', you can do
  23.  
  24. readln(var1);
  25.  
  26. and 
  27.  
  28. writeln(var1);
  29.  
  30. This is the least, no ? But here in MPW, it does not work that way. The answer
  31. to that must be stupid but, there is still one to find. Yes I checked FAQs and
  32. MPW doc and InsideMac. I don't have the Pascal doc though. And I don't want to
  33. spend hours on this which should work pretty straight, whithout beeing rude.
  34.  
  35. The error I get when I write is either 0 for all integers or NAN(017) for a
  36. real (meaning Not-a-Number, ascii conversion error). Where's the rub ? In a
  37. tool application, standard input an output should be the MPW shell so ? Maybe I
  38. do not type the right eoln char after I input my number ? Here Carriage Return
  39. wont do so I type Enter.
  40.  
  41. (In the meantime I programmed my little problem on a vax with no problem)
  42.  
  43.  
  44. Another little question, can I drop in MacsBug inside a programm by a call like
  45.  
  46. if i<0 then do
  47.   EnterMacsBug
  48. else
  49.   writeln('this is TOOOO much');
  50.  
  51. Thanks for the help on this trivial question. The most trivial questions
  52. are one
  53. of the most annoying since they should not arise. I am pretty annoyed,
  54. you see...
  55.  
  56. Francois
  57.