Game Development Community

SaveFileDialog() examples always returns an empty string

by Jeff Yaskus · in Torque 3D Professional · 06/10/2012 (10:55 am) · 0 replies

Wanted to post this here, in effort to address if its a bug or documentation error.

The code examples for SaveFileDialog do not work as is and reference a non-existant variable ".file".

first found it here;
docs.garagegames.com/torque-3d/reference/classSaveFileDialog.html

Then, another version is here ... which doesnt use %openFileDlg.file incorrectly;
docs.garagegames.com/torque-3d/reference/classFileDialog.html

Full details here;
www.garagegames.com/community/forums/viewthread/130689

and the change needed to fix it;

from:
if ( %result )  
    %selectedFile = %saveFileDlg.file;

to:
if ( %result )  
    %selectedFile = %saveFileDlg.fileName;