Search code examples
delphidelphi-7pascal

What is the meaning of a pipe "|" in Delphi 7?


As the title says, I would like to know what is the meaning of the pipe (or tube) "|" in a Delphi code. See that screenshot :

enter image description here

I know the meaning of "*" which is a wild card for one or more characters, but I can't find what means "|".

Thanks


Solution

  • This is a question that can be answered by reading the documentation. It can be found here:

    Vcl.Dialogs.TOpenDialog.Filter

    To create file masks in program code, assign a value to the Filter property that consists of a description and a mask separated by a vertical bar (pipe) character. Do not include spaces around the vertical bar. For example,

    OpenDialog1.Filter := 'Text files (*.txt)|*.TXT';
    

    Multiple filters should be separated by vertical bars. For example,

    OpenDialog1.Filter := 'Text files (*.txt)|*.TXT|Pascal files (*.pas)|*.PAS';
    

    To include multiple masks in a single filter, separate the masks with semicolons. This works both in the Object Inspector and in program code. For example,

    OpenDialog1.Filter := 'Pascal files|*.PAS;*.DPK;*.DPR';
    

    You might like to absorb the hints found here (How can I search for Delphi documentation?) in order to help you in the future.