no help is with any save dialogs of how to set them up
how do I get a default extension installed on all of them before opening
Just in case thereās a problem with the OPās help install, bookmark this link
https://docwiki.embarcadero.com/RADStudio/Athens/en/Main_Page
Searching there on TSaveDialog should bring up links to get to methods, properties, etc, ending at
https://docwiki.embarcadero.com/Libraries/Athens/en/Vcl.Dialogs.TOpenDialog.FilterIndex
If LBRec.LBData = lbPicture then
If LoadButton then
begin
OpenPicDia.FilterIndex := 1;
OpenPicDia.InitialDir := GetCurrentDir;
OpenPicDia.DefaultExt := '*.Jpeg';
If OpenPicDia.Execute then
begin
Try
Stream := TMemoryStream.Create;
Stream.LoadFromFile(OpenPicDia.FileName);
Str := Copy(ExtractFileExt(OpenPicDia.FileName), 1, 5);
LBRec.FileExt := ' ';
For I := 1 to length(Str) do LBRec.FileExt[I] := Char(Str[I]);
LBRec.BlockSize := Stream.Size;
LBRec.BlockPtr := Stream.Memory;
Keys.PutRec(LastKeyName + LastRecName, LBRec);
Finally
Stream.Free;
end;
end;
end else
begin
Keys.GetRec(LastKeyName + LastRecName, LBRec);
Str := ' ';
For I := 1 to 5 do Str[I] := AnsiChar(LBRec.FileExt[I]);
SavePicDia.DefaultExt := '*' + Str;
If SavePicDia.Execute then
begin
Try
Stream := TMemoryStream.Create;
Stream.Size := LBRec.BlockSize;
CopyMemory(Stream.Memory, LBRec.BlockPtr, LBRec.BlockSize);
Stream.SaveToFile(SavePicDia.FileName);
Finally
Stream.Free;
end;
end;
end;
This my code
I identify Iām dealing with a picture
then LoadButton separates a load from a save
my filter is loaded with
.jpeg;.gif;.jpg;.png;.bmp;.ico;.emf;.wmf;.tif;.tiff;.wbmp;.webp;*.svg
but I have no filter information
if its a *.PNG my code records the ā.pngā as the suggested extension but does not display it, it does not display the filter options ether.
sorry my code is not well laid out
but when I open a file store it and then return the data under another file name perfect - just does not give me the user helps in the dialogs
I also have difficulty with TOpenDialog. I want the diaolog to show all files with the extensions I provide like *.gbk, *.fbk, *.7z and *.zip. It does not seem to do that.
Iām not the only one
lets see what Eivind Bakkestuen has to say
It requires the right separation syntax. Some components separate with , and some with ; and some with | Surprisingly there is no conformity - get the separator wrong and nothing works.
Set the Filter property correctly
e.g. Filter = āSQLiteDB (.db)|.db|SQLiteDB (.s3db)|.s3dbā
note the pipe symbols
It sure does need the right syntax.
But use the (filter) āeditorā (click on the ā¦), and, if you still need help, thereās a help button which quickly describes all the options.
so are you saying backup file(.gbk).gbk| firebird backup(.fbk)|.fbk|7zip file(.7z)|.7z|Zip File(.zip)| *.zip , will list all these files in the file list?
My tip for searching the official documentation on the web is to prefix your google search with ādocwikiā like so.
While Iām giving tips on googling, you can default all your google search results to the simple web only results view without the electricity guzzling AI generated pseudo-answer and other junk by following one of these methods. Iām using method 2 and itās been working great.
You can only have one āfilter typeā active at a time but each filter type can contain multiple extensions. The help explains it best:
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';
So what you want is āBackup file|*.gbk;*.fbk;*.7z;*.zipā. That is a single filter type ābackup fileā that includes all files with those four extensions, so only files matching those will appear when the ābackup fileā is selected in the dialog.
my mistake I forgot the vertical lines