GiD_File fopen|fclose|fprintf|fflush|list
To allow print data from a Tcl procedure with standard fprintf command, specially to write the calculation file from Tcl or a mix of .bas template and Tcl procedures

Open a file named <filename> for writting access. By default access is "w", but is possible to use "a" to append to a previous file (and "wb" or "ab" to open the file in binary mode). It returns a long integer <file_id> representing the channel

Close a channel

Print data from a Tcl procedure in a file opened with GiD_File fopen and returns the number of printed characters.
(a .bas template implictly open/close a file with this command, and the file_id could be send to a tcl procedure as a parameter with the *FileId template keyword)
<file_id> must be a valid file descriptor, that could be obtained in a .bas template with the *FileId command (or with GiD_File fopen)
<format> must be a valid C/C++ format, according with the arguments
return

Force unwritten buffered data to be written to the file

It returns a list of currently open file_ids


Example:
.bas file:

Number of points and lines: *tcl(MyMethod *FileId)


.tcl file:

proc MyMethod { channel } {
    GiD_File fprintf -nonewline $channel {%d %d} [GiD_Info Geometry NumPoints] [GiD_Info Geometry NumLines]
}