Intermec PM23c Fingerprint Developer's Guide (PC23d, PC43d/t, PM23c, PM43, PM4 - Page 126

Controlling the Printer, Fingerprint Developer's Guide, respectively, as in this example

Page 126 highlights

Chapter 7 - Controlling the Printer • =TIME$("F") - Returns the current time in the format specified by FORMAT TIME$ to a string variable. • DATEADD$ • TIMEADD$ • DATEDIFF • TIMEDIFF • WEEKDAY • WEEKDAY$ - Returns the name of the weekday of a specified date in plain text according to the weekday names specified by NAME WEEKDAY$, or if such a name is missing, the full name in English. • WEEKNUMBER • TICKS In most cases, you can specify the current date or time using DATE$ or TIME$ respectively, as in this example: WEEKDAY$ (DATE$) TIMEDIFF (TIME$, "120000") The next example shows how the date and time formats are set and the names of months are specified. Finally, a number of date and time parameters printed to the standard OUT channel: 10 FORMAT DATE$ "MMM/DD/YYYY" 20 FORMAT TIME$ "hh.mm pp" 30 NAME DATE$ 1, "Jan":NAME DATE$ 2, "Feb" 40 NAME DATE$ 3, "Mar":NAME DATE$ 4, "Apr" 50 NAME DATE$ 5, "May":NAME DATE$ 6, "Jun" 60 NAME DATE$ 7, "Jul":NAME DATE$ 8, "Aug" 70 NAME DATE$ 9, "Sep":NAME DATE$ 10, "Oct" 80 NAME DATE$ 11, "Nov":NAME DATE$ 12, "Dec" 90 A%=WEEKDAY(DATE$) 100 PRINT WEEKDAY$(DATE$)+""+DATE$("F")+""+TIME$("F") 110 PRINT "Date:",DATE$("F") 120 PRINT "Time:",TIME$("F") 130 PRINT "Weekday:", WEEKDAY$(DATE$) 140 PRINT "Week No.:",WEEKNUMBER (DATE$) 150 PRINT "Day No.:", DATEDIFF ("030101",DATE$) 160 PRINT "Run time:", TICKS\6000;" minutes" 170 IF A%5 THEN PRINT "It is ";WEEKDAY$(DATE$); ". Stay home!" RUN The printer returns (for example): Monday Apr/03/2003 08.00 am Date: Apr/03/2003 Time: 08.00 am Weekday: Thursday Week No.: 14 Day No.: 93 Run time: 1 minutes It is Thursday. Go to work! 114 Fingerprint Developer's Guide

  • 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
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163

Chapter 7 — Controlling the Printer
114
Fingerprint Developer’s Guide
<svar>=TIME$(“F”) - Returns the current time in the format specified by
FORMAT TIME$ to a string variable.
DATEADD$
TIMEADD$
DATEDIFF
TIMEDIFF
WEEKDAY
WEEKDAY$ - Returns the name of the weekday of a specified date in plain text
according to the weekday names specified by NAME WEEKDAY$, or if such a
name is missing, the full name in English.
WEEKNUMBER
TICKS
In most cases, you can specify the current date or time using DATE$ or TIME$
respectively, as in this example:
WEEKDAY$ (DATE$)
TIMEDIFF (TIME$, “120000”)
The next example shows how the date and time formats are set and the names of
months are specified. Finally, a number of date and time parameters printed to the
standard OUT channel:
10
FORMAT DATE$ “MMM/DD/YYYY”
20
FORMAT TIME$ “hh.mm pp”
30
NAME DATE$ 1, “Jan”:NAME DATE$ 2, “Feb”
40
NAME DATE$ 3, “Mar”:NAME DATE$ 4, “Apr”
50
NAME DATE$ 5, “May”:NAME DATE$ 6, “Jun”
60
NAME DATE$ 7, “Jul”:NAME DATE$ 8, “Aug”
70
NAME DATE$ 9, “Sep”:NAME DATE$ 10, “Oct”
80
NAME DATE$ 11, “Nov”:NAME DATE$ 12, “Dec”
90
A%=WEEKDAY(DATE$)
100
PRINT WEEKDAY$(DATE$)+“”+DATE$(“F”)+“”+TIME$(“F”)
110
PRINT “Date:”,DATE$(“F”)
120
PRINT “Time:”,TIME$(“F”)
130
PRINT “Weekday:”, WEEKDAY$(DATE$)
140
PRINT “Week No.:”,WEEKNUMBER (DATE$)
150
PRINT “Day No.:”, DATEDIFF (“030101”,DATE$)
160
PRINT “Run time:”, TICKS\6000;“ minutes”
170
IF A%<6 THEN PRINT “It is ”;WEEKDAY$(DATE$);
“. Go to work!”
180
IF A%>5 THEN PRINT “It is ”;WEEKDAY$(DATE$);
“. Stay home!”
RUN
The printer returns (for example):
Monday Apr/03/2003 08.00 am
Date: Apr/03/2003
Time: 08.00 am
Weekday: Thursday
Week No.: 14
Day No.: 93
Run time: 1 minutes
It is Thursday. Go to work!