next up previous contents index
Next: The tsfcom library Up: External tools Previous: External tools

The TSF part

  $\blacktriangleright$ STARTTOOL
 
The   statement starts the program and open the connection. Its single argument is the name of the program.
 
     STARTTOOL("/udd/foo/bin/server")

  $\blacktriangleright$ CLOSETOOL
 
The   statement closes the previously opened connection. Its single argument is the name of the program (it is not used).

 
     CLOSETOOL("/udd/foo/bin/server")

  $\blacktriangleright$ SEND
 
The   statement sends its single argument to the program. This argument can be a string or a string or an integer.

 
     SEND("Hello World")
     SEND(4)

  $\blacktriangleright$ RECV
 
The   function waits for a message from the program and returns a string. An obsolete statement RECV   is also available. Its single argument, a variable, is assigned with the received message.

 
       mess:=RECV() 
       RECV(mess)   // Obsolete

The following example use an external tool to translate the French comments to English comments. The script sends a command name, the string to be translated and waits for the answer.

$\vartriangleright$ Example 13:

         

   SCRIPT TranslateComment(stat) 
     com :=  stat.COMMENT 
     IF (com!=FALSE) THEN 
       STARTTOOL("/udd/foo/bin/translator") 
       SEND("FrenchToEnglish") 
       SEND(com)
       res := RECV() 
       CLOSETOOL("/udd/foo/bin/translator") 
       INSERTCOMMENT(stat,res) 
     ENDIF
   ENDSCRIPT



Yann Mevel
1999-04-30