Remote-processing BASIC 52 Uživatelský manuál Strana 45

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 163
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 44
RPBASIC-52 PROGRAMMING GUIDE
2-26
DATE (function)
Syntax: A = DATE(n)
Where: n = 0 to 3
0 = year (last two digits)
1 = month
2 = day
3 = day of week
Function: Returns the month, day, day of week, or year from the optional real time clock
Mode: Command, Run
Use: A=DATE(2) Returns day of month
Cards: All. Note exceptions for RPC-52.
DESCRIPTION
A DS1216DM must be in the RAM socket. Consult your hardware manual for location. A numerical value
of the month, day, or year is returned. The program under the TIME function is used to convert numerical
date to a string. Substitute DATE for TIME in the program. STR function 10 also converts a number to a
string.
A HARDWARE error is returned if the RTC is missing or bad. Use the ONERR construct to trap a defective
DS1216DM. Hardware error code at address 101H is 50.
Day of week is returned only on cards w hich use a DS1216DM clock module. (This exc ludes t he R PC-5 2.)
RELATED
DATE (command), TIME
ERRORS
BAD ARGUMENT When n out of range or negative
HARDWARE RTC module missing or bad
EXAMPLE
100 PRINT "Time: ",
110 FOR N=0 TO 2
120 PRINT TIME(N),
130 NEXT
140 PRINT " Date: ",
150 FOR N=0 TO 3
160 PRINT DATE(N),
170 NEXT
180 PRINT CR,
190 GOTO 100
run
Time: 13 24 12 Date: 94 11 14 3
Zobrazit stránku 44
1 2 ... 40 41 42 43 44 45 46 47 48 49 50 ... 162 163

Komentáře k této Příručce

Žádné komentáře