![]() ![]() ![]() ![]() Gravitybox Schedule Primer
Page 50
1998-2004 Gravitybox Software LLC
The following code will load all the data a file contains.
Public Sub Save()
Dim oXMLParameters As CXMLParameters
Call oXMLParameters.UseAllCollections(True)
oXMLParameters.FileName = "c:\schedule.gcf"
Call Schedule1.ImportXML(oXMLParameters)
Set oXMLParameters = Nothing
End Sub
The UseAllCollections method was invoked to set all the load flags for all the collections
to true. This will load the data for each of those collections, if data exists in the file.
ExportXML
A schedule may be saved using the ExportXML method. It also takes a
CXMLParameters object as a parameter, though more of its properties are used. The
object may be setup just as if calling the ImportXML routine, with the exception that the
Overwrite Boolean flag may be set to true, to overwrite the file, if it exists.
Dim oXMLParameters As CXMLParameters
Call oXMLParameters.UseAllCollections(True)
oXMLParameters.FileName = "c:\schedule.gcf"
oXMLParameters.Overwrite = True
Call Schedule1.ExportXML(oXMLParameters)
Set oXMLParameters = Nothing
Do remember when loading a file, no information on a schedule is removed. If a
schedule has one appointment on it and a saved file is loaded with two appointments in
it, there will be total of three appointments on the schedule, after the load. If there is
previous information in a schedule collection, it will probably need to be cleared before a
file is loaded. Clearing first will ensure that after a load, the only items in a schedule
collection are the items loaded from file. This action is not necessary however. If two or
more schedules are being merged, multiple loads without first clearing is desirable.
Which collections to save is a concern as well. It may be desired to save only the
ScheduleItems collection. Perhaps there is no need for information in the other
collections. There may be a standard format an application has, with common
Providers, Categories, etc. In this case, it is redundant to save the information that is
already known. The other collections may be toggled off. The ScheduleItems collection
|