/**********************************************
 * TESTIO - Test Library stdio.h for py65mon *
 **********************************************/
 
#include <py65.h02>
#include <stddef.h02>
#include <stdio.h02>

char key;      //Key read from keyboard
char len;      //Length of input output string
char str[128]; //String to read/write

main:
  putln("Press any key to continue");
  key = getc();       //Wait for key press
  newlin();           //Advance cursor to next line

  putln("Type lines followed by carriage-return");
  putln("press Escape key to end");

while () {
  putc('>');
  len = gets(&str);     //Read string from keybaord     
  if (len == $FF)       //If entry was aborted
    break  ;            //  return to monitor
  puts("You typed: ");  //Print without newline
  putln(&str);          //print with newline
}

done:
  goto exit;
