(*
        Keep prompting the user for new commands to enter into
        Reflection's command queue until user enters a null
        command
*)

        program quecmd (input,output);
        {$V-}
        (*  include the API UNIT *)
        uses  apiunit;
        var     command  : string[80];
                sno      : string[32];
                i        : integer;
        begin
             if api_instchk( sno ) <> 0 then
                begin
                        writeln( 'Reflection not present' );
                        exit;
                end;
             write ( 'enter REFLECTION command : ');

(*
           Use REFLECTION'S read keyboard routine which allows
           REFLECTION to multi-task during the read
*)
             rfreadkeybd ( 79, command );


             while command >= ' ' do
               begin
                if API_QCmd( command ) <> 0 then
                        writeln( 'Queue full' )
                else
                        write ( 'enter REFLECTION command : ');
                rfreadkeybd ( 79, command )
               end;
        end.

