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
rem PrintTimestamp.bas
rem
rem last revision on 05 Feb 2003
rem

rem For newer models (>= 3.02q) see also PrintTimestamp2.bas

rem  Keep in mind that the PRINT command can send only a
rem  restricted number of characters at once (100 chars).
rem  Timestamp + CR + LF = 20 chars

Customer_ID_Macro:
write "      Print Timestamp      "
END

Reset_Macro:
CONST MASTER_MODE = 0002
CONST ASCII_MODE = 0000
&CODE3 = ASCII_MODE
END

print_timestamp:
// format: MM/DD/YY    HH:MM:SS

if &MONTH < 10 then
        print "0" + &MONTH + "/"
else
        print &MONTH + "/"
endif
if &DATE < 10 then
        print "0" + &DATE + "/"
else
        print &DATE + "/"
endif
if &YEAR < 10 then
        print "0" + &YEAR + CHR(TAB)
else
        print &YEAR + CHR(TAB)
endif

if &HOURS < 10 then
        print "0" + &HOURS + ":"
else
        print &HOURS + ":"
endif
if &MINUTES < 10 then
        print "0" + &MINUTES + ":"
else
        print &MINUTES + ":"
endif
if &SECONDS < 10 then
        print "0" + &SECONDS + CHR(TAB)
else
        print &SECONDS + CHR(TAB)
endif
return

print_my_data:
// now print your data
// print ...

// print 'end of line'
print CHR(CR) + CHR(LF)
return

F1_Button_Macro:
&CODE3 = MASTER_MODE
gosub print_timestamp
gosub print_my_data
&CODE3 = ASCII_MODE
END

Download PrintTimestamp.bas
(1.3 KB , Aug. 26, 2008)