1. Not so easy to 'Save As' properly !
- Posted by guest at rapideuphoria.com Feb 12, 2004
- 500 views
posted by: a.admin at =E0myway.it To Greg Haberek and to David Cuny, It is not so simple to 'Save As' properly! Deepening a solution for the SaveAs parameters, and to a replacement of the= getSaveFileName() function in winfile.ew, in order to mantain full compata= bility with other programs, I tried to return from there the full name got = for the file as a single string (rather than a double sequence): may be bot= h a simple filename and a filename.ext. It should not make any difference if not requested, but a great deal if use= d and it should even be simpler. So, provided a proper filters sequence, it could be: ---------- if length(fName) then -- if program specified name -- and user canceled, this = would still run! filters = filters[ fIndex * 2 ] if compare( filters, ".*" ) = 1 then -- only if an .ext is dec= lared, not '.*' if filters[1] = 46 then -- '.' the dot fName = fName&filters else fName = fName&"."&filters -- may be useful, or igno= red end if end if end if end if release_mem( ofn ) return fName ---------- Other solutions might be good, where a single parameter is returned in all = cases. HOWEVER, I'M AFRAID IT IS TOO SOON TO CROW OVER THE VICTORY! I realized that the system does never select the proper file list to show i= n the dialog box (as every Windows program does), nor it performs a real OF= N_OVERWRITEPROMPT check on that file, since it does not consider the select= ed extension, that is added after in our case, just before saving. So the problem arises again; it should find a solution at the WIN32MOD.EW, = at the buildDefaultOfn() function level, not after. To me it appears that a= ll the necessary tools exist, although not used (, NULL); unfortunately I a= m new to all these things, and cannot help more. It is difficult to build a professional tool, with such limitations. Thank you. Antonio Alessi