home *** CD-ROM | disk | FTP | other *** search
- on PC_dateH
- global YY, MM, DD
- set YY to 2001
- set MM to random(12)
- set DD to random(28)
- set K to the long date
- set TTL to []
- set n to 0
- set m to 1
- repeat while n <= length(K)
- set n to n + 1
- set CN to charToNum(char n of K)
- if (CN >= 48) and (CN <= 57) then
- nothing()
- next repeat
- end if
- set fig to value(char m to n - 1 of K)
- if not voidp(fig) and (char m to n - 1 of K <> EMPTY) and (n > 1) then
- append(TTL, fig)
- end if
- set m to n + 1
- end repeat
- if getAt(TTL, 1) < 35 then
- set DD to getAt(TTL, 1)
- set YY to getAt(TTL, 2)
- else
- set DD to getAt(TTL, 2)
- set YY to getAt(TTL, 1)
- end if
- set K to the short date
- set TL to []
- set n to 0
- set m to 1
- repeat while n <= length(K)
- set n to n + 1
- set CN to charToNum(char n of K)
- if (CN >= 48) and (CN <= 57) then
- nothing()
- next repeat
- end if
- set fig to value(char m to n - 1 of K)
- if not voidp(fig) then
- append(TL, fig)
- end if
- set m to n + 1
- end repeat
- repeat with n = 1 to count(TL)
- set TEST to getAt(TL, n)
- if (TEST = YY) or ((TEST + 1900) = YY) or (TEST = DD) then
- deleteAt(TL, n)
- set n to n - 1
- end if
- end repeat
- if count(TL) = 1 then
- set MM to getAt(TL, 1)
- else
- repeat with n = 1 to count(TL)
- set TEST to getAt(TL, n)
- if (TEST = YY) or ((TEST + 2000) = YY) or (TEST = DD) then
- deleteAt(TL, n)
- set n to n - 1
- end if
- end repeat
- if count(TL) = 1 then
- set MM to getAt(TL, 1)
- end if
- end if
- if YY < 100 then
- set YY to YY + 2000
- end if
- end
-