2 ms·
> So the REP function looks at the statement it's part of, finds the variable that is being assigned to, and uses that as the starting string (!). It's kind of
by thaumasiotes 8y ago
> So the REP function looks at the statement it's part of, finds the variable that is being assigned to, and uses that as the starting string (!). It's kind of like a function, only with a weird implied variable that only works in an assignment.
As DonHopkins notes, this appears substantially identical to the assign-equals operators which are generally thought of as "easy and convenient" rather than "weird". How is the line of code "a *= 7" meaning
"whatever the current value of a is, multiply that by 7 and assign the result to a"
weirder than the line 'a$ = REP("123",4,0)' meaning
"whatever the current value of a$ is, do a string replacement on it and assign the result to a$"?