I'm working on a scheduled script in which I load ...
# suitescript
b
I'm working on a scheduled script in which I load a file and use the File.lines.iterator(), when I go over each line with iterator.each(function(line) I lose all my variables. Should I be using the iterator or should I get data from each file of the line a different way?
b
you can share your code for more specific help
but i would say your variables should be declared outside of your iterator function
b
they are
b
which variables are having problems
b
anything declared outside of i.each(function (line){}); is not available
b
pick one, your variables are badly named
im having trouble picking which ones are important
b
they are all important
b
pick one which doesnt have a value
traditionally 1 character variable names are used as temporary values
like loop indexes
b
none of them do outside of the iterator, I'm in the debugger and once I am inside the lines.iterator all my other local variables are gone, poof, bye
ok, I will fix my variables later but need to get the script to work first
I should say none of them exist inside the file.lines.iterator, unless I've declared them there
b
the suitescript debugger tends to make variables from the call stack hard to find
are you saying that you can't debug the variables, or that your variables are undefined when you expect them to have a value
if you are talking about the debugger, change the value of the call stack field to see variables higher up the call stack
b
I see now, ok, thank you, that's frustrating