Hello,
Is there anything wrong with creating a new directory and new file using the File Object, but, doing this creation in the declarations section at the top of my EFS code? this is the code Im using:
// Declarations and Global Variables
var a = new File ("Gold Strategy 1");
a.mkDir;
var b = new File ("Gold Strategy 1/EntryPrice.txt");
// Declarations and Global Variables
funtion preMain() {
}
function main() {
return null;
}
The reason I wanted to put creating new directory and new file code in the declarations section of my EFS code is that I only wanted to create the new directory and file once, ie when the EFS code initially loads up.
Is it ok to do it this way? Will my code still be stable doing it this way? or can you see problems with doing it this way?
A second question is: If I only want to do some action once like read from a file, is it always best to do this action at the top of my EFS code which is outside the main() and preMain() function loops?
Please excuse my ignorance, as I am new to JavaScipt and not a expert programmer, but I have done some basic programming in other platforms for the last 5 years, and I have read as much as I can in the e-signal resources materials like EFS KnowledgeBase, manuals, etc.
Thanks again for any help.
Regards
Rod
Is there anything wrong with creating a new directory and new file using the File Object, but, doing this creation in the declarations section at the top of my EFS code? this is the code Im using:
// Declarations and Global Variables
var a = new File ("Gold Strategy 1");
a.mkDir;
var b = new File ("Gold Strategy 1/EntryPrice.txt");
// Declarations and Global Variables
funtion preMain() {
}
function main() {
return null;
}
The reason I wanted to put creating new directory and new file code in the declarations section of my EFS code is that I only wanted to create the new directory and file once, ie when the EFS code initially loads up.
Is it ok to do it this way? Will my code still be stable doing it this way? or can you see problems with doing it this way?
A second question is: If I only want to do some action once like read from a file, is it always best to do this action at the top of my EFS code which is outside the main() and preMain() function loops?
Please excuse my ignorance, as I am new to JavaScipt and not a expert programmer, but I have done some basic programming in other platforms for the last 5 years, and I have read as much as I can in the e-signal resources materials like EFS KnowledgeBase, manuals, etc.
Thanks again for any help.
Regards
Rod
Comment