fnew_lineT_fnew_lineFnewLineFnewLinefnew_line (算子)

名称

fnew_lineT_fnew_lineFnewLineFnewLinefnew_line — 写一个换行符并清除输出缓冲区。

签名

fnew_line( : : FileHandle : )

Herror T_fnew_line(const Htuple FileHandle)

void FnewLine(const HTuple& FileHandle)

void HFile::FnewLine() const

static void HOperatorSet.FnewLine(HTuple fileHandle)

void HFile.FnewLine()

def fnew_line(file_handle: HHandle) -> None

描述

算子 fnew_linefnew_lineFnewLineFnewLineFnewLinefnew_line writes a line break into the output file defined by the handle FileHandleFileHandleFileHandleFileHandlefileHandlefile_handle. The input file must have been opened with open_fileopen_fileOpenFileOpenFileOpenFileopen_file in text format. The call of fnew_linefnew_lineFnewLineFnewLineFnewLinefnew_line also empties possibly retained data from the output buffer into the file (see fwrite_stringfwrite_stringFwriteStringFwriteStringFwriteStringfwrite_string and set_system(::'flush_file', <boolean-value>:)set_system("flush_file", <boolean-value>)SetSystem("flush_file", <boolean-value>)SetSystem("flush_file", <boolean-value>)SetSystem("flush_file", <boolean-value>)set_system("flush_file", <boolean-value>)).

Which characters are written as line break depends on the operating system: under Windows the sequence '\r\n'"\r\n""\r\n""\r\n""\r\n""\r\n" (carriage return + line feed) is used as the standard line break, under Linux just '\n'"\n""\n""\n""\n""\n" (line feed).

执行信息

参数

FileHandleFileHandleFileHandleFileHandlefileHandlefile_handle (输入控制)  file HFile, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

File handle.

示例(HDevelop)

  fwrite_string(FileHandle,'Good Morning')
  fnew_line(FileHandle)
  

示例(C)

  fwrite_string(FileHandle,"Good Morning");
  fnew_line(FileHandle);
  

示例(HDevelop)

  fwrite_string(FileHandle,'Good Morning')
  fnew_line(FileHandle)
  

示例(HDevelop)

  fwrite_string(FileHandle,'Good Morning')
  fnew_line(FileHandle)
  

示例(HDevelop)

  fwrite_string(FileHandle,'Good Morning')
  fnew_line(FileHandle)
  

结果

If an output file is open and it can be written to the file, the operator fnew_linefnew_lineFnewLineFnewLineFnewLinefnew_line 返回值 2 ( H_MSG_TRUE )。否则,将抛出异常。

可能的前趋

fwrite_stringfwrite_stringFwriteStringFwriteStringFwriteStringfwrite_string

另见

fwrite_stringfwrite_stringFwriteStringFwriteStringFwriteStringfwrite_string

模块

基础