MOO-cows Mailing List Archive

[Prev][Next][Index][Thread]

Re: A peeve.



On Sat, 21 Dec 1996, Brad Lawrence wrote:

> Why should this happen:
> 
> ;;blah = "foo";blah[2] = "";#2:tell(blah)
> #-1:Input to EVAL, line 3:  Invalid argument
> .... called from built-in function eval()
> .... called from #59:eval_cmd_string (this == #2), line 21
> .... called from #59:eval*-d (this == #2), line 11
> 
If you're either replacing more than one character of a string or you're not
replacing it with a single character, you need to specify a range instead
of a single index.  Try:
  ;;blah = "foo"; blah[2..2] = ""; #2:tell(blah);


References:

Home | Subject Index | Thread Index