' irtransfer.ibas
{CREATORID "JVxx"}

BEGIN
 A$=CALLPP$(100,"open,ircomm,9600")
 A=FILEERROR : IF A=1 END
 BUTTON #1,"Send Hello by IR",40,70,80,30
 T=TICKSPERSEC
 A=T\2 : R$="read,63,"+STR$(A,0)
 S$="write,Hello from "+HOTSYNCINFO$(2)+","+STR$(T,0)
 L$=CHR$(10)
 REPEAT
  A$=CALLPP$(100,R$)
  IF A$<>"" LET A=MESSAGEBOX("Received: "+L$+A$,1)
  E=DOEVENTS
  IF E=1 LET A$=CALLPP$(100,S$)
 UNTIL E=-1
 A$=CALLPP$(100,"close")
END
