Page 1 of 1

Crash LC8.1.6 after delete char

Posted: Wed Aug 23, 2017 11:41 am
by sphere
Hello,

now i don't know if the below delete line is completely good, but it gives no error applying the code.
My intension was to delete the last 4 characters of the local value
But it causes to crash LC8.1.6, i did not test any other version

Code: Select all

local tA
on mouseUp
put"abracadabra" into tA
delete the last char to -4 of tA
answer tA
end mouseUp
Am i doing it wrong or is it a bug?

Regards,
Sphere

Re: Crash LC8.1.6 after delete char

Posted: Wed Aug 23, 2017 12:22 pm
by [-hh]
Not a bug with respect to your code, the code is not correct.
But the crash with your code (corrected to "end" in the last line) is also in LC 6.7.11, you should report this.

@your code.

You could use

Code: Select all

delete char -4 to -1 of tA
OR, as I prefer:

Code: Select all

local tA
on mouseUp
   put "abracadabra" into tA
   answer char 1 to -5 of tA
end mouseUp

Re: Crash LC8.1.6 after delete char

Posted: Wed Aug 23, 2017 2:13 pm
by sphere
Hi Herman,

thanks, so in fact count from first char to minus 5 from the last char, in speaking words. Or from minus 5 form the last to minus 1 from the last (for example)

Great.
I will report it.


*****edit**** bug reported http://quality.livecode.com/show_bug.cgi?id=20293