LOAD_HOLIDAYS Procedure
Makes the value of the !Holiday_List system variable available to the date/time routines.
Usage
LOAD_HOLIDAYS
Parameters
None.
Keywords
None.
Discussion
Run LOAD_HOLIDAYS after you:
Restore a PV-WAVE session in which you used the CREATE_HOLIDAYS function. Running this procedure makes the restored !Holiday_List system variable available to the date/time routines.
Directly change the value of the !Holiday_List system variable, instead of using the CREATE_HOLIDAYS procedure.
This procedure is called by the CREATE_HOLIDAYS function. Thus, CREATE_HOLIDAYS both creates holidays and makes them available to the date/time routines.
note | If all weekdays have been defined as weekend days, an error results. |
Example
This example shows how you might directly modify the system variable !Holiday_List and then run LOAD_HOLIDAYS to make the change available. Assume that December 26 has been erroneously defined as a holiday and that it is the first date/time structure in !Holiday_List. The following example demonstrates how to change this holiday to December 25.
note | Whenever you directly modify the date in a !DT structure, set the Recalc field (the last field in the !DT structure) to 1. This causes the Julian date to be recalculated. If the Julian date is not recalculated, plots or date/time calculations that use the modified variable may be inaccurate. |
holidays = STR_TO_DT(['12-26-2010'], Date_Fmt=1)
CREATE_HOLIDAYS, holidays
PRINT, 'Before: ', !Holiday_List(0)
; Manually change Day field of the first date/time structure in
; !Holiday_List to the 25th. The Day field of this structure
; contains a byte value.
!Holiday_List(0).DAY = 25B
; Manually set the Recalc field of the structure to 1.
; This field contains a byte value.
!Holiday_List(0).RECALC = 1B
; Run LOAD_HOLIDAYS so the new holiday value will take effect.
LOAD_HOLIDAYS
PRINT, ' After: ', !Holiday_List(0)
See Also
For more information, see the PV‑WAVE User’s Guide.