Equinox Online Help - Language Reference - A to Z

Home

FileHandle

Applies to
SyntaxFileHandle(HandleItem)
Action[Function] Returns the operating system file handle for a random or sequential file.
ScopeUsable anywhere
Notes

An Equinox file handle is different to an operating system file handle. In some circumstances, for example where you are running an external DLL, you may want to transfer the system file handle to the DLL for executing external file operations. The HandleItem parameter must be an Equinox variable type 'Handle' and is the handle of the file which was opened with the FileOpen statement. The function returns an integer variable containing the operating system file handle.

CategoryFile Management
See Also ChooseFile, FileDelete, FileDetails, FileExists, FileHandle, FilePath, FileRename, FileSearch, FileSearchNext, MakeDirectory, RemoveDirectory
Example

This example passes the handle of a file to a DLL for validation.

| Register the DLL and call required
External "filcheck.dll" FileValidate Int Returns Int

handle hnd
Int DosHnd
logical Reply

| Open the file and test for error
FileOpen "LOG.DAT", StreamReadOnly, hnd

if hnd = -1 then
Alert "File Opening Error"
Exit Method
end if

| Get MSDOS file handlebr> DosHnd = FileHandle(hnd)

| Run external procedure
FileValidate DosHnd, Reply

if Reply then
Alert "File failed validation"
Exit Method
end if

FileClose hnd