I am embarrased to ask this as I must not be seeing the wood for trees, but, I have a TFileStream that is created in a tree of if statements. Depending on the if statement, the location on disk for the resulting file differs and the path structure will be different.
For example : if the filename is ASCII friendly, do this and save it here, if it has funny characters in it, do this and save it there, if it is too long, do this and save it here, etc.
At the end of this nest of if's, just before I free the filestream, I want to simply assign the full path and filename of whatever FileStream was created to a string variable for use elsewhere, e.g. OutputLocation. I have done so using what I thought must surely and obviously work :
OutputLocation := fs.Filename;
But try as I might, Filename is always empty, and OutputLocation never gets populated. But the series of if statements are working and output is created where it is supposed to be. Yet, during debugging, if I hover over fs, it lists "FILENAME" as a property and has the full path and filename that I need and that I am trying to assign to OutputLocation before freeing fs. But I just can't "get to it".
What in Gods world am I doing wrong?
Thanks