Project

General

Profile

scrolled-to-end.p

Greg Shah, 11/14/2019 03:56 PM

Download (1.23 KB)

 
1
DEF TEMP-TABLE tt FIELD f1 AS integer
2
                  field f2 as logical.
3

    
4
def var i as integer.
5
def buffer xtt for tt.
6

    
7
repeat i = 1 to 500:
8
   create tt. tt.f1 = i. tt.f2 = false.
9
end.
10

    
11
DEFINE QUERY q FOR tt SCROLLING.
12
OPEN QUERY q FOR EACH tt where tt.f2 = false .
13

    
14
DEF BROWSE brws QUERY q 
15
DISPLAY 
16
     tt.f1 width-chars 10
17
     tt.f2 width-chars 10
18
     WITH size 150 by 100 TITLE "Static browse" separators.
19

    
20
DEF FRAME fr brws 
21
   WITH TITLE "Frame" SIZE 25 BY 7 NO-LABELS.
22
   
23
ENABLE ALL WITH FRAME fr.
24

    
25
def var time10 as datetime init ?.
26
def var time11 as datetime init ?.
27
def var time12 as datetime init ?.
28
def var time20 as datetime init ?.
29
def var time30 as datetime init ?.
30
def var time490 as datetime init ?.
31
def var time500 as datetime init ?.
32

    
33

    
34
on "row-display" of browse brws do:
35
  def var r as integer.
36
  r = CURRENT-RESULT-ROW("q").
37
  
38
  if r = 10 then time10 = now.
39
  if r = 11 then time11 = now.
40
  if r = 12 then time12 = now.
41
  if r = 20 then time20 = now.
42
  if r = 30 then time30 = now.
43
  if r = 490 then time490 = now.
44
  if r = 500 then time500 = now.
45
end.
46

    
47
def var cnt as integer init 1.
48
on scroll-vertical of browse brws do:
49
  message "scroll-event" + string(cnt).
50
  cnt = cnt + 1.
51
end.
52

    
53

    
54
WAIT-FOR WINDOW-CLOSE OF DEFAULT-WINDOW.
55

    
56

    
57