278
Outstrc(9, "No Explanation on File")
end
-- 10 20 30 40
-- 1234567890123456789012345678901234567890
Outstrc(14, "Contact Fred Durst For Assistance")
OutstrcBottom("Exit Enter Next Prev") -- OutstrcBottom - will make the line turn RED
SetupWait() -- Blocks until a terminating key is pressed (ENTER, NEXT, or PREV)
Exit()
end
-- -----------------------------------------------------------------------------
-- Validate the Driver can load on this day (Su, Mo, Tu, We, Th, Fr, Sa)
-- -----------------------------------------------------------------------------
-- The GetDate ("%w") returns the day of the week [0-6]. Need to add 1 to the value.
cur_day_of_week = tonumber(GetDate("%w")) + 1
-- The string.sub (s, "start", "end")returns the sub-string from "start" - "end".
-- The string.sub ("SMTWTFS", "5", "5") Returns T(hursday) (5).
if string.sub (driver.access_days, cur_day_of_week, cur_day_of_week) ~= "Y" then
Outstrc(0, "Toptech Terminal")
-- 10 20 30 40
-- 1234567890123456789012345678901234567890
Outstrc(2, string.format("%s", driver.name))
-- 10 20 30 40
-- 1234567890123456789012345678901234567890
Outstrc(5, "You Do NOT have Access TODAY!")
Outstrc(7, "You ONLY have access on:")
Outstrp(10, 9, "Su Mo Tu We Th Fr Sa")
Outstrp(10, 10, string.sub (driver.access_days, 1, 1))
Outstrp(13, 10, string.sub (driver.access_days, 2, 2))
Outstrp(16, 10, string.sub (driver.access_days, 3, 3))
Outstrp(19, 10, string.sub (driver.access_days, 4, 4))
Outstrp(22, 10, string.sub (driver.access_days, 5, 5))
Outstrp(25, 10, string.sub (driver.access_days, 6, 6))
Outstrp(28, 10, string.sub (driver.access_days, 7, 7))
Outstrc(14, "Contact Fred Durst For Assistance")
OutstrcBottom("Exit Enter Next Prev") -- OutstrcBottom - will make the line turn RED
SetupWait() -- Blocks until a terminating key is pressed (ENTER, NEXT, or PREV)
Exit()
end
-- -------------------------------------------------
-- Validate the drive can load at this time
-- -------------------------------------------------
access_from = os.time(
{year=GetDate("%Y"),
month=GetDate("%m"),
day=GetDate("%d"),
hour=string.sub(driver.access_from, 1, 2),
min=string.sub(driver.access_from, 4, 5),
sec=string.sub(driver.access_from, 7, 8)})
access_to = os.time(
{year=GetDate("%Y"),
month=GetDate("%m"),
day=GetDate("%d"),
hour=string.sub(driver.access_to , 1, 2),
min=string.sub(driver.access_to , 4, 5),
sec=string.sub(driver.access_to , 7, 8)})
--os.difftime (t2, t1)
--Returns the difference, in secs, from time t1 to time t2 (where the times are values returned by
--os.time). In POSIX, Windows, and some other systems, this value is exactly t2-t1
from_diff_time = os.difftime(current_os_date_time, access_from)
to_diff_time = os.difftime(access_to, current_os_date_time)
if (from_diff_time < 0 or to_diff_time < 0) then