>It's curious, I'm not completely sure we are reasoning about the same function and record. It seems I should not be using TFilename as the variable name. I'm using a variable called TFileName with GetSaveFileNameA() Here is the relevant code.. after I fixed it to use Max_Path Uses CRT,CRT.Helper,Classes,Sysutils,windows,commdlg,Math,Process; Var TFilename : TOpenFileNameA; DefaultFileName : AnsiString = '' ; OutputFileName : AnsiString = '' ; fillchar(TFileName, sizeof(TFileName), 0); TFileName.lStructSize:=sizeof(TFileName); TFileName.hwndOwner:=0; TFileName.nMaxFile:=Max_Path+1; TFileName.lpstrFile:=Pchar(''); TFileName.Flags := OFN_EXPLORER or OFN_FILEMUSTEXIST or OFN_HIDEREADONLY; TFileName.lpstrDefExt:=''; TFileName.lpstrTitle:='Save File As:'; TFileName.lpstrFilter:='TAP Files (*.Tap)'+#0+'*.Tap'+#0+'All Files (*.*)'+#0+'*.*'+#0; TFileName.lpstrFile:=Pchar(DefaultFileName); SaveAsResult:=GetSaveFileNameA(@TFilename); . . OutputFileName:= strpas(TFileName.lpstrFile); . . Assign(TapFile,OutputFileName); ReWrite(TapFile); . . It seems TFileName is already defined and I am re-defining it. TFileName was not my idea.. that is not how I name my variables. It's something I got from an example on how to use GetSaveFileNameA() that I copied and pasted and then adjusted. that is also where TFileName.nMaxFile:=100; came from that caused my original problem. I don't have a really good understanding of the conventions of putting various letters in front of Variables, like the T.. but I would never put the T there myself.. variables I define never have the T.. so if I wasn't copying an example, I would have done something like: SaveAsFile : TOpenFileNameA; James
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal