% % accept date and request time slot % _Sms.Body trim any? { % % check for an x to end the scheduling attempt % dup 1 left upper "X" eq$ { % % the driver wishes to end the current scheduling attempt % pop "We will stop trying to schedule this Pickup number," &" send the Pickup number when you are ready to schedule it." "ReqRsv" *skednumb } { "-" "/" replall length 6 eq { % % is a six digit date probably % dup dup 2 right exch -2 right 2 right % % stack: date year month % exch ^"/20" & % % stack: date month/year % exch 2 left &"/" ^ } { % % not six digits, assume a regular date % } ifelse !Sked.Date _Sked.Date isdate { % % is a proper date, make sure within future period limit % %%% _Sms.Body trim dup !Sked.Date Time.Now " " left$ _Sked.Date "d" Time.Diff "skedatediff" log)( dup 1 ge "notoday" log)( exch _Sked.Future - "futur" log)( le and } { false } ifelse % % request the time slot or re-ask for date % { *skedtmsl } { "Unable to accept that date, please reply with date for scheduled Pickup." &" Text us a six digit date (example 011423)." catcr &"Text the letter x to end the scheduling process for the Pickup number." } ifelse } ifelse } { "Must supply a proper date, please text a six digit date (example 011423)." catcr &"Text the letter x to end the scheduling process for the Pickup number." } ifelse *skedxmit