for (var i = 0; i < job.listArray.length; i++) {
job.apiEmailMessage = "An unexpected error was encountered in processing the transmission of files to API.
"
+ "File Names: " + job.listArray[i] + "
"
+ "Number of files : " + job.listArray.length + "
"
}
What I need to do is write the names that are in job.listArray[i] multiple times if there are multiple files.
Lets say I have 2 files names that I need to write out. This will only write out the last file name in the directory. How Do I make it so both file names are written out? Do I use a dowhile?
Thanks for the help!
Comments
:
: job.apiEmailMessage = "An unexpected error was encountered in processing the transmission of files to API.
"
: + "File Names: " + job.listArray[i] + "
"
: + "Number of files : " + job.listArray.length + "
"
:
: }
: What I need to do is write the names that are in job.listArray[i] multiple times if there are multiple files.
:
: Lets say I have 2 files names that I need to write out. This will only write out the last file name in the directory. How Do I make it so both file names are written out? Do I use a dowhile?
: Thanks for the help!
:
Hi there,
If I understand you correctly, this is an example of your situation.
[code]
job.listArray[0] = "text1.txt";
job.listArray[1] = "text2.txt";
job.listArray[2] = "text3.txt";
var fileString = "";
for (var i = 0; i != job.listArray.length; i++) {
fileString += job.listArray[i] + ", ";
}
fileString = fileString.substring(0, (fileString.length - 2));
[/code]
fileString now has the list of file names seperated by a ", " obviously. This variable can be passed to your email.
HTH
Bradley q:)