isfile()

The function tests if a specified file exists.

Synopsis

bool isfile(string path);

Parameters

Parameter Description
path The file path. You can specify an absolute path or a relative path from the PROJ_PATH directory.

Return value

The function returns true if the specified file exists and false if it does not.

Error

Missing or wrong parameter definitions.

Description

The function tests if the specified file "test1.txt" exists. If it exists, the value 1 will be returned. If it does not exist, the value 0 will be returned. If the parameter would, for example, be "C://test1//", the function would return 0 since "test1" is a directory.

main()
{
  bool result;
  result= isfile("C://test1//test1.txt");
  DebugN(result);
}         

Assignment

File functions

Availability

CTRL