|
|||
|
Hi, everyone...
A weird thing is happening here with my scripting. When I write this... Code:
//Initialize var playerName = "something"; var file = "D:\\player.txt"; DataFile.save(file, "playerName"); Dialogs.msgBox(getAppDir()); getAdditionalFile() return true; Code:
//Initialize
function saveInfo(){
var playerName = "something";
var file = "D:\\player.txt";
DataFile.save(file, "playerName");
Dialogs.msgBox(getAppDir());
};
saveInfo();
getAdditionalFile()
return true;
What is the reason? Is it impossible to use DataFile commands in a function? I don't believe it can be true. But nothing else comes to my mind. Thanks in advance. P.S. I've used SavedObject class... still useless. And I've set password for encryption in Resources. |
|
|||
|
I noticed that saving to datafile for some reason doesn't work with vars that are declared with var.
When I tried this, it worked: Code:
//Initialize
function saveInfo(){
playerName = "something";
var file = "D:\\player.txt";
DataFile.save(file, "playerName");
Dialogs.msgBox(getAppDir());
};
saveInfo();
getAdditionalFile()
return true;
|
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|