Important: The information in this document is obsolete and should not be used for new development.
The Toggle Parameter Block
TheToggleDate
function exchanges information with your application using the toggle parameter block, defined by theTogglePB
data type.
TYPE TogglePB = RECORD togFlags: LongInt; {flags} amChars: ResType; {A.M. characters from 'itl0' } { resource, but made uppercase} pmChars: ResType; {P.M. characters from 'itl0' } { resource, but made uppercase} reserved: ARRAY[0..3] OF LongInt; {reserved} END;
Field Description
togFlags
- The high-order word of this field contains flags that specify special conditions for the
ToggleDate
function:genCdevRangeBit = 27; {restrict date/time to } { range used by } { General Controls } { control panel} togDelta12HourBit = 28; {if modifying hour } { up/down, restrict to } { 12-hour range} togCharZCycleBit = 29; {modifier for } { togChar12HourBit to } { accept hours } { 0...11 only} togChar12HourBit = 30; {if modifying hour by } { char, accept hours } { 1...12 only} smallDateBit = 31; {restrict valid } { date/time to } { range of Time global}
- genCdevRangeBit
If this bit is set in addition tosmallDateBit
, then the date range is restricted to that used by the General Controls control panel--January 1, 1920 to December 31, 2019 in the Gregorian calendar (the routine works correctly for other calendars as well). For dates outside this range but within the range specified by the system global variableTime
--January 1, 1904 to February 6, 2040 in the Gregorian calendar--ToggleDate
adds or subtracts 100 years to bring the dates into the range of the General Controls control panel if these bits are set. TheToggleDate
function returns an error if thesmallDateBit
is set and the date is outside the range specified by the system global variableTime
. This bit works with system software version 6.0.4 and later.
togDelta12HourBit
If this bit is set, modifying the hour up or down is limited to a 12-hour range. For example, increasing by one from 11 produces 0, increasing by one from 23 produces 12, and so on. This bit works with system software version 6.0.4 and later.- togCharZCycleBit
If this bit is set, the input character is treated as if it modifies an hour whose value is in the range 0-11. If this bit is not set, the input character is treated as if it modifies an hour whose value is in the range 12, 1-11. This bit works with system software version 6.0.4 and later.- togChar12HourBit
If this bit is set, modifying the hour by character is limited to the 12-hour range defined bytogCharZCycleBit
, mapped to the appropriate half of the 24-hour range, as determined by thepm
field. This bit works with system software version 6.0.4 and later.- smallDateBit
If this bit is set, the valid date and time are restricted to the range of the system global variableTime
--that is, between midnight on January 1, 1904 and 6:28:15 A.M. on February 6, 2040.- The low-order word of this field contains masks representing fields to be checked by the
ValidDate
function. Each mask corresponds to a value in the enumerated typeLongDateField
. You can set this field to check theera
throughsecond
fields by using the predeclared constantdateStdMask
. The following constants specify theLongDateRec
fields for theValidDate
function to check.CONST eraMask = $0001; {verify the era} yearMask = $0002; {verify the year} monthMask = $0004; {verify the month} dayMask = $0008; {verify the day} hourMask = $0010; {verify the hour} minuteMask = $0020; {verify the } { minute} secondMask = $0040; {verify the } { second} dateStdMask = $007F; {verify the era } { through second} dayOfWeekMask = $0080; {verify the day } { of the week} dayOfYearMask = $0100; {verify the day } { of the year} weekOfYearMask = $0200; {verify the week } { of the year} pmMask = $0400; {verify the } { evening (P.M.)}
amChars
- The trailing string to display for morning (for example, A.M.). This string is read from the numeric-format resource (resource type
'itl0'
) of the current script system.pmChars
- The trailing to display for evening (for example, P.M.). This string is read from the numeric-format resource (resource type
'itl0'
) of the current script system.reserved
- Reserved. Set each of the three elements of this field to 0.