- [CPC] Standard In , Standard Out and all the other I/O stuff

From: Martin, Marc <"Martin,>
Date: Thu, 12 Jul 2007 13:21:26 -0700

----boundary-LibPST-iamunique-1584596991_-_-
Content-type: text/plain

> It's fine to write to StdLog, but how do you read from it?
> How do you read ANYTHING from the keyboard?

I think some people here might prefer the Zonnon language.
Here's some example code from Zonnon:

  procedure Inquiry;
  var
    sum: longreal;
    since, result: integer;
  begin
    write( "please enter the sum to reach (real): " );
    readln( sum );
    writeln( "please enter the day you want to start (integer): " );
    readln( since );

    result := RainSumSince( sum, since );
    if ( result + since ) = MaxDays then
      writeln( "not reached" )
    else
      write( result );
      writeln( " day(s) in between." )
    end;
  end Inquiry;

See? It reads from the keyboard, has readln/write/writeln,
has lowercase reserve words... what more could you ask for? :-)

  http://www.zonnon.ethz.ch/

Marc

--- BlackBox
--- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy

----boundary-LibPST-iamunique-1584596991_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"

e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwID4gSXQncyBmaW5lIHRvIHdyaXRlIHRvIFN0ZExv
ZywgYnV0IGhvdyBkbyB5b3UgcmVhZCBmcm9tIGl0PyAgXHBhcg0KPiBIb3cgZG8geW91IHJlYWQg
QU5ZVEhJTkcgZnJvbSB0aGUga2V5Ym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ccGFyDQpccGFyDQogIGh0dHA6Ly93
d3cuem9ubm9uLmV0aHouY2gvXHBhcg0KXHBhcg0KTWFyY1xwYXINClxwYXINCi0tLSBCbGFja0Jv
eFxwYXINCi0tLSBzZW5kIHN1YmplY3QgSEVMUCBvciBVTlNVQlNDUklCRSB0byBibGFja2JveEBv
YmVyb24uY2h9fQByDQpG


----boundary-LibPST-iamunique-1584596991_-_---
Received on Thu Jul 12 2007 - 22:21:26 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:31:30 UTC