Exchange/RJE Manual
Send/Receive Program Example
Example Programs
D–16 104698 Tandem Computers Incorporated
Page 17 [1] $RJE.EXCHAPPL.RJEPROG 1991-06-17 11:05:47
MAIN PROCEDURE
734. 000000 0 0 !***************************************************************
735. 000000 0 0
736. 000000 0 0 PROC ROOT MAIN;
737. 000000 1 0
738. 000000 1 0 BEGIN
739. 000000 1 1
740. 000000 1 1 ! data declarations !
741. 000000 1 1
742. 000000 1 1 INT .ibuf[0:39],
743. 000000 1 1 .command[0:1],
744. 000000 1 1 read^cnt := 4,
745. 000000 1 1 i := 0,
746. 000000 1 1 case^index := 3;
747. 000000 1 1
748. 000000 1 1 STRING .sbuf := @ibuf '<<' 1,
749. 000000 1 1 .scommand := @command '<<' 1,
750. 000000 1 1 .sp;
751. 000000 1 1
752. 000000 1 1 LITERAL BEL = %007;
753. 000000 1 1
754. 000000 1 1 ! end of data declarations !
755. 000000 1 1
756. 000000 1 1 CALL start^it;
757. 000016 1 1
758. 000016 1 1 end^loop := 0;
759. 000020 1 1
760. 000020 1 1 ! open the home terminal !
761. 000020 1 1 CALL MYTERM (term^name);
762. 000023 1 1 CALL OPEN (term^name, term^fnum);
763. 000033 1 1 IF <>
764. 000033 1 1 THEN
765. 000034 1 1 CALL ABEND;
766. 000041 1 1
767. 000041 1 1 CALL create^line^server;
768. 000042 1 1
769. 000042 1 1 ! interpret the operator input !
770. 000042 1 1 IF end^loop = 0
771. 000042 1 1 THEN
772. 000044 1 1 DO
773. 000044 1 1 BEGIN
774. 000044 1 2 ! prompt the operator !
775. 000044 1 2 sbuf ':=' ["SELECT COMMAND -- SEND, RECV, or EXIT"] -> @sp;
776. 000055 1 2 write^count := @sp '-' @sbuf;
777. 000061 1 2 CALL WRITE (term^fnum, ibuf, write^count);
778. 000071 1 2
779. 000071 1 2 CALL READ (term^fnum, command, read^cnt);
780. 000101 1 2
781. 000101 1 2 ! upshift character string !
782. 000101 1 2 FOR i := 0 TO read^cnt-1 by 1
783. 000101 1 2 DO
784. 000103 1 2 BEGIN
785. 000103 1 3 scommand[i] := scommand[i] LAND %337;
786. 000107 1 3 END;
787. 000116 1 2
788. 000116 1 2 IF scommand = ["SEND"]
789. 000116 1 2 THEN
790. 000127 1 2 case^index := 0;