dantrader$
New member
Dear Forum,
I am attempting to code a fold loop with an if statement that increments the value of a variable if a condition is met. I am receiving highlighted errors that I cannot make go away, and would appreciate your thoughts and input. My code is the following:
def gup;
gup = fold m = 0 to 4 with bup=0 do If wup[m] > (.75*len[m]) then {bup = bup[1] + 1}; else {bup = bup[1];};
another version with some but fewer errors is:
def gup;
gup = fold m = 0 to 4 with bup=0 do If wup[m] > (.75*len[m]) then bup = bup[1] + 1 else bup = bup[1];
Any and all input on how to make this functional would be truly appreciated! I am looking forward to reading your creative solutions shortly.
I am attempting to code a fold loop with an if statement that increments the value of a variable if a condition is met. I am receiving highlighted errors that I cannot make go away, and would appreciate your thoughts and input. My code is the following:
def gup;
gup = fold m = 0 to 4 with bup=0 do If wup[m] > (.75*len[m]) then {bup = bup[1] + 1}; else {bup = bup[1];};
another version with some but fewer errors is:
def gup;
gup = fold m = 0 to 4 with bup=0 do If wup[m] > (.75*len[m]) then bup = bup[1] + 1 else bup = bup[1];
Any and all input on how to make this functional would be truly appreciated! I am looking forward to reading your creative solutions shortly.