+ // Process the LOCATION value.
+
+ if (LocationData.size() > 0){
+
+ DataLine += "LOCATION";
+
+ if (LocationDataAltRep.size() > 0){
+
+ DataLine += ";ALTREP=\"";
+ DataLine += LocationDataAltRep;
+ DataLine += "\"";
+
+ }
+
+ if (LocationDataLanguage.size() > 0){
+
+ DataLine += ";LANGUAGE=";
+ DataLine += LocationDataLanguage;
+
+ }
+
+ if (LocationDataTokens.size() > 0){
+
+ DataLine += ";";
+ DataLine += LocationDataTokens;
+
+ }
+
+ DataLine += ":";
+ DataLine += LocationData;
+ DataLine += "\n";
+
+ DataLineProcessed = OutputText(&DataLine);
+
+ *SaveData += DataLineProcessed;
+
+ DataLine.clear();
+ DataLineProcessed.clear();
+
+ }
+
+ // Process the ORGANIZER value.
+
+ if (OrganiserData.size() > 0){
+
+ DataLine += "ORGANIZER";
+
+ if (OrganiserDataCommonName.size() > 0){
+
+ DataLine += ";CN=";
+ DataLine += OrganiserDataCommonName;
+
+ }
+
+ if (OrganiserDataDirectoryEntry.size() > 0){
+
+ DataLine += ";DIR=\"";
+ DataLine += OrganiserDataDirectoryEntry;
+ DataLine += "\"";
+
+ }
+
+ if (OrganiserDataSentByParam.size() > 0){
+
+ DataLine += ";SENT-BY=\"";
+ DataLine += OrganiserDataSentByParam;
+ DataLine += "\"";
+
+ }
+
+ if (OrganiserDataLanguage.size() > 0){
+
+ DataLine += ";LANGUAGE=";
+ DataLine += OrganiserDataLanguage;
+
+ }
+
+ if (OrganiserDataTokens.size() > 0){
+
+ DataLine += ";";
+ DataLine += OrganiserDataTokens;
+
+ }
+
+ DataLine += ":";
+ DataLine += OrganiserData;
+ DataLine += "\n";
+
+ DataLineProcessed = OutputText(&DataLine);
+
+ *SaveData += DataLineProcessed;
+
+ DataLine.clear();
+ DataLineProcessed.clear();
+
+ }
+
+ // Process the PERCENT-COMPLETE value.
+
+ if (PercentCompleteData.size() > 0){
+
+ if (PercentCompleteTokens.size() > 0){
+
+ DataLine += "PERCENT-COMPLETE;";
+ DataLine += PercentCompleteTokens;
+
+ } else {
+
+ DataLine += "PERCENT-COMPLETE";
+
+ }
+
+ DataLine += ":";
+ DataLine += PercentCompleteData;
+ DataLine += "\n";
+
+ DataLineProcessed = OutputText(&DataLine);
+
+ *SaveData += DataLineProcessed;
+
+ DataLine.clear();
+ DataLineProcessed.clear();
+
+ }
+
+ // Process the PRIORITY value.
+
+ if (PriorityData > -1 && PriorityData < 10){
+
+ DataLine += "PRIORITY";
+
+ if (PriorityTokens.size() > 0){
+
+ DataLine += ";";
+ DataLine += PriorityTokens;
+
+ }
+
+ DataLine += ":";
+ DataLine += to_string(PriorityData);
+ DataLine += "\n";
+
+ DataLineProcessed = OutputText(&DataLine);
+
+ *SaveData += DataLineProcessed;
+
+ DataLine.clear();
+ DataLineProcessed.clear();
+
+ }
+
+ // Process the RECURRENCE-ID value.
+
+ if (RecurranceIDData.size() > 0){
+
+ DataLine += "RECURRENCE-ID";
+
+ if (RecurranceIDDataTimeZoneParam.size() > 0){
+
+ DataLine += ";TZID=";
+ DataLine += RecurranceIDDataTimeZoneParam;
+
+ }
+
+ if (RecurranceIDDataRangeParam.size() > 0){
+
+ DataLine += ";RANGE=";
+ DataLine += RecurranceIDDataRangeParam;
+
+ }
+
+ if (RecurranceIDDataValue.size() > 0){
+
+ DataLine += ";VALUE=";
+ DataLine += RecurranceIDDataValue;
+
+ }
+
+ if (RecurranceIDDataTokens.size() > 0){
+
+ DataLine += ";";
+ DataLine += RecurranceIDDataTokens;
+
+ }
+
+ DataLine += ":";
+ DataLine += RecurranceIDData;
+ DataLine += "\n";
+
+ DataLineProcessed = OutputText(&DataLine);
+
+ *SaveData += DataLineProcessed;
+
+ DataLine.clear();
+ DataLineProcessed.clear();
+
+ }
+
+ // Process the SEQUENCE value.
+
+ if (SequenceData > -1 && SequenceData < 10){
+
+ DataLine += "SEQUENCE";
+
+ if (SequenceTokens.size() > 0){
+
+ DataLine += ";";
+ DataLine += SequenceTokens;
+
+ }
+
+ DataLine += ":";
+ DataLine += to_string(SequenceData);
+ DataLine += "\n";
+
+ DataLineProcessed = OutputText(&DataLine);
+
+ *SaveData += DataLineProcessed;
+
+ DataLine.clear();
+ DataLineProcessed.clear();
+
+ }
+
+ // Process the STATUS value.
+
+ if (StatusData.size() > 0){
+
+ DataLine += "STATUS";
+
+ if (StatusLanguage.size() > 0){
+
+ DataLine += ";LANGUAGE=";
+ DataLine += StatusLanguage;
+
+ }
+
+ if (StatusTokens.size() > 0){
+
+ DataLine += ";";
+ DataLine += StatusTokens;
+
+ }
+
+ DataLine += ":";
+ DataLine += StatusData;
+ DataLine += "\n";
+
+ DataLineProcessed = OutputText(&DataLine);
+
+ *SaveData += DataLineProcessed;
+
+ DataLine.clear();
+ DataLineProcessed.clear();
+
+ }
+
+ // Process the SUMMARY.
+
+ if (SummaryData.size() > 0){
+
+ DataLine += "SUMMARY";
+
+ if (SummaryDataAltRep.size() > 0){
+
+ DataLine += ";ALTREP=\"";
+ DataLine += SummaryDataAltRep;
+ DataLine += "\"";
+
+ }
+
+ if (SummaryDataLanguage.size() > 0){
+
+ DataLine += ";LANGUAGE=";
+ DataLine += SummaryDataLanguage;
+
+ }
+
+ if (SummaryDataTokens.size() > 0){
+
+ DataLine += ";";
+ DataLine += SummaryDataTokens;
+
+ }
+
+ DataLine += ":";
+ DataLine += SummaryData;
+ DataLine += "\n";
+
+ DataLineProcessed = OutputText(&DataLine);
+
+ *SaveData += DataLineProcessed;
+
+ DataLine.clear();
+ DataLineProcessed.clear();
+
+ }
+
+ // Process the URL value.
+
+ if (URLData.size() > 0){
+
+ DataLine += "URL";
+
+ if (URLDataTokens.size() > 0){
+
+ DataLine += ";";
+ DataLine += URLDataTokens;
+
+ }
+
+ DataLine += ":";
+ DataLine += URLData;
+ DataLine += "\n";
+
+ DataLineProcessed = OutputText(&DataLine);
+
+ *SaveData += DataLineProcessed;
+
+ DataLine.clear();
+ DataLineProcessed.clear();
+
+ }
+
+ // Process the RRULE value.
+
+ if (RecurranceRuleData.size() > 0){
+
+ DataLine += "RRULE";
+
+ if (RecurranceRuleDataTokens.size() > 0){
+
+ DataLine += ";";
+ DataLine += RecurranceRuleDataTokens;
+
+ }
+
+ DataLine += ":";
+ DataLine += RecurranceRuleData;
+ DataLine += "\n";
+
+ DataLineProcessed = OutputText(&DataLine);
+
+ *SaveData += DataLineProcessed;
+
+ DataLine.clear();
+ DataLineProcessed.clear();
+
+ }
+
+ // Process the DUE value.
+
+ if (DueData.size() > 0){
+
+ DataLine += "DUE";
+
+ if (DueDataTimeZoneID.size() > 0){
+
+ DataLine += ";TZID=";
+ DataLine += DueDataTimeZoneID;
+
+ }
+
+ if (DueDataValue.size() > 0){
+
+ DataLine += ";VALUE=";
+ DataLine += DueDataValue;
+
+ }
+
+ if (SummaryDataTokens.size() > 0){
+
+ DataLine += ";";
+ DataLine += DueDataTokens;
+
+ }
+
+ DataLine += ":";
+ DataLine += DueData;
+ DataLine += "\n";
+
+ DataLineProcessed = OutputText(&DataLine);
+
+ *SaveData += DataLineProcessed;
+
+ DataLine.clear();
+ DataLineProcessed.clear();
+
+ }
+
+ // Process the ATTACH values.
+
+ if (AttachList.size() > 0){
+
+ for (int AttachListSeek = 0; AttachListSeek < AttachList.size();
+ AttachListSeek++){
+
+ DataLine += "ATTACH";
+
+ if (AttachListFormatType[AttachListSeek].size() > 0){
+
+ DataLine += ";FMTTYPE=";
+ DataLine += AttachListFormatType[AttachListSeek];
+
+ }
+
+ if (AttachListValue[AttachListSeek].size() > 0){
+
+ DataLine += ";VALUE=";
+ DataLine += AttachListValue[AttachListSeek];
+
+ }
+
+ if (AttachListEncoding[AttachListSeek].size() > 0){
+
+ DataLine += ";ENCODING=";
+ DataLine += AttachListEncoding[AttachListSeek];
+
+ }
+
+ if (AttachListTokens[AttachListSeek].size() > 0){
+
+ DataLine += ";";
+ DataLine += AttachListTokens[AttachListSeek];
+
+ }
+
+ DataLine += ":";
+ DataLine += AttachList[AttachListSeek];
+ DataLine += "\n";
+
+ DataLineProcessed = OutputText(&DataLine);
+
+ *SaveData += DataLineProcessed;
+
+ DataLine.clear();
+ DataLineProcessed.clear();
+
+ }
+
+ }
+
+ // Process the ATTENDEE value.
+
+ if (AttendeeList.size() > 0){
+
+ for (int AttendeeListSeek = 0; AttendeeListSeek < AttendeeList.size();
+ AttendeeListSeek++){
+
+ DataLine += "ATTENDEE";
+
+ if (AttendeeListMember[AttendeeListSeek].size() > 0){
+
+ DataLine += ";MEMBER=\"";
+ DataLine += AttendeeListMember[AttendeeListSeek];
+ DataLine += "\"";
+
+ }
+
+ if (AttendeeListDelegatedFrom[AttendeeListSeek].size() > 0){
+
+ DataLine += ";DELEGATED-FROM=\"";
+ DataLine += AttendeeListDelegatedFrom[AttendeeListSeek];
+ DataLine += "\"";
+
+ }
+
+ if (AttendeeListDelegatedTo[AttendeeListSeek].size() > 0){
+
+ DataLine += ";DELEGATED-TO=\"";
+ DataLine += AttendeeListDelegatedTo[AttendeeListSeek];
+ DataLine += "\"";
+
+ }
+
+ if (AttendeeListRole[AttendeeListSeek].size() > 0){
+
+ DataLine += ";ROLE=";
+ DataLine += AttendeeListRole[AttendeeListSeek];
+
+ }
+
+ if (AttendeeListRSVP[AttendeeListSeek].size() > 0){
+
+ DataLine += ";RSVP=";
+ DataLine += AttendeeListRSVP[AttendeeListSeek];
+
+ }
+
+ if (AttendeeListDirectoryEntry[AttendeeListSeek].size() > 0){
+
+ DataLine += ";DIR=\"";
+ DataLine += AttendeeListDirectoryEntry[AttendeeListSeek];
+ DataLine += "\"";
+
+ }
+
+ if (AttendeeListSentBy[AttendeeListSeek].size() > 0){
+
+ DataLine += ";SENT-BY=\"";
+ DataLine += AttendeeListSentBy[AttendeeListSeek];
+ DataLine += "\"";
+
+ }
+
+ if (AttendeeListCommonName[AttendeeListSeek].size() > 0){
+
+ DataLine += ";CN=\"";
+ DataLine += AttendeeListCommonName[AttendeeListSeek];
+ DataLine += "\"";
+
+ }
+
+ if (AttendeeListCalendarUserType[AttendeeListSeek].size() > 0){
+
+ DataLine += ";CUTYPE=";
+ DataLine += AttendeeListCalendarUserType[AttendeeListSeek];
+
+ }
+
+ if (AttendeeListParticipationStatus[AttendeeListSeek].size() > 0){
+
+ DataLine += ";PARTSTAT=";
+ DataLine += AttendeeListParticipationStatus[AttendeeListSeek];
+
+ }
+
+ if (AttendeeListLanguage[AttendeeListSeek].size() > 0){
+
+ DataLine += ";LANGUAGE=";
+ DataLine += AttendeeListLanguage[AttendeeListSeek];
+
+ }
+
+ if (AttendeeListTokens[AttendeeListSeek].size() > 0){
+
+ DataLine += ";";
+ DataLine += AttendeeListTokens[AttendeeListSeek];
+
+ }
+
+ DataLine += ":";
+ DataLine += AttendeeList[AttendeeListSeek];
+ DataLine += "\n";
+
+ DataLineProcessed = OutputText(&DataLine);
+
+ *SaveData += DataLineProcessed;
+
+ DataLine.clear();
+ DataLineProcessed.clear();
+
+ }
+
+ }
+
+ // Process the CATEGORIES value.
+
+ if (CategoriesList.size() > 0){
+
+ for (int CategoriesListSeek = 0; CategoriesListSeek < CategoriesList.size();
+ CategoriesListSeek++){
+
+ DataLine += "CATEGORIES";
+
+ if (CategoriesListLanguage[CategoriesListSeek].size() > 0){
+
+ DataLine += ";LANGUAGE=";
+ DataLine += CategoriesListLanguage[CategoriesListSeek];
+
+ }
+
+ if (CategoriesListTokens[CategoriesListSeek].size() > 0){
+
+ DataLine += ";";
+ DataLine += CategoriesListTokens[CategoriesListSeek];
+
+ }
+
+ DataLine += ":";
+ DataLine += CategoriesList[CategoriesListSeek];
+ DataLine += "\n";
+
+ DataLineProcessed = OutputText(&DataLine);
+
+ *SaveData += DataLineProcessed;
+
+ DataLine.clear();
+ DataLineProcessed.clear();
+
+ }
+
+ }
+
+ // Process the COMMENT value.
+
+ if (CommentList.size() > 0){
+
+ for (int CommentListSeek = 0; CommentListSeek < CommentList.size();
+ CommentListSeek++){
+
+ DataLine += "COMMENT";
+
+ if (CommentListAltRep[CommentListSeek].size() > 0){
+
+ DataLine += ";ALTREP=\"";
+ DataLine += CommentListAltRep[CommentListSeek];
+ DataLine += "\"";
+
+ }
+
+ if (CommentListLanguage[CommentListSeek].size() > 0){
+
+ DataLine += ";LANGUAGE=";
+ DataLine += CommentListLanguage[CommentListSeek];
+
+ }
+
+ if (CommentListTokens[CommentListSeek].size() > 0){
+
+ DataLine += ";";
+ DataLine += CommentListTokens[CommentListSeek];
+
+ }
+
+ DataLine += ":";
+ DataLine += CommentList[CommentListSeek];
+ DataLine += "\n";
+
+ DataLineProcessed = OutputText(&DataLine);
+
+ *SaveData += DataLineProcessed;
+
+ DataLine.clear();
+ DataLineProcessed.clear();
+
+ }
+
+ }
+
+ // Process the CONTACT value.
+
+ if (ContactList.size() > 0){
+
+ for (int ContactListSeek = 0; ContactListSeek < ContactList.size();
+ ContactListSeek++){
+
+ DataLine += "CONTACT";
+
+ if (ContactListAltRep[ContactListSeek].size() > 0){
+
+ DataLine += ";ALTREP=\"";
+ DataLine += ContactListAltRep[ContactListSeek];
+ DataLine += "\"";
+
+ }
+
+ if (ContactListLanguage[ContactListSeek].size() > 0){
+
+ DataLine += ";LANGUAGE=";
+ DataLine += ContactListLanguage[ContactListSeek];
+
+ }
+
+ if (ContactListTokens[ContactListSeek].size() > 0){
+
+ DataLine += ";";
+ DataLine += ContactListTokens[ContactListSeek];
+
+ }
+
+ DataLine += ":";
+ DataLine += ContactList[ContactListSeek];
+ DataLine += "\n";
+
+ DataLineProcessed = OutputText(&DataLine);
+
+ *SaveData += DataLineProcessed;
+
+ DataLine.clear();
+ DataLineProcessed.clear();
+
+ }
+
+ }
+
+ // Process the EXDATE value.
+
+ if (ExcludeDateData.size() > 0){
+
+ for (int ExcludeDateDataSeek = 0; ExcludeDateDataSeek < ExcludeDateData.size();
+ ExcludeDateDataSeek++){
+
+ DataLine += "EXDATE";
+
+ if (ExcludeDateDataTimeZoneParam[ExcludeDateDataSeek].size() > 0){
+
+ DataLine += ";TZID=";
+ DataLine += ExcludeDateDataTimeZoneParam[ExcludeDateDataSeek];
+
+ }
+
+ if (ExcludeDateDataValue[ExcludeDateDataSeek].size() > 0){
+
+ DataLine += ";VALUE=";
+ DataLine += ExcludeDateDataValue[ExcludeDateDataSeek];
+
+ }
+
+ if (ExcludeDateDataTokens[ExcludeDateDataSeek].size() > 0){
+
+ DataLine += ";";
+ DataLine += ExcludeDateDataTokens[ExcludeDateDataSeek];
+
+ }
+
+ DataLine += ":";
+ DataLine += ExcludeDateData[ExcludeDateDataSeek];
+ DataLine += "\n";
+
+ DataLineProcessed = OutputText(&DataLine);
+
+ *SaveData += DataLineProcessed;
+
+ DataLine.clear();
+ DataLineProcessed.clear();
+
+ }
+
+ }
+
+ // Process the REQUEST-STATUS value.
+
+ if (RequestStatusData.size() > 0){
+
+ for (int RequestStatusDataSeek = 0; RequestStatusDataSeek < RequestStatusData.size();
+ RequestStatusDataSeek++){
+
+ DataLine += "REQUEST-STATUS";
+
+ if (RequestStatusLanguage[RequestStatusDataSeek].size() > 0){
+
+ DataLine += ";LANGUAGE=";
+ DataLine += RequestStatusLanguage[RequestStatusDataSeek];
+
+ }
+
+ if (RequestStatusTokens[RequestStatusDataSeek].size() > 0){
+
+ DataLine += ";";
+ DataLine += RequestStatusTokens[RequestStatusDataSeek];
+
+ }
+
+ DataLine += ":";
+ DataLine += RequestStatusData[RequestStatusDataSeek];
+ DataLine += "\n";
+
+ DataLineProcessed = OutputText(&DataLine);
+
+ *SaveData += DataLineProcessed;
+
+ DataLine.clear();
+ DataLineProcessed.clear();
+
+ }
+
+ }
+
+ // Process the RELATED-TO value.
+
+ if (RelatedToData.size() > 0){
+
+ for (int RequestToDataSeek = 0; RequestToDataSeek < RelatedToData.size();
+ RequestToDataSeek++){
+
+ DataLine += "RELATED-TO";
+
+ if (RelatedToDataRelationType[RequestToDataSeek].size() > 0){
+
+ DataLine += ";RELTYPE=";
+ DataLine += RelatedToDataRelationType[RequestToDataSeek];
+
+ }
+
+ if (RelatedToDataTokens[RequestToDataSeek].size() > 0){
+
+ DataLine += ";";
+ DataLine += RelatedToDataTokens[RequestToDataSeek];
+
+ }
+
+ DataLine += ":";
+ DataLine += RelatedToData[RequestToDataSeek];
+ DataLine += "\n";
+
+ DataLineProcessed = OutputText(&DataLine);
+
+ *SaveData += DataLineProcessed;
+
+ DataLine.clear();
+ DataLineProcessed.clear();
+
+ }
+
+ }
+
+ // Process the RESOURCES value.
+
+ if (ResourcesData.size() > 0){
+
+ for (int ResourcesDataSeek = 0; ResourcesDataSeek < ResourcesData.size();
+ ResourcesDataSeek++){
+
+ DataLine += "RESOURCES";
+
+ if (ResourcesDataAltRep[ResourcesDataSeek].size() > 0){
+
+ DataLine += ";ALTREP=\"";
+ DataLine += ResourcesDataAltRep[ResourcesDataSeek];
+ DataLine += "\"";
+
+ }
+
+ if (ResourcesDataLanguage[ResourcesDataSeek].size() > 0){
+
+ DataLine += ";LANGUAGE=";
+ DataLine += ResourcesDataLanguage[ResourcesDataSeek];
+
+ }
+
+ if (ResourcesDataTokens[ResourcesDataSeek].size() > 0){
+
+ DataLine += ";";
+ DataLine += ResourcesDataTokens[ResourcesDataSeek];
+
+ }
+
+ DataLine += ":";
+ DataLine += ResourcesData[ResourcesDataSeek];
+ DataLine += "\n";
+
+ DataLineProcessed = OutputText(&DataLine);
+
+ *SaveData += DataLineProcessed;
+
+ DataLine.clear();
+ DataLineProcessed.clear();
+
+ }
+
+ }
+
+ // Process the RDATE value.
+
+ if (RecurranceDateData.size() > 0){
+
+ for (int RecurranceDateDataSeek = 0; RecurranceDateDataSeek < RecurranceDateData.size();
+ RecurranceDateDataSeek++){
+
+ DataLine += "RDATE";
+
+ if (RecurranceDateDataValue[RecurranceDateDataSeek].size() > 0){
+
+ DataLine += ";VALUE=";
+ DataLine += RecurranceDateDataValue[RecurranceDateDataSeek];
+
+ }
+
+ if (RecurranceDateDataTimeZoneParam[RecurranceDateDataSeek].size() > 0){
+
+ DataLine += ";TZID=";
+ DataLine += RecurranceDateDataTimeZoneParam[RecurranceDateDataSeek];
+
+ }
+
+ if (RecurranceDateDataTokens[RecurranceDateDataSeek].size() > 0){
+
+ DataLine += ";";
+ DataLine += RecurranceDateDataTokens[RecurranceDateDataSeek];
+
+ }
+
+ DataLine += ":";
+ DataLine += RecurranceDateData[RecurranceDateDataSeek];
+ DataLine += "\n";
+
+ DataLineProcessed = OutputText(&DataLine);
+
+ *SaveData += DataLineProcessed;
+
+ DataLine.clear();
+ DataLineProcessed.clear();
+
+ }
+
+ }
+