-
Notifications
You must be signed in to change notification settings - Fork 0
/
Shift_by.ab
78 lines (59 loc) · 1.59 KB
/
Shift_by.ab
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
' X-axis shift by user input time
' Shifts active trace by a number of MILLISECONDS input by user.
' Only useful for time-based traces in seconds.
' File is NOT saved after shifting!
' 05.31.2012 ECN
' updated to provide forward and backward repeat shift 09.13.2012 ECN
free
dim left(32)
dim right(32)
dim prompt(256)
1000
first = getffp()
last = getflp()
string left = "Start time = " + first
string right = "End time = " + last
string prompt = "Time off-set in MILLISECONDS: "
dialogbeg "Shift the x-axis"
dialogloc 0, 10 : dialogtxt 0, 0, 0, $left
dialogloc 0, 10 : dialogtxt 0, 0, 0, $right
dialogask shift,0,0,0,$prompt
dialogask i,67,0,0,"Shift_to_earlier Shift_to_later Cancel"
dialogend 5
shift = shift / 1000
if i = 0 then shift = shift * -1 : goto 2000
if i = 1 then goto 2000
if i = 2 then goto 10000
2000
first = first + shift
last = last + shift
setffp first, last
see
4000
dialogbeg "Do it again?"
' dialogloc 0, 10 : dialogtxt 0, 0, 0, $txtrangersd
dialogask mc,4, 8000, 9000,"Again Reverse_direction Finished"
dialogend
8000
goto 2000
9000
shift = shift * -1
goto 2000
' *******************
' Exit clean up code
' *******************
10000
onerror 11000
waiton
dialogbeg "Reminder"
dialogloc 0, 10 : print "Don't forget to save the file!"
dialogend 20
'processing continues
t1=clock(0) : count=0
10500 if keyboard(0) then count=count+1
if not(clock(3)) goto 10500 'wait 3 seconds
11000
waitoff : dialogoff -20 : goto 20000 'remove dialog and end
20000
free
end