I have a short piece of code that works fine in LC 6.5.2. When moving to LC 7.1. or LC 8 DP13 the code breaks in a way that puzzles me:
Code: Select all
put ((trunc((selectline-1)/3)*3)+1) into blockstartline
put (((selectline-1)/3) - trunc((selectline-1)/3))*3 into lineshift
-- extracting and placing the next 3 lines of text in the subtitle field
put uniDecode(the unicodeText of line blockstartline to blockstartline+2 of field "alltext","UTF8") into linedecoded
set the unicodeText of fld "subtitles" to uniEncode(linedecoded,"UTF8")
set the foregroundcolor of line 0 to lineshift of field "subtitles" to "red"
-- set the foregroundcolor of line 0 to 1 of field "subtitles" to "red"
So now comes the mysterious part: In LC 6.5.2 this routine works without a problem. IN LC 7.1. this works sometimes, sometimes not. For example when I click line 6 the routine does what it is supposed to do, when I click in line 5, it doesn't. It gets even more mysterious (at least for me): If I click line 5 in field "alltext" the variable "lineshift" is calculated with 1. I checked it in various ways. If lineshift= 1 why then the following DOESN'T work:
Code: Select all
set the foregroundcolor of line 0 to lineshift of field "subtitles" to "red"
Code: Select all
set the foregroundcolor of line 0 to 1 of field "subtitles" to "red"
Best
Oliver