Table of contents
TOC
Collapse the table of content
Expand the table of content

ExtraTopLevelOperators.eprintfn<'T> Function (F#)

Den Delimarsky|Last Updated: 7/5/2016
|
1 Contributor

Print to stderr using the given format, and add a newline.

Namespace/Module Path: Microsoft.FSharp.Core.ExtraTopLevelOperators

Assembly: FSharp.Core (in FSharp.Core.dll)

Syntax

// Signature:
eprintfn : TextWriterFormat<'T> -> 'T

// Usage:
eprintfn format

Parameters

format Type: TextWriterFormat<'T>

Remarks

This function is named PrintFormatLineToError in compiled assemblies. If you are accessing the function from a language other than F#, or through reflection, use this name.

Example


    let maxValue = 10
    let function1 x =
       if (x > maxValue) then
           eprintfn "Error: the input %d exceeds the maximum value, %d." x maxValue
       else
           printfn "Success!"
    function1 1
    function1 11

Output

Success!
Error: the input 11 exceeds the maximum value 10.

Platforms

Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2

Version Information

F# Core Library Versions

Supported in: 2.0, 4.0

See Also

Core.ExtraTopLevelOperators Module (F#)

Microsoft.FSharp.Core Namespace (F#)

© 2016 Microsoft