Delete char in string

Richmond richmondmathewson at gmail.com
Wed Feb 19 10:57:03 EST 2014


On 19/02/14 14:28, Richmond wrote:
> On 19/02/14 14:09, John Dixon wrote:
>> as in something like this...
>>     put char 2 to (the number of chars of fld 1) of fld 1 into fld 2
>>
>>
>>
>
> Oddly enough THIS works:
>
> put fld "INN" into $INN
> delete char 1 of $INN
> put $INN into fld "OWT"
>
> BUT, BUT, BIG UNCOMFORTABLE BUT, this:
>
>
> put fld "INN" into $INN
>  put fld "URTEXT" into $URTEXT
>    repeat until $URTEXT is empty
>    if $INN contains the first char of $URTEXT then
>       put the first char of $URTEXT after $OUTTEXT
>       delete the first char of $URTEXT
>    else
>       delete the first char of $URTEXT
>    end if
> end repeat
> put $OUTTEXT into fld "fOUTTEXT"
>
> Maybe this is because one cannot use CONTAINS with a string variable, 
> Dunno.

Or, is this because this line:

repeat until $URTEXT is empty

is rather silly?  I don't just suppose one can have a string that is empty.

If that be the problem [nice Subjunctive construction there, grammar 
groupies], how is one to finish one's REPEAT loop?

I don't know if one could do this;

repeat if $URTEXT exists

sounds a bit odd.

>
> Richmond.





More information about the use-livecode mailing list