Skip to content

Result parameter for Create, Append, Open, Close  #5

@zertovitch

Description

@zertovitch

Since exception handling is not yet supported, we'd like a mean to handle cases where the file operations Create, Append, Open, Close fail. An idea is to have variants with a Result parameter. These variants can be useful too when exception handling is implemented, by the way.
Example for Create:

  --  If the operation fails, one of the Name_Error, Use_Error, Status_Error exceptions is raised.

  procedure Create (File : in out File_Type; Name : String);
  procedure Create (File : in out File_Type; Name : VString);

  --  Variants of Create, Append, Open, Close with a "Result" parameter.
  --  If the operation fails, Result is set to the value corresponding to the exception.

  type File_Operation_Result is (Success, Erroneous_Name, Erroneous_Use, Erroneous_Status);

  procedure Create (File : in out File_Type; Name : String; Result: out File_Operation_Result);
  procedure Create (File : in out File_Type; Name : VString; Result: out File_Operation_Result); 

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions