Now I got stuck with my stack.

Looked through the LC manual and the Dictionary but could not find any solution.
Here are the points I'm trying to get working:
1. To be able to pause the 1 st repeat loop on the Settings card, and resume from the same line it stopped on or if this repeat is paused and I would manually look at few next lines then it should resume from the last line that was viewed.
2. To set a particular time of the day to start the repeat loop (2nd option on the Settings card). If this repeat is paused and I would manually look at few next lines then it should resume from the last line that was viewed.
The code on the stack is:
Code: Select all
global gtext2display,frequency,thisLine,currentLine,showAtTime
on openStack
-- ## Display correct line number, mandatory for your calculation
-- ## in the navigation buttons/images
put 1 into fld "showingLine"
put line 1 of gtext2display into fld "text2display"
if the hilite of btn "set_frequency" of cd "settings" then
put 0 into fld "showingLine"
repeat for each line thisLine in gtext2display
put thisLine into fld "text2display"
add 1 to fld "showingLine" -- increment counter
## ticks will be substituted for seconds once the testing is done
wait for frequency ticks
-- wait for frequency seconds
wait 0 milliseconds with messages
end repeat
end if
## how to make NEXT and PREVIOUS, FIRST and LAST line buttons function
## when the reapeat is running or when it's paused?
## (how to pause the repeat with the PAUSE button?)
## how to set the repeat to start at the showAtTime ?
## what's the fault in the script below? (it does not work).
if showAtTime > 0 then
set the twelveHourTime to false
repeat for each line thisLine in gtext2display while showAtTime = the time
wait 65 seconds
add 1 to fld "showingLine" -- increment counter
end repeat
end if
end openStack
Code: Select all
global gtext2display,frequency,thisLine,currentLine,showAtTime
on closeCard
if the hilite of btn "set_frequency" of cd "settings" then
put (label of btn "everyhour" * 360 + label of btn "everyminutes" *60) into frequency
else
put 0 into frequency
end if
if the hilite of btn "set_time" of cd "settings" then
set the twelveHourTime to false
put label of btn "time_hour" of cd "settings" & ":" & label of btn "time_minutes" of cd "settings" into showAtTime
else
put 0 into showAtTime
end if
put empty into gtext2display
if the hilite of btn "a" of cd "settings" then
put fld "Field 1" of cd "files" after gtext2display
end if
if the hilite of btn "b" of cd "settings" then
put fld "Field 2" of cd "files" after gtext2display
end if
if the hilite of btn "c" of cd "settings" then
put fld "Field 3" of cd "files" after gtext2display
end if
put the number of lines of gtext2display into fld "numberOfLines" of cd "home"
end closeCard
## How to pause and resume the repeat from the line it was paused on??
## how to resume from currentLine after pausing or closing the stack??
Appreciate any help with this.
keram