Herror ::fwrite_string (
    const HTuple &FileHandle,
    const HTuple &String
)

Write values in a text file.

The operator ::fwrite_string puts out a string or numbers on the output file. The operator ::open_file opens a file. The call ::set_system('flush_file', <boolean-value>) determines whether the output characters are put out directly on the output medium. If the value 'flush_file' is set to 'false' the characters (especially in case of screen output) show up only after the operator ::fnew_line is called.

Strings as well as whole numbers and floating point numbers can be used as arguments. If more than one value serves as input the values are put out consecutively without blanks.


Parameters

FileHandle (input_control)
file -> HTuple.long
File handle.

String (input_control)
string(-array) -> HTuple.char * / long / double
Values to be put out on the text file.
Default value: 'hallo'


Example
   fwrite_string(FileHandle,"text with numbers: ") ;
   fwrite_string(FileHandle,"5") ;
   fwrite_string(FileHandle," and ") ;
   fwrite_string(FileHandle,"1.0") ;
/* results in the following output:       */
/*    'text with numbers: 5 and 1.00000'   */

/* Tupel Version */
  int  i;
  double d;
  Htuple Tuple ;
  
  create_tuple(&Tuple,4) ;
  i = 5 ;
  d = 10.0 ;
  set_s(Tuple,"text with numbers: ",0) ;
  set_i(Tuple,i,1) ;
  set_s(Tuple," and ",2) ;
  set_d(Tuple,d,3) ;
  T_fwrite_string(FileHandle,HilfsTuple) ;

Result

If the writing procedure was carried out successfully the operator ::fwrite_string returns the value H_MSG_TRUE. Otherwise an exception handling is raised.


Possible Predecessors

::open_file


Possible Successors

::close_file


Alternatives

::write_string


See also

::open_file, ::close_file, ::set_system


Module

Basic operators



Copyright © 1996-2002 MVTec Software GmbH