DzFileDialog doesn't return expected value

DafaDafa Posts: 97

Ok, so according to the Daz Documentation, it says that DzFileDialog will return undefined if the user cancels the dialogue. However, when I do it returns an empty string. Am I doing something wrong here? Or is it just my tired eyes taking effect?

var path = FileDialog.doDirectoryDialog(qsTr("Select a directory"),"",sCurrentPath);print(path); // returns empty string ("")

e

Post edited by Dafa on

Comments

  • Richard HaseltineRichard Haseltine Posts: 100,747

    The description needs updating - the returns for DzFileDialog are mostly a string (one returns an array) and in the event of cancellation the return value is defined but empty (i.e. "" for a string). Check the length of the return is greater than 0 after checking that it exists.

Sign In or Register to comment.