DFRClose function

Official Content
This documentation is valid for:

Closes the file opened by dfropen. This function must be called after a successful call (without error) to dfropen.

Syntax

DFRClose()

Type Returned:
Numeric

Scope

Objects:   Procedure, Transaction, Web PanelData Provider
Generators:   .NET, .NET Framework, Java, Ruby (up to GeneXus X Evolution 3)

Values

This function may return some of the following values:

Value Result Description
 0 Successful operation The file has been read.
-1 Wrong sequence It occurs when this function is called before calling the DFROpen function, or when the call to DFROpen returned a value other than zero (error). 


Samples

For this example, the parameter field separator is not required.

&Text = ""
&i = dfropen( "Test.txt",1024,,"") 
If &I = 0
    Do while dfrnext( ) = 0
       &i = dfrgtxt(&Line) // The length of the line is given by the size of the variable.
       &Text = &Text + Newline() + &Line
    EndDo
    &i = dfrclose( )
else
    &Text = "Could not open file"
EndIf

See Also

Delimited ASCII files functions