pralash
21st November 2017, 06:52
Hi,
I'm new for LN Programming... I'm using the break statement in order to exit the control from the body of selectdo and endselect. But I'm not able to get the break of the loop... Is it correct for using break with in the selectdo and endselect or some other else?
My Sample script is as follows....
function read.counter.table()
{
change = tcyesno.no
process.end = tcyesno.no
select tctls903.logg
from tctls903
where tctls903._index1 inrange {:logg.f} and {:logg.t}
selectdo
if logg.t.change=logg.t or logg.f.change=logg.t then
break
endif
if change=tcyesno.no then
act.date = sprintf$("%u(%04Y-%02m-%02d)",tctls903.logg)
logg.first=tctls903.logg
else
logg.first=logg.f.change
act.date = sprintf$("%u(%04Y-%02m-%02d)",logg.first)
endif
select tctls903.logg as temp
from tctls903
where tctls903._index1 inrange {:logg.first} and {:logg.t}
selectdo
act.date2 = sprintf$("%u(%04Y-%02m-%02d)",temp)
if act.date <> act.date2 then
logg.f.change = temp |kkkk
break
else
change=tcyesno.yes
logg.t.change=0
logg.t.change = temp
endif
endselect
counter = 0
select distinct tctls903.user
from tctls903
where tctls903._index1 inrange {:logg.first} and {:logg.t.change}
selectdo
counter = counter+1
endselect
rprt_send()
endselect
|message("%s",sprintf$("%u(%04Y-%02m-%02d)",logg.t.change))
}
Please let me know if there is some another methods are available to exit the control the body of the loop instead of the "Break" statement...?
Regards,
Pralash
I'm new for LN Programming... I'm using the break statement in order to exit the control from the body of selectdo and endselect. But I'm not able to get the break of the loop... Is it correct for using break with in the selectdo and endselect or some other else?
My Sample script is as follows....
function read.counter.table()
{
change = tcyesno.no
process.end = tcyesno.no
select tctls903.logg
from tctls903
where tctls903._index1 inrange {:logg.f} and {:logg.t}
selectdo
if logg.t.change=logg.t or logg.f.change=logg.t then
break
endif
if change=tcyesno.no then
act.date = sprintf$("%u(%04Y-%02m-%02d)",tctls903.logg)
logg.first=tctls903.logg
else
logg.first=logg.f.change
act.date = sprintf$("%u(%04Y-%02m-%02d)",logg.first)
endif
select tctls903.logg as temp
from tctls903
where tctls903._index1 inrange {:logg.first} and {:logg.t}
selectdo
act.date2 = sprintf$("%u(%04Y-%02m-%02d)",temp)
if act.date <> act.date2 then
logg.f.change = temp |kkkk
break
else
change=tcyesno.yes
logg.t.change=0
logg.t.change = temp
endif
endselect
counter = 0
select distinct tctls903.user
from tctls903
where tctls903._index1 inrange {:logg.first} and {:logg.t.change}
selectdo
counter = counter+1
endselect
rprt_send()
endselect
|message("%s",sprintf$("%u(%04Y-%02m-%02d)",logg.t.change))
}
Please let me know if there is some another methods are available to exit the control the body of the loop instead of the "Break" statement...?
Regards,
Pralash