+ All Categories
Home > Documents > RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource...

RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource...

Date post: 16-Jul-2020
Category:
Upload: others
View: 4 times
Download: 0 times
Share this document with a friend
290
ConCentRICs for Windows RIC Corp Class Libraries By Resource Information and Control Corporation
Transcript
Page 1: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

ConCentRICs for Windows

RIC Corp Class Libraries

By Resource Information and Control Corporation

Page 2: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

Copyright ã 1994 - 2004 Resource Information and Control Corporation. All rights reserved.Version 6.0 issued on March 12, 2004

This publication was created using Microsoft Word for Windows and Doc-To-Help byWexTech Systems, Inc.

Documentation written by Rick Kriscka, Jeri Dillon, Jon Beams, and Joan Tracey

Indexing by Charmin Tracey

Resource Information and Control Corporation6215 Constitution Drive

Fort Wayne, Indiana 46804-1517United States of America

(219) 432-0799Fax (219) 432-9155

Page 3: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

Contents

RIC Corp Class Library 1Overview............................................................................................................................. 1

Introduction............................................................................................................ 1Function Summary.................................................................................................1Class Changes........................................................................................................ 1

Manual Structure.................................................................................................................. 2Class Summary.......................................................................................................2General Functions..................................................................................................2Application Base Classes........................................................................................2Data Classes........................................................................................................... 2Dialog Classes........................................................................................................ 2Scheduling Classes.................................................................................................3Accounting Classes................................................................................................3

General Functions 5Overview............................................................................................................................. 5

Introduction............................................................................................................ 5Application Connection..........................................................................................5Functions/Structures...............................................................................................5

Global Functions.................................................................................................................. 5CtoIRIC.................................................................................................................. 5CancelCheck.......................................................................................................... 6CharToFloatRIC.....................................................................................................6CharToIntRIC........................................................................................................ 7ExternalInterfaceRIC..............................................................................................7FILERR.................................................................................................................. 8FormatStrRIC......................................................................................................... 9GetFileNameRIC....................................................................................................9KeyBlockRIC.......................................................................................................11LSRIC.................................................................................................................. 11ParseStrRIC.......................................................................................................... 12PlaySoundRIC......................................................................................................12SetDocRIC...........................................................................................................13

Global Structures............................................................................................................... 13BtrvDateRIC........................................................................................................ 13BtrvTimeRIC.......................................................................................................13LogFileRIC..........................................................................................................14MaintBlockRIC....................................................................................................14Global Variable....................................................................................................15

Document Class 17class CRicDoc.................................................................................................................... 17

Introduction..........................................................................................................17

ConCentRICs for Windows RIC Corp Class Libraries Contents · i

Page 4: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

Application Connection........................................................................................20Document Class Functions.................................................................................................20

CRicDoc::AddIconRIC.........................................................................................20CRicDoc::AddTitleRIC........................................................................................21CRicDoc::ChartData.............................................................................................22CRicDoc::ChartOptions........................................................................................22CRicDoc::ChartTitle.............................................................................................23CRicDoc::ClipColRIC..........................................................................................23CRicDoc::ColColorRIC........................................................................................23CRicDoc::ColNxtRIC...........................................................................................24CRicDoc::ColTabRIC...........................................................................................25CRicDoc::DelDocRIC..........................................................................................26CRicDoc::DelLineRIC.........................................................................................26CRicDoc::DetailFirstRIC......................................................................................26CRicDoc::DetailLineRIC......................................................................................27CRicDoc::DetailNextRIC.....................................................................................27CRicDoc::DetailNumRIC.....................................................................................27CRicDoc::DetailPosRIC.......................................................................................27CRicDoc::DocLineRIC.........................................................................................27CRicDoc::EnvelopeRIC........................................................................................28CRicDoc::FileNumRIC........................................................................................29CRicDoc::GetFloatTitle........................................................................................29CRicDoc::IconsRIC..............................................................................................29CRicDoc::IconsPerLineRIC..................................................................................29CRicDoc::IndexLineRIC......................................................................................29CRicDoc::IndexPosRIC........................................................................................30CRicDoc::InitDocRIC..........................................................................................30CRicDoc::m_Control............................................................................................30CRicDoc::m_FloatTitle........................................................................................30CRicDoc::m_Int...................................................................................................30CRicDoc::m_Long...............................................................................................30CRicDoc::m_Long2..............................................................................................31CRicDoc::String...................................................................................................31CRicDoc::String2.................................................................................................31CRicDoc::m_Mode...............................................................................................31CRicDoc::m_NoHeadings....................................................................................31CRicDoc::m_Xfixsize...........................................................................................31CRicDoc::m_Yfixsize...........................................................................................31CRicDoc::UndoData.............................................................................................32CRicDoc::m_UndoRecnum..................................................................................32CRicDoc::m_UndoType.......................................................................................32CRicDoc::MaintLevelsRIC...................................................................................32CRicDoc::MaxColRIC..........................................................................................33CRicDoc::ModuleIdRIC.......................................................................................33CRicDoc::NadrFirstRIC.......................................................................................33CRicDoc::NadrLineRIC.......................................................................................33CRicDoc::NadrNextRIC.......................................................................................33CRicDoc::NadrPosRIC.........................................................................................34CRicDoc::NoCommandRIC.................................................................................34CRicDoc::OpenErrorRIC......................................................................................34CRicDoc::OutputHtmJust.....................................................................................34CRicDoc::OutputHtmFile.....................................................................................35CRicDoc::OutputHtmTitle....................................................................................35CRicDoc::OutputRicFile......................................................................................35CRicDoc::PasteStateRIC......................................................................................35CRicDoc::PathRIC...............................................................................................35

ii · Contents ConCentRICs for Windows RIC Corp Class Libraries

Page 5: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicDoc::SearchDocRIC.....................................................................................36CRicDoc::SelRangeRIC.......................................................................................36CRicDoc::SetBoxRIC...........................................................................................37CRicDoc::SetBoxSizeRIC....................................................................................38CRicDoc::SetClipColRIC.....................................................................................38CRicDoc::SetColRIC............................................................................................38CRicDoc::SetEnvelopeRIC...................................................................................39CRicDoc::SetFileNumRIC....................................................................................39CRicDoc::SetMaintLevelsRIC..............................................................................39CRicDoc::SetModuleIdRIC..................................................................................40CRicDoc::SetPasteRIC.........................................................................................40CRicDoc::SetPathRIC..........................................................................................40CRicDoc::SetSubTitleRIC....................................................................................40CRicDoc::SubTitleRIC.........................................................................................41CRicDoc::TabNumRIC........................................................................................41CRicDoc::TitleFirstRIC........................................................................................41CRicDoc::TitleLineRIC........................................................................................41CRicDoc::TitleNextRIC.......................................................................................41CRicDoc::TitleNumRIC.......................................................................................41CRicDoc::TitlePosRIC.........................................................................................42CRicDoc::UndoStateRIC......................................................................................42

Main Class 43class CRicMain.................................................................................................................. 43

Introduction..........................................................................................................43Application Connection........................................................................................45

Main Class Functions......................................................................................................... 45CRicMain::DateHeadStateRIC.............................................................................45CRicMain::FileNumRIC.......................................................................................45CRicMain::HelpFileRIC.......................................................................................46CRicMain::JustifyStateRIC..................................................................................46CRicMain::LoginRIC...........................................................................................46CRicMain::LoginsRIC..........................................................................................46CRicMain::LogoutRIC.........................................................................................46CRicMain::LogputRIC.........................................................................................46CRicMain::m_Dial...............................................................................................47CRicMain::m_IconId............................................................................................47CRicMain::m_lpfind.............................................................................................47CRicMain::m_Find...............................................................................................47CRicMain::m_FindDlg.........................................................................................47CRicMain::m_FindWhat......................................................................................47CRicMain::m_FindWhatPtr..................................................................................48CRicMain::m_HelpOffset.....................................................................................48CRicMain::m_MapiSession..................................................................................48CRicMain::m_ModuleId.......................................................................................48CRicMain::m_SageMode.....................................................................................48CRicMain::m_SageReg........................................................................................48CRicMain::m_SageSet.........................................................................................48CRicMain::MailStateRIC.....................................................................................49CRicMain::NewMailStateRIC..............................................................................49CRicMain::NewMailStatusRIC.............................................................................49CRicMain::NadrPrintRIC.....................................................................................49CRicMain::NadrWinRIC......................................................................................49CRicMain::OnAppAboutRIC................................................................................49CRicMain::OnHelpCommandRIC........................................................................50

ConCentRICs for Windows RIC Corp Class Libraries Contents · iii

Page 6: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicMain::OnHelpRIC........................................................................................50CRicMain::OrgChgRIC........................................................................................50CRicMain::OrgDirRIC.........................................................................................50CRicMain::OrgNameRIC.....................................................................................50CRicMain::OrgNumRIC.......................................................................................51CRicMain::OrgStateRIC.......................................................................................51CRicMain::OSRIC................................................................................................51CRicMain::PageFormStateRIC.............................................................................51CRicMain::PasswordRIC......................................................................................51CRicMain::PathDirRIC........................................................................................51CRicMain::PathNameRIC....................................................................................52CRicMain::RootDirRIC........................................................................................52CRicMain::SageExitRIC......................................................................................52CRicMain::SageReadRIC.....................................................................................52CRicMain::SageWriteRIC....................................................................................52CRicMain::SecurityLevelRIC...............................................................................53CRicMain::SecurityRIC........................................................................................53CRicMain::SetFileNumRIC..................................................................................53CRicMain::StatNumRIC.......................................................................................54CRicMain::SystemCodeRIC.................................................................................54CRicMain::SystemNameRIC................................................................................54CRicMain::SystemNumRIC.................................................................................54CRicMain::TimeHeadStateRIC............................................................................54CRicMain::TitlePgRIC.........................................................................................54CRicMain::TitlePgStateRIC.................................................................................54CRicMain::TruncateStateRIC...............................................................................54CRicMain::UserDeptRIC......................................................................................55CRicMain::UserDepartmentRIC...........................................................................55CRicMain::UserkeyRIC........................................................................................55CRicMain::UsernumRIC......................................................................................55CRicMain::UserFnameRIC...................................................................................55CRicMain::UserLnameRIC..................................................................................55CRicMain::UserNameRIC....................................................................................55CRicMain::UserPrRIC..........................................................................................55CRicMain::UserPrintRIC......................................................................................56CRicMain::UserStationRIC..................................................................................56CRicMain::UserTitleRIC......................................................................................56CRicMain::VersionRIC........................................................................................56CRicMain::YearDirRIC........................................................................................56

View Class 57class CRicView.................................................................................................................. 57

Introduction..........................................................................................................57Application Connection........................................................................................60

View Functions.................................................................................................................. 60CRicView::BeginPrintRIC....................................................................................60CRicView::ChgViewRIC......................................................................................60CRicView::ContextMenuRIC...............................................................................61CRicView::CopyFlagRIC.....................................................................................61CRicView::CustomColNxtRIC.............................................................................62CRicView::CustomColTabRIC.............................................................................62CRicView::CustomSelRangeRIC..........................................................................63CRicView::DialRIC..............................................................................................63CRicView::DialUpdateRIC..................................................................................64CRicView::DrawLinesRIC...................................................................................64

iv · Contents ConCentRICs for Windows RIC Corp Class Libraries

Page 7: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicView::EndPrintRIC.......................................................................................64CRicView::FindRecRIC.......................................................................................64CRicView::FontSelRIC........................................................................................65CRicView::InitCustomRIC...................................................................................65CRicView::InitialUpdateRIC................................................................................65CRicView::InitPrintRIC.......................................................................................65CRicView::InitViewRIC.......................................................................................65CRicView::LButtonDownRIC..............................................................................65CRicView::m_Active...........................................................................................66CRicView::m_AddMode......................................................................................66CRicView::m_ChgMode......................................................................................66CRicView::m_CPages..........................................................................................66CRicView::m_Custom..........................................................................................66CRicView::m_CustomClipCol..............................................................................66CRicView::m_CustomFBox.................................................................................66CRicView::m_CustomLBox.................................................................................67CRicView::m_CustomMaxCol.............................................................................67CRicView::m_DelMode.......................................................................................67CRicView::m_Detail............................................................................................67CRicView::m_Doc...............................................................................................67CRicView::m_DocTitle........................................................................................67CRicView::m_Format...........................................................................................67CRicView::m_hWnd............................................................................................67CRicView::m_icon...............................................................................................67CRicView::m_Index.............................................................................................68CRicView::m_Initialize........................................................................................68CRicView::m_MapMode......................................................................................68CRicView::m_pCustom........................................................................................68CRicView::m_sCustom........................................................................................68CRicView::m_RecSel...........................................................................................68CRicView::m_RecSel2.........................................................................................68CRicView::m_RecSelK........................................................................................68CRicView::m_Tab................................................................................................69CRicView::m_Title..............................................................................................69CRicView::m_Titles.............................................................................................69CRicView::m_ViewLine......................................................................................69CRicView::m_ViewPage......................................................................................69CRicView::m_ViewSize.......................................................................................69CRicView::MouseMoveRIC.................................................................................69CRicView::OnCopyRIC.......................................................................................69CRicView::OnDrawRIC.......................................................................................70CRicView::OnKeyDownRIC................................................................................70CRicView::OnPrintRIC........................................................................................70CRicView::OnScrollRIC......................................................................................70CRicView::OnSizeRIC.........................................................................................70CRicView::OnTimerRIC......................................................................................71CRicView::PrintToFileRIC..................................................................................71CRicView::PreparePrintRIC.................................................................................71CRicView::SagePrintRIC.....................................................................................71CRicView::SelColChkRIC...................................................................................71CRicView::SelRecBaseRIC..................................................................................72CRicView::SelRecChkRIC...................................................................................72CRicView::SelRecColRIC....................................................................................72CRicView::SelRecEndRIC...................................................................................72CRicView::SelRecInitRIC....................................................................................73CRicView::SelRecNumRIC..................................................................................73

ConCentRICs for Windows RIC Corp Class Libraries Contents · v

Page 8: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicView::SelRecOnRIC.....................................................................................73CRicView::SelRecRIC.........................................................................................73CRicView::SelRecSetRIC....................................................................................73CRicView::SelRecTotRIC....................................................................................74CRicView::SendMailRIC.....................................................................................74CRicView::SetCustomColRIC..............................................................................74CRicView::SetScrollRIC......................................................................................75

Data Classes 77Overview........................................................................................................................... 77

Introduction..........................................................................................................77Application Connection........................................................................................77Data Class Overview............................................................................................77

class CRicCode.................................................................................................................. 78Introduction..........................................................................................................78CodeInitRIC......................................................................................................... 79CodeMaintRIC.....................................................................................................80CodeUndoRIC......................................................................................................80CRicCode::CodeAdd............................................................................................80CRicCode::CodeColor..........................................................................................81CRicCode::CodeDesc...........................................................................................81CRicCode::CodeDialog........................................................................................82CRicCode::CodeFloat...........................................................................................82CRicCode::CodeInt..............................................................................................82CRicCode::CodeLoadCombo...............................................................................83CRicCode::CodeLoadList.....................................................................................83CRicCode::CodeLong...........................................................................................83CRicCode::CodeLookup.......................................................................................84CRicCode::CodeMaint.........................................................................................84CRicCode::CodeParams.......................................................................................84CRicCode::CodeSearch........................................................................................85CRicCode::m_Cat................................................................................................85CRicCode::m_Cat1...............................................................................................86CRicCode::m_Cat2...............................................................................................86CRicCode::m_CatScope.......................................................................................86CRicCode::m_ColorSwt.......................................................................................86CRicCode::m_Doc...............................................................................................86CRicCode::m_Id...................................................................................................86CRicCode::m_LookupName.................................................................................86CRicCode::m_OptionalSwt..................................................................................87CRicCode::m_OrgDir...........................................................................................87CRicCode::m_PrioritySwt....................................................................................87CRicCode::m_RootDir.........................................................................................87CRicCode::m_Scope............................................................................................87CRicCode::m_SecuritySwt...................................................................................87CRicCode::m_ShortSwt........................................................................................87CRicCode::m_Sort...............................................................................................88CRicCode::m_Summary.......................................................................................88CRicCode::m_System...........................................................................................88CRicCode::m_TableName....................................................................................88CRicCode::m_Type..............................................................................................88CRicCode::m_Var................................................................................................88CRicCode::m_VarName.......................................................................................89

class CRicDate................................................................................................................... 89Introduction..........................................................................................................89

vi · Contents ConCentRICs for Windows RIC Corp Class Libraries

Page 9: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicDate::Century...............................................................................................90CRicDate::ChgDate..............................................................................................90CRicDate::ChkDate..............................................................................................90CRicDate::DateInRange.......................................................................................91CRicDate::DayOfWeek........................................................................................91CRicDate::Display................................................................................................92CRicDate::DD......................................................................................................93CRicDate::LeapYear............................................................................................94CRicDate::MaxMonth..........................................................................................94CRicDate::MM.....................................................................................................94CRicDate::Order...................................................................................................94CRicDate::Set.......................................................................................................94CRicDate::Symbol................................................................................................95CRicDate::Value..................................................................................................96CRicDate::YEAR.................................................................................................96CRicDate::YY......................................................................................................96CRicDate::operator +=.........................................................................................96CRicDate::operator -=..........................................................................................96CRicDate::operator ++.........................................................................................97CRicDate::operator --...........................................................................................97CRicDate::operator =............................................................................................97CRicDate::operator -............................................................................................97CRicDate::operator >............................................................................................98CRicDate::operator >=.........................................................................................98CRicDate::operator <............................................................................................98CRicDate::operator <=.........................................................................................98CRicDate::operator ==.........................................................................................99CRicDate::operator !=..........................................................................................99

class CRicName.................................................................................................................99Introduction..........................................................................................................99NameInitRIC......................................................................................................100NameInquiryRIC................................................................................................101CRicName::m_Title...........................................................................................102CRicName::m_Username...................................................................................102CRicName::m_View...........................................................................................102CRicName::NameDialog....................................................................................102CRicName::NameDoc........................................................................................102CRicName::NameFind........................................................................................103CRicName::NameFormat...................................................................................104CRicName::NameHook......................................................................................105CRicName::NameLabels....................................................................................106CRicName::NameLink.......................................................................................106CRicName::NameLookup...................................................................................107CRicName::NameMaint.....................................................................................107CRicName::NameParams().................................................................................108CRicName::NameRecord...................................................................................108CRicName::NameSearch....................................................................................109CRicName::NameSortIn.....................................................................................109CRicName::NameSortOut..................................................................................110

class CRicNum.................................................................................................................110Introduction........................................................................................................110CRicNum::Decimals...........................................................................................112CRicNum::DecimalPoint....................................................................................112CRicNum::Display.............................................................................................112CRicNum::Money..............................................................................................113CRicNum::Separator...........................................................................................114

ConCentRICs for Windows RIC Corp Class Libraries Contents · vii

Page 10: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicNum::Set....................................................................................................114CRicNum::Size...................................................................................................115CRicNum::Symbol.............................................................................................115CRicNum::Value................................................................................................115CRicNum::operator++........................................................................................116CRicNum::operator--..........................................................................................116CRicNum::operator*...........................................................................................116CRicNum::operator/...........................................................................................116CRicNum::operator+..........................................................................................116CRicNum::operator-...........................................................................................117CRicNum::operator=..........................................................................................117CRicNum::operator*=........................................................................................117CRicNum::operator/=.........................................................................................117CRicNum::operator+=........................................................................................117CRicNum::operator-=.........................................................................................118CRicNum::operator>..........................................................................................118CRicNum::operator>=........................................................................................118CRicNum::operator<..........................................................................................118CRicNum::operator<=........................................................................................119CRicNum::operator==........................................................................................119CRicNum::operator!=.........................................................................................119

class CRicSort.................................................................................................................. 119Introduction........................................................................................................119Performing a Sort...............................................................................................120Sort Example......................................................................................................121Sort Functions....................................................................................................121

CRicText.......................................................................................................................... 123Introduction........................................................................................................123CRicText::DataboxToFile...................................................................................124CRicText::DataboxToTable................................................................................124CRicText::FileOutput.........................................................................................124CRicText::FileToDatabox...................................................................................125CRicText::FileToString......................................................................................125CRicText::FileToTable.......................................................................................125CRicText::StringOutput......................................................................................126CRicText::StringToFile......................................................................................126CRicText::StringToTable...................................................................................126CRicText::TableOutput......................................................................................127CRicText::TableToDatabox................................................................................127CRicText::TextDialog........................................................................................127CRicText::TextMaint..........................................................................................128CRicText::TextOutput........................................................................................128Custom Text Files...............................................................................................128Custom Text Screens..........................................................................................129

class CRicTime................................................................................................................ 131Introduction........................................................................................................131CRicTime::AMPM.............................................................................................131CRicTime::ChkTime..........................................................................................132CRicTime::Display.............................................................................................132CRicTime::HH...................................................................................................133CRicTime::HS....................................................................................................133CRicTime::MM..................................................................................................133CRicTime::Set....................................................................................................134CRicTime::Symbol.............................................................................................135CRicTime::SS....................................................................................................135CRicTime::TimeInRange....................................................................................135

viii · Contents ConCentRICs for Windows RIC Corp Class Libraries

Page 11: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicTIme::Value...............................................................................................135CRicTime::operator =.........................................................................................136CRicTime::operator+=........................................................................................136CRicTime::operator-=........................................................................................137CRicTime::operator >.........................................................................................137CRicTime::operator >=.......................................................................................137CRicTime::operator <.........................................................................................137CRicTime::operator <=.......................................................................................138CRicTime::operator ==.......................................................................................138CRicTime::operator !=.......................................................................................138

Dialog Classes 139Overview......................................................................................................................... 139

Introduction........................................................................................................139Application Connection......................................................................................139

CAboutDlg....................................................................................................................... 139Introduction........................................................................................................139Data Members - Public Members........................................................................139

class CPswdDlg................................................................................................................140Introduction........................................................................................................140PassWordRIC.....................................................................................................140

class CRicMig.................................................................................................................. 141Introduction........................................................................................................141CRicMig::OnMigrateInit....................................................................................141CRicMig::OnMigrateDel....................................................................................141CRicMig::MigrateFileOpen................................................................................141CRicMig::MigrateFileClose................................................................................141CRicMig::MigrateFileAdd..................................................................................142CRicMig::OnMigrateEnd....................................................................................142

class CScdeDlg................................................................................................................142Introduction........................................................................................................142Implementation...................................................................................................142AddMode........................................................................................................... 143Title.................................................................................................................... 143Dir...................................................................................................................... 143Category............................................................................................................. 144Nakey................................................................................................................. 144System................................................................................................................144Table.................................................................................................................. 144UserSecurity.......................................................................................................144File..................................................................................................................... 144Codes................................................................................................................. 145Actions...............................................................................................................145DefTable............................................................................................................ 145

Scheduling Class Library 147Overview......................................................................................................................... 147

Introduction........................................................................................................147Application Connection......................................................................................147Scheduling Functions..........................................................................................147

Application Connection....................................................................................................147Introduction........................................................................................................147Project Resources...............................................................................................148Library File........................................................................................................148

ConCentRICs for Windows RIC Corp Class Libraries Contents · ix

Page 12: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

Main Header.......................................................................................................149Main Program.....................................................................................................149All Programs......................................................................................................149Event Files......................................................................................................... 150Standard Event Fields.........................................................................................150Data Formats......................................................................................................151

Tie Project to an Event.....................................................................................................152Introduction........................................................................................................152Main Header.......................................................................................................152Main Program.....................................................................................................152Document Header...............................................................................................152Document Program.............................................................................................153View Program....................................................................................................158

Scheduling Functions.......................................................................................................158Introduction........................................................................................................158AutomaticCheckLists.........................................................................................160AutomaticInvRIC...............................................................................................160BookingDefaults.................................................................................................160BookStatUser.....................................................................................................160DateSelection.....................................................................................................161EventAuditRIC...................................................................................................162EventMaintRIC..................................................................................................162EventOptionsRIC................................................................................................163EventProfileRIC.................................................................................................163EventSearchRIC.................................................................................................164EventSelectedRIC...............................................................................................165EventUpdateRIC.................................................................................................165EventYearRIC....................................................................................................165FindConflicts......................................................................................................165GetEventsRIC.....................................................................................................166InvDialogRIC.....................................................................................................166InvRateDescRIC.................................................................................................167InvRateRIC........................................................................................................167IsValidYear........................................................................................................167ListConflicts.......................................................................................................168LoadValidYears..................................................................................................168LocComboRIC...................................................................................................168LocListBoxRIC..................................................................................................168LocListRIC......................................................................................................... 169LocRateDescRIC................................................................................................169LocRateMaintRIC..............................................................................................170LocRateRIC.......................................................................................................170LocValidRIC......................................................................................................171SchdBasicHelp...................................................................................................171SearchCodesRIC.................................................................................................171SetEventCodesRIC.............................................................................................172SetMaintRIC......................................................................................................172TraceCreateRIC..................................................................................................173UpdateCheckLists...............................................................................................173

Accounting Class Library 175Overview......................................................................................................................... 175

Introduction........................................................................................................175Tie Project to Accounting...................................................................................175Accounting Functions.........................................................................................175

x · Contents ConCentRICs for Windows RIC Corp Class Libraries

Page 13: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

Accounting Methods...........................................................................................175Tie Project to Accounting.................................................................................................176

Introduction........................................................................................................176Project Resources...............................................................................................176Library File........................................................................................................177Main Header.......................................................................................................177Main Program.....................................................................................................177Document Program.............................................................................................178View Header.......................................................................................................178View Program....................................................................................................179

Journal Postings............................................................................................................... 180Introduction........................................................................................................180Project Resources...............................................................................................180Document Header...............................................................................................180Document Program.............................................................................................180View Program....................................................................................................182

Accounting Functions.......................................................................................................182Introduction........................................................................................................182CRicAcct::AcctBasicHelp..................................................................................184CRicAcct::AcctContextMenuRIC.......................................................................185CRicAcct::AcctDebitRIC...................................................................................185CRicAcct::AcctDescRIC....................................................................................185CRicAcct::AcctKeyRIC......................................................................................185CRicAcct::AcctLookup......................................................................................185CRicAcct::AcctMethodRIC................................................................................186CRicAcct::AcctNameRIC...................................................................................186CRicAcct::AcctNumRIC....................................................................................186CRicAcct::AcctSearch........................................................................................186CRicAcct::AcctShortRIC....................................................................................187CRicAcct::AcctsStartRIC...................................................................................187CRicAcct::AcctsValidRIC..................................................................................187CRicAcct::AcctTypeRIC....................................................................................187CRicAcct::ChgFundYearRIC..............................................................................187CRicAcct::ControlNumberRIC...........................................................................187CRicAcct::ConvertTXT......................................................................................188CRicAcct::EventLookup.....................................................................................188CRicAcct::EventSearch......................................................................................188CRicAcct::EventYear.........................................................................................188CRicAcct::FirstMonthRIC..................................................................................188CRicAcct::FundList............................................................................................189CRicAcct::FundNameRIC..................................................................................189CRicAcct::FundPathRIC.....................................................................................189CRicAcct::FundRIC...........................................................................................189CRicAcct::FundStateRIC....................................................................................189CRicAcct::GetFileName.....................................................................................189CRicAcct::InvDtl................................................................................................190CRicAcct::InvMstr.............................................................................................190CRicAcct::InvPay...............................................................................................190CRicAcct::ItemLookup.......................................................................................191CRicAcct::ItemSearch........................................................................................191CRicAcct::JournalPosting...................................................................................191CRicAcct::JournalSummary...............................................................................192CRicAcct::JournalMaint.....................................................................................192CRicAcct::m_AcctList.......................................................................................192CRicAcct::m_ChgMode.....................................................................................193CRicAcct::m_ChgSum.......................................................................................193

ConCentRICs for Windows RIC Corp Class Libraries Contents · xi

Page 14: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicAcct::m_HoldJournal..................................................................................193CRicAcct::m_MajorList.....................................................................................193CRicAcct::m_MinorList.....................................................................................193CRicAcct::m_SumDoc.......................................................................................194CRicAcct::m_TypeList.......................................................................................194CRicAcct::MajorDigitsRIC.................................................................................194CRicAcct::MinorDigitsRIC................................................................................194CRicAcct::NumberSymbolRIC...........................................................................194CRicAcct::PendingPosting..................................................................................194CRicAcct::PostMonthRIC...................................................................................195CRicAcct::TotalDigitsRIC..................................................................................195CRicAcct::TransactionLinks...............................................................................195CRicAcct::TranLinkLookup...............................................................................196CRicAcct::VendorCk..........................................................................................196CRicAcct::VendorInquiry...................................................................................196CRicAcct::VendorPo..........................................................................................196CRicAcct::WriteTransactions.............................................................................197CRicAcct::YearList............................................................................................198CRicAcct::YearNameRIC...................................................................................198CRicAcct::YearPathRIC.....................................................................................198CRicAcct::YearRIC............................................................................................198CRicAcct::YearStateRIC....................................................................................198CRicAcct::YearStatusRIC..................................................................................198

Glossary of Terms 201

Index 203

xii · Contents ConCentRICs for Windows RIC Corp Class Libraries

Page 15: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

RIC Corp Class Library

Overview

IntroductionThe standard Microsoft Foundation Classes (MFC) contain many functions and classes that allow us to development windows applications quickly. They do not provide all of the functions we need for ConCentRICs database applications. Additional functions and classes have been created. This collection of functions and classes is called the RIC Corp Class Library. The RIC Corp Class Library is available to any function by including the header file for the library RICD.H to your project's header file. You then need to add the library RICD.LIB to the link section of your application project.

Function SummaryThe RIC Corp functions can be used just as if they are part of the C++ Language. You can use them within any function of your application. They are functions that almost every application will need. Instead of having each application rewrite the function each time, they have been placed in the RIC Corp Class Library, so they are available for use by all applications. In the course of your development effort, if you create other functions that you feel would be of benefit to other ConCentRICs applications, they can be added to the RIC Corp Class Library. See Rick Kriscka to have your functions included in this section. All of the functions will end with an RIC for easy identification. The only exception to this is the function FILERR. which was named for the old filerr check required by Structure/4. The General Functions section of this chapter discusses each of the available functions in detail.

Class ChangesIf the RIC Corp classes change then the following updated modules need to be copied to the appropriate production directories. The chart below describes each of the files that need to be copied to production and the directories they need to be copied to.

File Name Directory Name

RICD.H R:\RICCORP\INCLUDE

ConCentRICs for Windows RIC Corp Class Libraries RIC Corp Class Library · 1

Page 16: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

RICMIG.H R:\RICCORP\INCLUDE

RICRES.H R:\RICCORP\INCLUDE

RICRES.RC R:\RICCORP\INCLUDE

RICD.LIB R:\RICCORP\LIB

Manual Structure

Class SummaryThere are a large number of RIC Corp Classes. The classes are broken up in logical groupings. These groups are the General Functions, Application Base Classes, Data Classes, Dialog Classes, Scheduling Classes, Accounting Functions.

General FunctionsThe General Functions are really global functions. These functions are available to all functions in all projects at all times. They do not need to be declared. You can use these functions any time you need them. These might not be functions, but they might also be data structures.

Application Base ClassesThe Application Base Classes should only be used in their respected generated base classes. When you start a new project, App Wizard generates your base classes for you. Three of those classes App, Doc, and View have a corresponding RIC Corp Class to supplement the functions in those base classes. Your base App class will use CRicMain, Doc will use CRicDoc, and View will use CRicView. These classes are very large and each one has a chapter dedicated to them. Each of these classes are discussed in detail in their own chapter.

Data ClassesThe Data Classes will handle complex data items, and all the functions required to handle those data items. These include date, time, number, money, and names and addresses. These data types are required by almost every ConCentRICs application. All of these data types have international implications since different countries may display the same values in a unique way. The Data Classes will handle these differences for you with no additional coding in your program. Just by using these classes, you will display the data the way you want to see it. At run time the system will look at the user's Window's control panel and will display the data as requested by the user. You can use these classes within any of your classes in any of your application modules. It is mandatory that you use these classes for those data types.

Dialog Classes The Dialog Classes are common dialog boxes that can be used by all applications that need these functions. This includes such things as the About Box, Password acceptance, along with Table, Code, and Name and Address handling. Each of

2 · RIC Corp Class Library ConCentRICs for Windows RIC Corp Class Libraries

Page 17: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

these classes are discussed in detail in the alphabetical class sections following the General Functions section.

Scheduling ClassesThe Scheduling Classes will contain all of the common scheduling functions that are used by all applications. This includes such things as Event Search, Event Profile, Event Maintenance, Scheduling Help, Location / Inventory Rates and the Automated Inventory and Checklists.

Accounting ClassesThe Accounting Classes will contain all of the common accounting functions that are used by all applications. These functions include such things as Fund Control, Accounting Year Control, Accounting Parameter information, Account Number Control, Accounting Help, and all aspects of Journals from sending transactions to the journals through to the final posting of the journal.

ConCentRICs for Windows RIC Corp Class Libraries RIC Corp Class Library · 3

Page 18: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

General Functions

Overview

IntroductionThe General Functions are really global functions. These functions are available to all functions in all projects at all times. They do not need to be declared. You can use these functions any time you need them. These might not be functions, but they might also be data structures.

Application ConnectionThese functions or structures require no extra declarations. They were automatically declared when you first built your project. There is no restriction on their use. All functions in your project may use these functions and/or structures at any point when they are required.

Functions/StructuresThe objects in this section are divided into two sections: Global Functions and Global Structures. The functions are lines of code put together to perform a common function. These are functions that should have been included in the C++ language but were not. We have created them to extend the C++ language. The structures are lines of data types that are put together to form a greater complex data type.

Global Functions

CtoIRICint CtoIRIC(character)

char character; // Single character bit to convert to an integer number

The CtoIRIC function will convert a single numeric character bit to an integer value

ConCentRICs for Windows RIC Corp Class Libraries General Functions · 5

Page 19: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

Parameterscharacter is the single bit char value that you want converted to an integer.

Return ValueThe return value is the integer value that represents the character field. If the parameter is not a valid number this function will return a value of -1.

CommentsThe CtoIRIC function stands for Char to Int RIC Corp function. It will convert a number in char format to an integer, so it could be used for math functions. A char of 5 will be converted to an integer of 5. Any non-numeric values will be ignored. This function is used primarily for internal loop processing. You would normally use the CharToIntRIC function to convert a string of characters to a single integer value.

Examplechar character = '5';

int i = CtoIRIC(character); // i will equal 5 in this example

See AlsoCharToFloatRIC, CharToIntRIC

CancelCheckBOOL CancelCheck();

The CancelCheck function will look for any outstanding messages for the application, and will allow them to process. Any process that allows the user to cancel the process, needs to call this function, so that the cancel action can take place.

CharToFloatRIClong double CharToFloatRIC(characters)

CString characters; // Character string to convert to a decimal number

The CharToFloatRIC function will convert a numeric character string to a single decimal value

Parameterscharacters is the string of characters that you want converted to a decimal. This function will accept both a CString and char[99] variable as the parameter.

Return ValueThe return value is the decimal value that represents the character string. A long double variable is the largest float type available. This value can be used in the CRicNum class. If none of the characters in the string are a valid number, then this function will return a value of zero.

6 · General Functions ConCentRICs for Windows RIC Corp Class Libraries

Page 20: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CommentsThe CharToFloatRIC function stands for Char to Float RIC Corp function. It will convert a number in char format to a decimal value, so it could be used for math functions. A character string of $1,234.56 will be converted to a decimal of 1234.56. Any non-numeric values will be ignored, except the first decimal point, if there is a second decimal point it will be ignored.

ExampleCString characters = "$1,234.56";

long double d = CharToFloatRIC(characters); // d will equal 1234.56 in this // example

See AlsoCtoIRIC, CharToIntRIC

CharToIntRICint CharToIntRIC(characters)

CString characters; // Character string to convert to an integer number

The CharToIntRIC function will convert a numeric character string to a single integer value

Parameterscharacters is the string of characters that you want converted to an integer. This function will accept both a CString and char[99] variable as the parameter.

Return ValueThe return value is the integer value that represents the character string. If none of the characters in the string are a valid number, then this function will return a value of zero.

CommentsThe CharToIntRIC function stands for Char to Int RIC Corp function. It will convert a number in char format to a single integer value, so it could be used for math functions. A character string of 1,234 will be converted to an integer of 1234. Any non-numeric values will be ignored.

ExampleCString characters = "1,234";

int i = CharToIntRIC(characters); // i will equal 1234 in this example

See AlsoCtoIRIC, CharToFloatRIC

ExternalInterfaceRICvoid ExternalInterfaceRIC(systemcode)

ConCentRICs for Windows RIC Corp Class Libraries General Functions · 7

Page 21: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CString systemcode; // The suffix to use for the control file

This function will start the External Connections feature. If you want to add an External Connection feature to your application, then call this function and set the system code to your application code such as SYST plus one other letter, except the letter L. The plain application code is used by the Print to File routine, and SYSTL is used for name and address mailing labels. For example the contract function in Scheduling Administration is using SCHDC. This allows each place in the system to have it's own set of external connections. You can not use more then file letters, since the system will add EXT to the front of the name. You should not use less than five letters, since it could conflict with a future application code.

FILERRBOOL FILERR(status, text=””, maximum=0, cancel=FALSE)

int status; // The returned value of a Btrieve operation

CString text; // Any text you would like displayed with an error

int maximum; // The minimum value of a non-error condition

BOOL cancel; // The cancel condition

The FILERR function will check the status of a Btrieve operation. If the status value is higher than the minimum value, a message box will be displayed. The message box will show the error number, error message and your text string. The Message box will contain a cancel button if the cancel variable is set to TRUE.

Parametersstatus is the value returned from a Btrieve file I/O function.

text is an optional parameter. If it is present it will show your text along with the error message. If the cancel parameter is FALSE, the default, then the text will display in the title. If the cancel parameter is set to TRUE, then the text parameter appears in the dialog box on a separate line under the error message.

minimum is an optional parameter. It will only give an error condition on error numbers greater than this value. The default is zero if not used. This will force any non-zero status to display the message box and the error condition.

cancel is an optional parameter. It defaults to FALSE. If it is set to FALSE the message box will only have an OK button. If it is set to TRUE there will be an Ok and a Cancel button. This should only be set to TRUE if you know already there is an error, since it changes the concept of the returned value.

Return ValueThe return value will be different depending on the setting of the cancel parameter. If the cancel parameter is FALSE, then the return value will be TRUE if the message box was displayed, meaning that there was an I/O error. The return value will be FALSE if status was less than or equal to the maximum value and no message box was displayed. If the cancel parameter is TRUE, then TRUE will be returned unless the Cancel button is pressed.

CommentsThe FILERR function stands for File Error function. You should perform this function after every Btrieve I/O function. It could be made part of the Btrieve I/O function as shown in the example. The only required parameter is the status. You

8 · General Functions ConCentRICs for Windows RIC Corp Class Libraries

Page 22: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

would use the text parameter if you wanted additional information displayed due to an error at that point. The maximum value would normally be zero the default, so that any non-zero status would generate an error. If you did want to trap for a particular error, check for that error condition prior to calling this function.

ExamplecUSERFILE userfile;

if ( FILERR (userfile.Open());

{

// add code to do what every you need to do if the file cannot be opened

}

FormatStrRICCString FormatStrRIC(data);

CString data; // String with formated text

The FormatStrRIC function will examine a string of characters for control sequences and will convert the control sequences into their proper control sequencing. The chart belows shows the control sequences that are supported.

Text Represents

\a Bell (alert)

\b Backspace

\f Formfeed

\n New line

\r Carriage return

\t Horizontal tab

\v Vertical tab

\' Single quotation mark

\" Double quotation mark

\\ Backslash

\? Literal question mark (?)

\000 ASCII character in decimal notation such as \027 for escape

GetFileNameRICCString GetFileNameRIC(title, lastfn, defext=0, verify=0, exts=0);

CString title; // Title to show on Browse dialog box

CString lastfn; // Last filename selected for default directory

int defext; // Default Extension set

int verify; // Existing file action

int exts; // Extension set to have available to users

ConCentRICs for Windows RIC Corp Class Libraries General Functions · 9

Page 23: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

This function will bring up the standards file search dialog box and will return the full path of a file selected by the user. The parameters that are passed indicate how to set the selection dialog box before showing it to the users.

The title parameter will be the description that appears at the top of the dialog box.

Lastfn is the full path of the last filename the user selected. This could be just a directory name. The system will find the pathname in this field and will start the directory list at this point. It will also show the contents of this directory to the user. If the field contained a filename, then that name will appear in the selected file box.

The defext parameter indicates the number of the extension to have selected in the valid extension list at the bottom of the dialog box. It must be a number within the specified Exts parameter. See the Exts chart for a complete list of extension numbers.

The verify parameter indicates the action to take if the selected file already exists. If you enter a zero (0) for this field, nothing will happen. If you enter a one (1) then the file selected must already exist. If you enter a two (2) for this parameter this indicates that the file is being opened for write. If the file does not exist nothing will happen. If the file does exist it will ask the user if they want the file name to be over written.

The exts parameter indicates which extensions will be available to the user for selection. The chart below shows which extensions will be included in each set. Set 1 will also contain set 0 and Set 2 will contain all extensions in 0 and 1. Set 3 will only contain the files shown. The defext column is the value to use for the defext parameter which indicates which extension will be selected when the dialog box first appears.

Exts Defext Extension Application

0 0 ric RIC Corp Viewer

1 htm Web Browser

2 txt Note Pad

3 dat Data file ASCII output

4 doc Word Processing Document

5 wpd Word Pad

6 * All Files

1 7 wav Sound file

8 avi Video file

9 gif GIF Image format

10 jpeg JPEG Image format

11 bmp Bit Map Image

2 12 sys ConCentRICs data file

13 upd ConCentRICs update file

14 bak Backup file

3 0 gif GIF Image format

1 jpeg JPEG Image format

2 bmp Bit Map Image

10 · General Functions ConCentRICs for Windows RIC Corp Class Libraries

Page 24: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

KeyBlockRICCString KeyBlockRIC(key, before, after);

CString key; // Key fields required to find the data record

int before; // Number of records before this one

int after; // Number of records after this one

This function will allow you to easily create a data block. A data block is multiple detail lines tied together as if they were one group. The system will prevent pages from being broken on a block, and when the user selects any part of a block, the entire block is selected. The key parameter is a text string of the key which contains each field in the key to the data file. Each key field is separated by a TAB (\t) key. Each detail line in a block should have the same key value. You then pass the number of records before and after this one, and you will be returned to the string to use in the DocLineRIC function. The chart below illustrates the values used in a four record block.

Record Number Before Value After Value

1 0 3

2 1 2

3 2 1

4 3 0

LSRICCString LSRIC(stringtableid)

UINT stringtableid; // The name of the text in the project's string table

The LSRIC function will load text from the string table in your project's resource file and make it available to the application.

Parametersstringtableid is the name of the text in the string table. When you enter your text in the string table you assign a name to that text such as IDS_AP_USERNAME. You will use this name to extract the text from the table.

Return ValueThe return value is the specific text from the string table.

CommentsThe LSRIC function stands for Load String RIC Corp function. Since all text presented to the user needs to be entered in the string table, you will be pulling text from the string table all the time. There are other ways to get text from the string table such as the CString function of LoadString, but this function is much easier to use, and can be input to any function that accepts a CString input.

ConCentRICs for Windows RIC Corp Class Libraries General Functions · 11

Page 25: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

ExampleYou have an entry in the string table named IDS_AP_USERNAME which represents the text User Name. The value of cs in the example below will be User Name.

CString cs = LSRIC(IDS_AP_USERNAME);

ParseStrRICCString ParseStrRIC(index, characters, parsechar=’\t’)

Int index; // The parameter to be taken out of the string

CString characters; // Character string to be parsed

char parsechar; // The character that divides the parameters

The ParseStrRIC function will allow you to extract one parameter from a string of parameters.

Parametersindex is the parameter number you wish to extract. If the string has three parameters and you want the middle parameter you would use an index of 2.

characters is a single character string that contains more than one field, where each field is separated by the same character.

parsechar is an optional parameter. It will default to the TAB (\t) character. This is the character used to separate data fields and keys in the Doc class. If the fields in your string are separated by something other than a tab, then enter it for this parameter.

Return ValueThe return value is parameter field referenced by the index.

CommentsThe ParseStrRIC function stands for Parse String RIC Corp function. Data fields and particular record keys stored in your Document (Doc) class are stored as single character strings. Each data field or key field is separated by a TAB (\t) key. When ever you need a single field from this string you would use this function to easily obtain the value. This is particularly helpful when you are trying to find the record of a multiple key entry.

ExampleCString letter;

CString characters = "A,B,C";

letter = ParseStrRIC(3, characters, ','); // letter will equal C

letter = ParseStrRIC(2, characters, ','); // letter will equal B

letter = ParseStrRIC(1, characters, ','); // letter will equal A

PlaySoundRICvoid PlaySoundRIC(soundfile, wavfile=TRUE);

12 · General Functions ConCentRICs for Windows RIC Corp Class Libraries

Page 26: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CString soundfile; // .wav file name or ini section

BOOL wavfile; // Indicates file is .wav file

The PlaySoundRIC function will play a sound on the system speakers. It can play any standard .wav file or it can play any sound in the work stations sound section of the control panel.

In order to play a .wav file you would enter the name of the .wav file along with the full pathname if appropriate, set the wavfile to TRUE which is the default. If the .wav file does not exist an error message indicating that would be displayed instead of a sound being played. Example:

PlaySoundRIC("C:\\WINDOWS\\RINGIN.WAV");

In order to play a sound from the work stations control panel. All of the sounds are listed in the WIN.INI file located in the WINDOWS directory. All of the available sounds are listed in the [sounds] section. You can pass the name of a section as the soundfile variable and set the wavfile to FALSE. Example:

PlaySoundRIC("RicCorpMail", FALSE);

SetDocRICvoid SetDocRIC(doc, maint);

CRicDoc* doc; // RIC Corp Document class

MaintBlockRIC* maint; // Maintenance Block Struct

Takes a string list from the MaintBlockRIC structure along with other maintenance criteria and merges the string list with the document’s data, key and nadr sections. The MaintBlockRIC structure appears as follows:

Global Structures

BtrvDateRICThis is the structure of a date stored in Btrieve format. You will use this structure to load or extract dates from a Btrieve file. The structure has the following layout:

struct BtrvDateRIC

{

BYTE day;

BYTE month;

WORD year;

};

BtrvTimeRICThis is the structure of a time stored in Btrieve format. You will use this structure to load or extract times from a Btrieve file. The structure has the following layout:

struct BtrvTimeRIC

{

ConCentRICs for Windows RIC Corp Class Libraries General Functions · 13

Page 27: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

BYTE hsec;

BYTE second;

BYTE minute;

BYTE hour;

};

LogFileRICThis is the structure of a system log entry. The system uses this structure to monitor user option selection. The structure has the following layout.

struct LogFileRIC

{

BtrvDateRIC date;

BtrvTimeRIC time;

int system;

long user;

int orgnum;

int station;

char description[60];

};

MaintBlockRICThis structure is used to pass a number of fields to a library maintenance function. All of the items in this structure could be passed as parameters to these functions, put that would be a lot of parameters. In the functions that require a MaintBlockRIC struture you are to define it, and then fill in the member items that are appropriate to the function, and then pass it as a pointer to the function.

struct MaintBlockRIC

{

int type;

int newtype;

int recnum;

int control;

int mode;

BOOL delmode;

CString dir;

CString data;

CStringList disp;

};

14 · General Functions ConCentRICs for Windows RIC Corp Class Libraries

Page 28: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

Non-Maintenance DefaultsThe default settings for this structure for a non-maintenance function, such an an inquiry, should be as follow:

type = -1;

newtype = -1

recnum = -1;

control = -1 or if name and address search, set to default search NA Category

mode = 1;

delmode = FALSE

dir = name.NameParams();

data = "";

disp = "";

Maintenance DefaultsThe default settings for this structure for a maintenance function, such as in a dialog function, should be as follow:

type = -1=N/A, 0=Add, 1=Change, 2=Delete, 3=Undo

newtype = type after maint for undo operation

recnum = Record number or -1 to add to bottom or -2 add to sort pos

control = -1 unless Names and Address then it is the Category Number

mode = 1;

delmode = TRUE can delete or FALSE can not delete

dir = name.NameParams();

data = Undo Data

disp = String List to add to document or formatted output of maintenance

Global VariableThis is not really a structure since it is a single data type. There is only one Global Variable defined in the RIC Corp Libraries:

CStringList transfer;

What is unique about this variable is that is active during the entire running of your application. This will allow you to transfer data from one document to another document, or between the document and view, or any program in your project with any other program in your project. You can use it for any purpose you need for it. If you use it, make sure you clear it first with the following command:

transfer.RemoveAll();

It is highly recommended that you clear it before you use it, since it will also contain the last information placed in it until it is cleared.

ConCentRICs for Windows RIC Corp Class Libraries General Functions · 15

Page 29: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

Document Class

class CRicDoc

IntroductionThe CRicDoc class is a base class used to handle the storage of the application's data. This class will be used in your Document program such as SYSTDOC.CPP. The functions in this class allow you to store, and maintain the data in your application's database files.

The functions in this class allow you to create an area to store the data for an application option. You will be able to specify any formatting requirements for the output of the data. You tie the data items with keys to the file. This will allow the system to automatically reference the data selected by the user. This class will support the maintenance of any of the data items.

The data in this class is accessed by the View program, where the data is outputted to any device, such as a terminal or printer. The View class will also control the manipulation of the data by the user, such as scrolling, and maintenance selection.

The CRicDoc class uses the following structure to communicate between the application and the library.

struct DocDataRIC

{

CStringList Title; // Document Column Titles

CStringList Index; // Document Index Table

CStringList Detail; // Document Data Table

CStringList Tab; // Document Tab Structure

CStringList Nadr; // Name and Address Table

CString Path; // Pathname for file

CPoint BoxSize; // Border size, Inside size

CString String; // Used by App for String Variable

CString String2; // Used by App for String Variable

CString SubTitle; // Holds a second title for the document

ConCentRICs for Windows RIC Corp Class Libraries Document Class · 17

Page 30: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CString UndoData; // Undo Data String

CString ChartTitle; // Title of a Chart

CStringList ChartOptions; // Options available to Chart

CStringList ChartData; // Data to be charted

};

Construction - Public MembersAddIconRIC Adds an icon to the document

AddTitleRIC Adds a Title line to the document

DelDocRIC Deletes all data in the document

DelLineRIC Deletes a specific detail line from the document

DocLineRIC Add a Detail line to the document

IconsPerLineRIC Sets the number of icons allowed per line

InitDocRIC Initializes a new document

SetBoxRIC Places lines between the columns

SetBoxSizeRIC Sets the line size for lines between columns

SetClipColRIC Sets the last column to use for line headings

SetColRIC Sets the starting position, length and alignment for report columns

SetEnvelopeRIC Sets if name and address functions are valid

SetFileNumRIC Will set the value of the Unique Option number

SetMaintLevelsRIC Sets security level required for add, change and delete operations

SetModuleIdRIC Associates an object id with the document

SetPasteRIC Sets if the Clipboard Paste function is supported

SetPathRIC Sets the pathname directory to use for the file

SetSubTitleRIC Sets a second title for the document

Extraction - Public MembersClipColRIC Returns the last column in a line heading

ColColorRIC Returns the color to use for a column

ColNxtRIC Returns the column numbers before and after the screen position passed to it

ColTabRIC Returns the column's starting position, length and alignment

DetailFirstRIC Returns the position of the first Detail line

DetailLineRIC Returns a specific Detail line by position

DetailNextRIC Returns the position of the next Detail line

DetailNumRIC Returns the number of Detail lines

DetailPosRIC Returns the position of a specific Detail line

18 · Document Class ConCentRICs for Windows RIC Corp Class Libraries

Page 31: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

EnvelopeRIC Indicates if name and address functions are operational

FileNumRIC Returns the file number of the document

GetFloatTitleRIC Returns the floating title for the given line

IconsRIC Returns the number of icons per line

IndexLineRIC Returns a specific Index entry by position

IndexPosRIC Returns the position of a specific Index entry

MaintLevelsRIC Returns the minimum security level required for the add, change and delete maintenance

MaxColRIC Returns the width of the document in characters

ModuleIdRIC Returns the id of the current object

NadrFirstRIC Returns the position of the first name and address line

NadrLineRIC Returns a specific name and address line by position

NadrPosRIC Returns the position of a specific name and address line

NadrNextRIC Returns the position of the next name and address line

OutputHtmFile Outputs document in HTML format (.htm)

OutputHtmJust Justifies colomn fields for HTML formats

OutputHtmTitle Creates the title for HTML formats

OutputRicFile Outputs document as an RIC Viewer file (.ric)

PasteStateRIC Indicates if clipboard pasting is supported

PathRIC Returns the directory path

SearchDocRIC Returns the record number for a find operation

SelRangeRIC Returns number of records before and after the specified record that forms the block

SubTitleRIC Returns the Sub-title field

TabNumRIC Returns the number of columns

TitleFirstRIC Returns position of first Title line

TitleLineRIC Returns a specific Title line by position

TitleNextRIC Returns position of the next Title line

TitleNumRIC Returns the number of Title lines

TitlePosRIC Returns the position of a specific Title line

UndoStateRIC Indicates if an Undo operation is valid

Implementation - Public MembersNoCommandRIC Use this function if the object is invalid

OpenErrorRIC Use this function if the file can not be opened

ConCentRICs for Windows RIC Corp Class Libraries Document Class · 19

Page 32: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

Data Members - Public MembersChartData Data to be charted

ChartOptions Options to be charted

ChartTitle Used to active Chart Feature

m_Control Used by an application for multiple occurrences

m_FloatTitle Indicates that float titles are set on

m_Int Used by an application to hold an integer value

m_Long Used by an application to hold a long value

m_Long2 Used by an application to hold a long value

m_Mode Used by an application for report mode

m_NoHeadings Indicates a special form, no page headings

m_Xfixsize Fix width of a document

m_Yfixsize Fix length of a document

String Used by an application to hold a string value

String2 Used by an application to hold a string value

SubTitle Contains an extra title line for the document

UndoData Undo data buffer

m_UndoRecnum Record number of the Undo data buffer

m_UndoType Undo Maintenance activity type

Application ConnectionThe CRicDoc class is defined to your project when you initially started your project. It has variable names assigned to it. Since it is a class you will need to use the variable name with a dot (.) or an arrow (->) then the name of the function.

The CRicDoc class is available to your XXXXDOC.CPP and your XXXXVIEW.CPP program. The variable name for this class in your XXXXDOC.CPP program is doc. The variable name for this class in your XXXXVIEW.CPP program is vw.m_Doc.

Document Class Functions

CRicDoc::AddIconRICvoid AddIconRIC(object, icon, desc, statusbar)

CString object; // Reference name to use for the document option

UINT icon; // Resource Id of the icon for this option

UINT desc; // Resource Id of the option's description

UNIT statusbar; // Resource Id of the description to use on status bar

20 · Document Class ConCentRICs for Windows RIC Corp Class Libraries

Page 33: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

The AddIconRIC function will be used primarily for the applications Main Menu. It will add an icon resource to the document. The user will be able to select the icon resource and notify the Document class to start that function.

Parametersobject is the internal name of the option. Since it is an internal name it should be a character literal.

icon is the resource id used in the application's resource file for the icon that you want to represent the option. The icon must exist.

desc is the resource id of a text string in the Applications String Table. This text string will be the label to place under the icon on the screen.

statusbar is the resource if of a text string in the Application's String Table. This text string will be the description of the option to place in the status bar. This text is created when the menu option for the item is added. You should not create a new text string for this item, but rather use the text string created when the menu option was created. It will have the same id as the object itself.

CommentsThere are two types of ConCentRICs documents, text documents and icon documents. You add titles and lines to text documents, you add icons to icon documents. This function will add the icons to your icon documents. You should not add titles or detail lines to an icon document, and you should not add icons to a text document.

ExampleAddIconRIC("USER", IDI_ICON2, IDS_AP_USER, ID_USER);

See AlsoAddTitleRIC, DocLineRIC, IconsPerLineRIC, IconsRIC

CRicDoc::AddTitleRICvoid AddTitleRIC(title)

CString title; // String of text to use for the column headings

The AddTitleRIC function will add a line of column headings to the document

Parameterstitle is a character string to be used as the column headings. You will need to enter TABS (\t) to separate the columns.

CommentsThe data and headings are keep separately in ConCentRICs documents. The View class will display the headings in the appropriate place. There is no limit to the number of column heading lines you wish to use. You must use the function once for each column heading line. If the column heading has more than one column you must include the data for an entire heading line, and separate each column with a TAB (\t) indicator. Column headings are not mandatory, but should be used if it will help the user understand the data presented in the document. Do not replace

ConCentRICs for Windows RIC Corp Class Libraries Document Class · 21

Page 34: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

report headings in the document. The View Class will handle these automatically. You only need to place the column headings if desired.

ExampleCString title = LSRIC(IDS_AP_USERNAME) + "\t" + LSRIC(IDS_AP_USERID);

AddTitleRIC(title);

See AlsoAddIconRIC, DocLineRIC, IconsPerLineRIC, IconsRIC, TitleFirstRIC, TitleLineRIC, TitleNextRIC, TItleNumRIC, TItlePosRIC

CRicDoc::ChartDataCStringList ChartData;

This variable needs to be filled with the data to be charted, if you wish to use the chart feature. The format is basically up to you. The only rules are that it must begin with some kind of key to identify the entry, followed by one or more numeric values in long format, that are to be charted. Each field needs to be separated by a tab character. The selection of the rows and columns to be charted is defined next.

CRicDoc::ChartOptionsCStringList ChartOptions;

This variable needs to be filled with the different chart options that can be done from the report, if you wish to use the chart feature. If the entire report were to be charted it would be a multi-dimensional chart. The charts can only produced two dimensional charts. This would mean just one column or one row of the report at one time, or maybe even selected rows for one column. This CStringList will identify each of the possible chart options from your report, and how to find the data in the ricdoc.ChartData CStringList. Each entry in the list is made up of several fields all separated by tab characters. Each of the required fields is listed below:

Description followed by lots of space for a combo-box, such as December 1999.

Record Keys - This indicates which data entries will be selected. List each key value in the order it will appear in the record. Start with column 1 and don't skip any. Separate each key with a comma (,). If a key can have any value then use a caret (~) for the key value. For example, you have four keys, It does not matter what the first key value is, the second key must be a 1999 for the year, the third key must be a 12 for the month, and the fourth key value can be anything since it does not involve this chart, which is the same as the first key. This parameter would appear as ~,1999,12

This is the column number that contains the value to be charted with this entry. You might have 18 values on one data record. In this case you want the 12th one, so the number to enter here is 16, since you have four keys in front of it.

This indicates how to find a description for the charted value. It will use this description as the label of the column, or slice of pie etc. You could enter 4 different parameters for this field, all separated by commas, but only the first parameter is required. The first parameter is the column number to use as the reference. In this case the description we want to use is in column 4, so we only

22 · Document Class ConCentRICs for Windows RIC Corp Class Libraries

Page 35: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

need to enter a 4,0,0,0 for this field. The label description could only be a key to a table. In that case you will need to use the other three parameters of this field, which are system, table, type. If you only have a key value in the record, the chart will do a code lookup. Set parameter 1 to the column number that contains the key value, then a comma, the system number that owns the table, a comma, the table number, another comma, and a zero. There are some special system, table, types you can use: 0,0,0 - Label column contains the value to use, 0,1,0 - Label column is a date in Display(3) format, display it as a date, and 0,1,1 - Label column is a valid year and the label column plus one is a valid month, and it will display as Month Year on the chart.

The entire ChartOption example appears as:

December 1999 \t~,1999,12\t16\t4,0,0,0

The ChartData record to support it would look like:

1\t1999\t12\tDec 99\t1\t2\t3\t4\t5\t6\t7\t8\t9\t10\t11\t12\t13\t14\t15\t16\t17\t18

CRicDoc::ChartTitleCString ChartTitle;

Set this variable to the title of your report. That will turn on the chart feature on the toolbar and on the View menu.

CRicDoc::ClipColRICint ClipColRIC();

The ClipColRIC function will return the last column number to use for a line heading. Any number of columns in the document can be used as line headings. Line headings will remain displayed at all times, and cannot be scrolled. The first columns on the left must be the line columns. There can be any number of columns and this function will return the last column to be used as the line column. If there are no line headings then this routine with return a value of zero (0).

CRicDoc::ColColorRICBOOL ColColorRIC(column, data, bcolor, fcolor)

int column; // Column number to retrieve color for

CString data; // Data string that contains color references

COLORREF* bcolor; // A pointer to the selected backgournd color

COLORREF* fcolor; // A pointer to the selected text color

The ColColorRIC function will retrieve the color for a particular document column.

Parameterscolumn is the column number you would like the color for, where the first column is column number one (1).

data is the string that contains the color references. Normally the color references for a document are placed with the key data, on the key or index record. You would pass the entire index record in this field.

ConCentRICs for Windows RIC Corp Class Libraries Document Class · 23

Page 36: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

bcolor is a pointer to the background color for the column. Colors are passed as three integer values that indicate the Red, Green and Blue levels of the color chosen.

fcolor is a pointer to the text or foreground color for the column. Colors are passed as three integer values that indicate the Red, Green, and Blue levels of the color choosen.

Return ValueThis function will return a value of TRUE, color was found or FALSE, no color was found. The actual colors of the columns will be contained in the bcolor and fcolor parameters.

CommentsThere is an option that will allow you set the color of each column for each line of the document separately. If the color is not set then the default color will be used. The colors are added to the index record after the key fields, and block information. You then pass the entire index record to this function and it will extract the color for the specified column.

Exampleint colnum = 3;

int recnum = 5;

COLORREF bcolor, fcolor;

CString data = IndexLineRIC(IndexPosRIC(recnum));

if (ColColorRIC(colnum, data, &bcolor, &fcolor))

SetTextColor(hdc, bcolor, fcolor);

This example will retrieve the color of the third column in the fifth record. If a color is found then the background and text colors will be set the appropriate colors.

See AlsoAddTitleRIC

CRicDoc::ColNxtRICvoid ColNxtRIC(column, previous , next, colnum, lock)

int column; // Column character position

int *previous; // Pointer to previous column number

int *next; // Pointer to next column number

int *colnum; // Pointer to the data column number

int lock; // Number of columns locked together

The ColNxtRIC function is provided with a column character position. The function will return the column number prior to the given position, and the column number next to the given position. Those number are the character column. The colnum variable will be set the the data column number. If multiple columns

24 · Document Class ConCentRICs for Windows RIC Corp Class Libraries

Page 37: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

should act as 1 column then the lock variable should be set to number of columns that should be treated as one column.

Example: If there are 3 data columns of 10 characters each. This routine is passed a column of 15. The previous will be set to 0, next will be set to 20, colnum is set to 2.

Parameterscolumn is the column character position of a given point.

previous is a pointer to a variable that will contain the nearest column number to the left of the given point. This value will be zero if there is no previous column

next is a pointer to a variable that will contain the nearest column number to the right of the given point. This value will be zero if there is no column after this point.

Return ValueThis function will return values in the previous and next variables. These will contain the previous and next column numbers to the given point.

CommentsThe detail lines of the document are usually divided into columns. The columns could be made up of various size of characters. Given any character point in the line, this function will return the column numbers to the left and right of this point. This function is very beneficial to scrolling, since it can align the scroll on the next or previous columns.

Exampleint previous, next;

int screencol = 40;

ColNxtRIC(screencol, &previous, next);

See AlsoSetColRIC

CRicDoc::ColTabRICvoid ColTabRIC(column, start , length, alignment)

int column; // Column number

int *start; // Pointer to the starting position

int *length; // Pointer to the length of the column

int *alignment; // Pointer to the column's alignment

The ColTabRIC function will return the starting position, length, and the alignment of a given column. These are the characteristics of the column.

Parameterscolumn is the column number that you want the characteristics for, where the first column would be column one (1).

ConCentRICs for Windows RIC Corp Class Libraries Document Class · 25

Page 38: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

Start is a pointer to a variable that will contain the starting character position of the column.

length is a pointer to a variable that will contain the total length of the column in character positions.

alignment is a pointer to a variable that will contain value of the text alignment of the column. The chart below shows the possible values for the alignment:

Value Alignment Use

0 Left (default) most text fields

1 Right numeric values

2 Centered titles

9 Vertical bar Charts and boxes

Return ValueThis function will return values in the start, length, and alignment variables to indicate the characteristics of the data column.

CommentsThe detail lines of the document are usually divided into columns. The columns could be made up of various size of characters, and can be aligned in different formats when displayed. This function will allow you to see the characteristics of any given column number.

Exampleint start, length, align;

int column = 2;

ColTabRIC(column, &start, &length, &align);

See AlsoSetColRIC

CRicDoc::DelDocRICvoid DelDocRIC();

This function will delete all the data in the document. You would use this function when you first start a document, or when you are closing a document.

CRicDoc::DelLineRICvoid DelLineRIC(recnum);

int recnum; // Detail line number to be deleted

This function will delete all the detail line and index for the given detail line number. This function is used in the delete maintenance operation.

26 · Document Class ConCentRICs for Windows RIC Corp Class Libraries

Page 39: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicDoc::DetailFirstRICPOSITION DetailFirstRIC();

This function will return the position of the first detail line in the document. When you access the data for a given line, you need to reference the line by position number.

CRicDoc::DetailLineRICCString DetailLineRIC(pos);

POSITION pos; // Position of the detail line to retrieve

This function will return the data in the detail line for the given position. You will use the CString returned in your application.

CRicDoc::DetailNextRICCString DetailNextRIC(pos);

POSITION* pos; // Position of the Detail line to retrieve

This function will return the data in the current detail line relative to the given position, and will increment the pos variable to the next record. This function is very useful if you are looping through all of the detail lines.

CRicDoc::DetailNumRICint DetailNumRIC();

This function will return the total number of detail lines.

CRicDoc::DetailPosRICPOSITION DetailPosRIC(recnum);

int recnum; // The detail line number you want to access

This function will return the position of a given detail line in the document. When you access the data for a given line, you need to reference the line by position number. This function will return the position number of any detail line. You can then use this value in the DetailLineRIC and DetailNextRIC functions.

CRicDoc::DocLineRICint DocLineRIC(recnum, key, data, nadr=””)

int recnum; // Detail line number

CString key; // String of characters to use as the file key

CString data; // String of characters to use as the detail line

CString nadr; // Name and Address information linked to detail line

The DocLineRIC function will be used to add detail lines to the document.

ConCentRICs for Windows RIC Corp Class Libraries Document Class · 27

Page 40: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

Parametersrecnum is used to determine how the data will be added to the document. If the recnum is minus 1 (-1) then the line is added to the bottom of the document. If the recnum is minus 2 (-2) then the line is inserted in a sorted position in the document. If the recnum is zero (0) or greater than the data is used to update the detail line.

key is the key information for the detail line. This could be made up of three sections. All the sections are optional. If you are not using ANY of the sections then set the key to NULL. Each section is separated by new line (\n) indicators. The first section are the key fields to the file for this record. Each field is separated by TAB (\t) indicators. The second section is used to block multiple detail lines together. It is made up of two integer values separated by commas. The first value indicates how many detail lines prior to this one, the second value indicates how many detail lines after this one. The last section contains specific color settings for the column. A color is made up of three integer values. The values represent the amount of Red Green and Blue color respectively. The Red, Green, and Blue values are separated by commas. The color for each column is separated by TAB (\t) indicators.

data is the actual data line itself. Each column of data needs to be separated by a TAB (\t) indicator.

Nadr is a name and address information string that can be linked to the detail line. You will need to use the command SetEnvelopeRIC(TRUE) to activiate this field in the document. This will also activiate all of the Name and Address print options and the auto-dialer feature. If you are using this feature and you have a line without name and address information pass a “~” for this field. To obtain the value for this field you will need to use the CRicNAME::NameDoc command.

CommentsThere are two types of ConCentRICs documents, text documents and icon documents. You add titles and detail lines to text documents, you add icons to icon documents. This function will add the detail lines to your text documents. You should not add titles or detail lines to an icon document, and you should not add icons to a text document. A detail line should contain a key to the file, and the detail line itself, alone with any control information required.

Examplechar data[200];

CString key;

CString color1 = (256,0,0);

CString color2 = (0,0,256);

key = file.GetKEY1 + "\t" + file.GetKEY2 + "\t\n0,3\n" + color1 + "\t" + color2;

sprintf (data, "%d\t%d", file.GetKEY1, file.GetKEY2);

DocLineRIC(-1, key, data);

In this example a detail line is added to the end of the existing detail lines. The record is made up of two numeric values called Key1 and KEY2. This is the first record of a three record block. The first column in this line will have Red text and the second column will have Blue text. This data line has two columns with the number KEY1 value will be displayed in the first column and the number KEY2 value will be displayed in the second column.

28 · Document Class ConCentRICs for Windows RIC Corp Class Libraries

Page 41: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

See AlsoAddIconRIC, AddTitleRIC, IconsPerLineRIC, IconsRIC

CRicDoc::EnvelopeRICBOOL EnvelopeRIC();

This function will return TRUE if name and address functions are active, or FALSE if they are not active. The document data must contain name and address information for an envelope to be produced. An Envelope indication will also allow the display to be placed on mailing labels, phone list, address book, autodialer, etc.

CRicDoc::FileNumRICint FileNumRIC();

Each of the options in an application will have it's own Document and View window. The application keeps track of what to do with each Document/View combination by a file number. This is an arbitrary number assigned by the programmer. It does not matter what the number is as long as it is unique within the application.

CRicDoc::GetFloatTitleCString GetFloatTitle(recnum);

int recnum; // A valid record number in the document

This function will return the float title associated with the record number passed in the recnum field. If there is no float title associated with that line or an invalid line number is passed then a NULL character is returned.

CRicDoc::IconsRICint IconsRIC();

This function will return the number of icons the programmer has indicated to display across a single line of a window. A new line will be started as soon as this number of icons has been displayed on a window line.

CRicDoc::IconsPerLineRICvoid IconsPerLineRIC(numberof);

int numberof; // The number of Icons per display line

This function allows the programmer to set the number of icons to place on a single line across a window line. A new line will be started as soon as the number of icons has been displayed. The programmer should set this number based on the total number of icons the application will have. Each option in the application should be represented by an icon. There should be a balance to create an even number of icons that are displayed. If the application has a total of 8 icons (options) then this number would be 4. That would create two lines of 4. If there were 21 options then this number would be 7. That would create three lines of 7.

ConCentRICs for Windows RIC Corp Class Libraries Document Class · 29

Page 42: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicDoc::IndexLineRICCString IndexLineRIC(pos);

POSITION pos; // Position of the Index line to retrieve

This function will return the data in the Index or key line for the given position. You will use the CString returned in your application for the file key, block, and/or column color control.

CRicDoc::IndexPosRICPOSITION IndexPosRIC(recnum);

int recnum; // The Index line number you want to access

This function will return the position of a given index or key line in the document. When you access the data for a given line, you need to reference the line by position number. This function will return the position number of any index line. You can then use this value in the IndexLineRIC function.

CRicDoc::InitDocRICvoid InitDocRIC(defsage=0);

int defsage; // Sage option to be run

This function will initialize all of the variables in the document to their default values. This function will be used when a document is first created. You set all of the variables to their default values, then in your Option's Initialize routine, you only need to change the ones that your option requires.

The defsage parameter is only used if the sage operation is to only run one option in this application. You would enter the document number for the application option to be run. If you leave this set to zero the default, then it will present the main menu in Sage Setup operations.

CRicDoc::m_Controlint m_Control;This data item may be used by an Application program to indicate anything the application wants. It is usually used to control multiple occurrences of the same document and to indicate which occurrence this document represents.

CRicDoc::m_FloatTitleBOOL m_FloatTitle;

This data item indicates the document has floating titles if this variable is TRUE and that it does not have floating titles if this value is FALSE. The default value for this variable is FALSE. There is not set command for this variable. You can set it directly.

CRicDoc::m_Intint m_Int;

30 · Document Class ConCentRICs for Windows RIC Corp Class Libraries

Page 43: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

This data item may be used by an Application program to indicate anything the application wants. It is usually used to hold a selection option made by the user that effects the display of the data.

CRicDoc::m_Longlong m_Long;

This data item may be used by an Application program to indicate anything the application wants. It is usually used to pass a control parameter to a display.

CRicDoc::m_Long2long m_Long2;This data item may be used by an Appliction program to indicate anything the application wants. It is usually used to hold a field variable to control a break point in the display.

CRicDoc::StringCString String;

This data item may be used by an Application program to indicate anything the application wants. It is usually used to pass a string of parameters to a display.

CRicDoc::String2CString String2;

This data item may be used by an Application program to indicate anything the application wants. It is usually used to hold a string variable for comparision within the display.

CRicDoc::m_Modeint m_Mode;

This data item may be used by an Application program to indicate anything the application wants. It is usually used to control the report mode. Based on a user selection, the report may display differently. This field can be used to indicate the user's selection, so update lines may be output in the same format.

CRicDoc::m_NoHeadingsBOOL m_NoHeadings;

This variable indicates that the document is actually a special form and that the standard headings are not to be included. The default setting for this variable is FALSE. That will produce the standard page headings when printed. If this variable is set to TRUE, then the standard headings are bypassed completely and only the document data will be printed.

ConCentRICs for Windows RIC Corp Class Libraries Document Class · 31

Page 44: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicDoc::m_Xfixsizeint m_Xfixsize;

This is an optional variable that will allow you to set a fix document. It is used in conjunction with the m_Yfixsize variable. Set this variable to a specific number of pixels, and the document width will lock in at that size. If you do not set this variable the width will be automatically calculated to the total width of all data columns. In the scale we use there are 100 pixels to an inch.

CRicDoc::m_Yfixsizeint m_Yfixsize;

This is an optional variable that will allow you to set a fix document. It is used in conjunction with the m_Xfixsize variable. Set this variable to a specific number of pixels, and the document length will lock in at that size. If you do not set this variable the length will be automatically calculated to the total length of all data lines. In the scale we use there are 100 pixels to an inch.

CRicDoc::UndoDataCString UndoData;

This data item contains an exact image of the data record BEFORE the last maintenance action.

CRicDoc::m_UndoRecnumint m_UndoRecnum;

This data item contains the detail line number that was last changed.

CRicDoc::m_UndoTypeint m_UndoType;

This data item contains the maintenance action that needs to performed with the m_UndoData to reverse the last maintenance activity. The chart below shows the possible values of this variable.

Value Last Maintenance Undo Maintenance

0 Delete Add

1 Change Change

2 Add Delete

32 · Document Class ConCentRICs for Windows RIC Corp Class Libraries

Page 45: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicDoc::MaintLevelsRICvoid MaintLevelsRIC(add, change delete);

int *add; // Security Level required to add

int *change; // Security Level required to change

int *delete; // Security Level required to delete

This function will return the minimum security level required to perform an add, change or delete maintenance activity. The chart below shows the possible values of the security flags.

Value Meaning Usage

0 No Access Can not use the maintenance at all

1 Read Only View only, no maintenance allowed

2 Normal The maintenance is a normal part of the job

3 Advanced Should be used by Facility Only - Use Normal

4 Privileged Should be used by Facility Only - Use Normal

5 Manager User has control over operating aspects

8 System System Administration

9 Development RIC Corp use only

CRicDoc::MaxColRICint MaxColRIC();

This function will return the maximum width of the document in character positions. If the document had two columns of 20 characters, this routine would return a value of forty (40).

CRicDoc::ModuleIdRICDWORD ModuleIdRIC();

This function will return the object's resource id of the document. This will be used primarily to determine the help id of the option.

CRicDoc::NadrFirstRICPOSITION NadrFirstRIC();

This function will return the position of the first name and address line in the document. When you access the data for a given line, you need to reference the line by position number.

ConCentRICs for Windows RIC Corp Class Libraries Document Class · 33

Page 46: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicDoc::NadrLineRICCString NadrLineRIC(pos);

POSITION pos; // Position of the name and address line to // retrieve

This function will return the data in the name and address line for the given position. You will use the CString returned in your application.

CRicDoc::NadrNextRICCString NadrNextRIC(pos);

POSITION* pos; // Position of the Nadr line to retrieve

This function will return the data in the current name and address line relative to the given position, and will then increment the pos variable to the next record. This function is very useful if you are looping through all of the name and address lines associated with the document.

CRicDoc::NadrPosRICPOSITION NadrPosRIC(recnum);

int recnum; // The name and address line number you want to access

This function will return the position of a given name and address line in the document. When you access the data for a given line, you need to reference the line by position number. This function will return the position number of any name and address line. You can then use this value in the NadrLineRIC and NadrNextRIC functions.

CRicDoc::NoCommandRICvoid NoCommandRIC(recnum, object);

int recnum; // Record number of option

CString object; // Name of the option's object

The user selects options of the application through an Icon Menu or from the Modules Menu on the menu bar. After the user selects an option with either method, the record number and object name of the option is passed to the document by the View class. The Document class will then open a new document for that option. It can identify the option to execute by the object's name. If the document does not recognize or cannot process the object name, then this function is called. It will display a message box stating that the object is unknown. It will display the name and the record number of the object. This box should never come up in production mode. Since the programmer creates the icon and module menus, it should recognize all of the objects created. This is used as a debugging tool, so you can add objects to the document, before you add the code to support the object.

CRicDoc::OpenErrorRICvoid OpenErrorRIC(title);

CString title; // Title of the Option's Window

34 · Document Class ConCentRICs for Windows RIC Corp Class Libraries

Page 47: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

All data files should be created if they don't exist. If the file cannot be created or it cannot be opened after it is created this function is called. This function will display a message box stating the option's name. It will inform the user that the data file could not be created and will abort the option.

CRicDoc::OutputHtmJustCString OutputHtmJust(len, align, field);int len; // Length of the column

int align; // Alignment mode

CString field; // The value of the field to be aligned

This function will take the field parameter passed to it and will properly align it for HTML output. You need to pass the width of the column in the len parameter and the type of alignment you want in the align parameter. The alignment values are the standard ones of: 0=Left 1=Right 2=Center.

CRicDoc::OutputHtmFilevoid OutputHtmFile(filename);CString filename; // The name of the file to be created

This function will output the current document in HTML format. The output will be placed in the filename parameter. This parameter must contain the full path and the name of the file.

CRicDoc::OutputHtmTitlevoid OutputHtmTitle(htmfile, title, top, tabswt);CFile* htmfile; // A pointer to the output file

CString title; // The title of the report

CString top; // The column headings

BOOL tabswt; // Indicates to put output in table format

This function will create proper output lines for the report title in an HTML output file. This file should not be called directly, since it’s primary purpose is to support the OutputHtmFile command.

CRicDoc::OutputRicFilevoid OutputRicFile(filename, title);CString filename; // The name of the file to be created

CString title; // The title to use for the report

This function will output the current document in RIC format. The output will be placed in the filename parameter. This parameter must contain the full path and the name of the file. The results of this output can be viewed with the RIC Viewer and on the Palm Pilots. You will pass the description you want to show for the report in the title parameter.

ConCentRICs for Windows RIC Corp Class Libraries Document Class · 35

Page 48: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicDoc::PasteStateRICBOOL PasteStateRIC();

This function will return TRUE if the document supports the paste feature from the clipboard. It will return FALSE if the paste feature is not supported. Since most of the ConCentRICs options use database files, we cannot accept data in any format, which the clipboard may contain. The majority of ConCentRICs applications do not support the paste feature. If your document deals strictly with text then pasting may be allowed.

CRicDoc::PathRICCString PathRIC();

When a document is first created it will use the directory pathname from the current user settings. When the document data is used, it cannot do the same thing. The user could have changed their settings to a different organization or calendar year. In order to allow the user to compare between organizations or years, we maintain the original directory path with the document. This function will return the directory path that was used to obtain the data.

CRicDoc::SearchDocRICint SearchDocRIC(direction, case, word, start, findstr)

BOOL direction; // Indicates to search up or down

BOOL case; // Indicates case-sensitive search

BOOL word; // Indicates to search on whole words

int start; // Record Number to start search from

char findstr[100]; // Character string to find in the document

The SearchDocRIC function will locate the next detail line in the document that contains a particular string of characters.

Parametersdirection indicates that the search will be in the down (top to bottom) or up (bottom to top) direction. A value of TRUE will search in the down direction, a value of FALSE will search in the up direction.

case indicates a case-sensitive find. This means that the upper and lower case letters must match exactly. A non case-sensitive find, would just look for the letters regardless of the case. A value of TRUE would be a case-sensitive find, and FALSE would indicate non case-sensitive.

word indicates a whole word search or a partial word search. A partial word search on the letters "ship" would find shipshape and friendship. If you wanted to find the word ship all by itself, then you would do a whole word search. A value of TRUE indicates whole word, and FALSE indicates partial word.

start indicates the first record that will be searched. The first search should be set to zero (0) for the first record in a down search, or the last detail line for an up search. If records are selected it should be the selected record. Subsequent searches should use the last position found plus or minus one for the starting record.

findstr indicates the character string to search for.

36 · Document Class ConCentRICs for Windows RIC Corp Class Libraries

Page 49: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

Return ValueThe return value will be the record number that contains the string, or a minus one (-1) if the string could not be found.

CommentsThe SearchDocRIC function will search the document for a given string. This is usually used in conjunction with the standards window Find dialog box. The user will indicate the search string and the search criteria. The View program will determine the starting point, and pass the other find parameters to this function. This function can be used independently to find a particular record in the document.

CRicDoc::SelRangeRICvoid SelRangeRIC(recnum, before, after);

int recnum; // Record number of inquiry

int *before; // Number of records before this one

int *after; // Number of records after this one

This function is used to retrieve block information. It is possible, but optional, that multiple detail lines be tied together to form a block. This function is controlled by the record number passed in the first parameter. This indicates the current record. The function will return the number of records in front of this one in the block in the before parameter. The number of records beyond this one will be in the after parameter. If there is no block with this record, both the before and after parameters will be zero (0) to indicate none before or after this one.

CRicDoc::SetBoxRICCString SetBoxRIC(data, type=1)

CString data; // Normal data line

int type; // Indicates the type of box (optional)

The SetBoxRIC function will take a standard text line and will return a text string will all of the valid box controls inserted.

Parametersdata is for the normal data line with none of the box commands. This will contain the data for each column in the detail line separated by the appropriate TAB (\t) indicators. Ignore the box columns themselves. If you have other columns defined before or after the box on the report, only pass the box data fields to this function. Add the columns before the box in front of the returned string, and add the columns after the box behind the returned string.

type indicates the type of box required for this detail line. The chart below indicates the possible values for this parameter.

Value Type of Box

ConCentRICs for Windows RIC Corp Class Libraries Document Class · 37

Page 50: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

0 Top of Box

1 Middle or Detail Line (default)

2 Bottom of Box

Return ValueThe return value will be the detail line string with the box commands inserted in the appropriate places.

CommentsThe SetBoxRIC function will allow you to easily insert box commands into a detail line. In order to box information to the user in the window, special control characters need to be added to the detail line. You could add the control characters directly. It is easier to create the normal detail line, pass it to this function, and this function will add all the appropriate box commands. You need to define the columns that will contain vertical bars with an alignment type of 9. You must also set the Box size with the SetBoxSizeRIC function.

CRicDoc::SetBoxSizeRICvoid SetBoxSizeRIC(border, inside);

int border; // Box border size in pixels

int inside; // Box inside line size in pixels

This function will set the size of the box to use with the document. You have two possible sizes, but they could both be the same. The border size will be the outside lines of the box. These lines surround the object. They form the box itself. The inside size will be used to determine the size of the line between the rows and columns. The sizes are in pixels. They can not exceed the number of pixels required to make up a single character in the currently selected font. If the size is greater then the size of a character, then the size will be truncated to the size of a single character. A lowest value of 1 will give you a very thin line. A value of 6 is a big thick line. The larger the size the longer it will take to print it.

CRicDoc::SetClipColRICvoid SetClipColRIC(column);

int column; // Last column number for line headings

This function allows you to specify line headings. Usually only column headings are used, but you may have a need for column headings. Line headings are any number of columns that will be frozen and will remain on the screen. They will be displayed in the current heading color. Any number of columns can be used for line headings, but they must be the left most columns. There are no line headings by

38 · Document Class ConCentRICs for Windows RIC Corp Class Libraries

Page 51: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

default. This function activates line headings. If you want to clip the first column which ends at 12 then enter 12 for the column number.

CRicDoc::SetColRICvoid SetColRIC(start , length, alignment=0)

int start; // Starting position of the column

int length; // Length of the column

int alignment; // Column's alignment

The SetColRIC function will allow you to set the column's starting position, length, and the column's alignment.

ParametersStart is a variable that will contain the starting character position of the column.

length is a variable that will contain the total length of the column in character positions.

alignment is a variable that will contain value of the text alignment of the column. The chart below shows the possible values for the alignment:

Value Alignment Use

0 Left (default) most text fields

1 Right numeric values

2 Centered titles

9 Vertical bar Charts and boxes

CommentsThe detail lines of the document are usually divided into columns. The columns could be made up of various size of characters, and can be aligned in different formats when displayed. This function will allow you to set the characteristics of any given column number. You can enter the columns in any order, and columns can overlap one another. The order of the columns indicates the order of the TAB (\t) indicators you need to add to the detail lines. The twelfth (12th) column would need eleven (11) TAB (\t) indicators prior to the data.

See AlsoColTabRIC

CRicDoc::SetEnvelopeRICvoid SetEnvelopeRIC(value);

BOOL value; // Value of the envelope status

This function will set the envelope status. A value of TRUE indicates an envelope can be produced, or FALSE if it cannot be produced. The document data must contain name and address information for an envelope to be produced. An

ConCentRICs for Windows RIC Corp Class Libraries Document Class · 39

Page 52: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

Envelope indication will also allow the display to be placed on mailing labels. The default is FALSE.

CRicDoc::SetFileNumRICvoid SetFileNumRIC(num);

int num; // New number for option number

Each option executed by the program is assigned a unique number in order to indentify it within the application. This number is assigned automatically with the library functions. This function should only be used to override the automatic assignment. This may be needed for SAGE processing.

CRicDoc::SetMaintLevelsRICvoid SetMaintLevelsRIC(add, change delete);

int add; // Security Level required to add

int change; // Security Level required to change

int delete; // Security Level required to delete

This function will set the minimum security level required to perform an add, change or delete maintenance activity. The default for all the values is 2 unless you use this function to change them. The chart below shows the possible values of the security flags.

Value Meaning Usage

0 No Access Can not use the maintenance at all

1 Read Only View only, no maintenance allowed

2 Normal The maintenance is a normal part of the job

3 Advanced Should be used by Facility Only - Use Normal

4 Privileged Should be used by Facility Only - Use Normal

5 Manager User has control over operating aspects

8 System System Administration

9 Development RIC Corp use only

CRicDoc::SetModuleIdRICvoid SetModuleIdRIC(object);

UINT object; // Object's Resource Id

This function will set the object's resource id of the document. You must set the module id in the initialization section of your document. This resource id is the same id that was used to define the options module menu item, such as ID_USER. This id will be used to determine the pointer to the help section.

40 · Document Class ConCentRICs for Windows RIC Corp Class Libraries

Page 53: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicDoc::SetPasteRICvoid SetPasteRIC(value);

BOOL value; // Value of the Paste State

This function will determine whether the document supports the paste feature from the clipboard. Set the value to FALSE if the paste feature is not supported. Since most of the ConCentRICs options use database files, we cannot accept data in any format, which the clipboard may contain. The majority of ConCentRICs applications do not support the paste feature. If your document deals strictly with text then pasting may be allowed. Set the value to TRUE if you support the paste feature.

CRicDoc::SetPathRICvoid SetPathRIC(path);

CString path; // File's pathname directory

This function will set the pathname directory for the option's datafile. This should be done in the options initialization function. When you initialize the document the path should be set with the current user settings for organization, calendar year, etc. These settings cannot be used when the document data is used, since the user may change some of these settings. We need to maintain the original directory to allow the user to compare between organizations and years.

CRicDoc::SetSubTitleRICvoid SetSubTitleRIC(title);

CString title; // Second title line for the document

This function will set a second title line for the report. Most reports will only have one title line, but some reports may need an additional one. The title parameter will contain whatever string you want to show as the second title line. This will appear directly below the regular report title, on a line by itself and will appear above the column headings.

CRicDoc::SubTitleRICCString SubTitleRIC();

This function will return the value of the second title line. It will return NULL if there is no second title line set.

CRicDoc::TabNumRICint TabNumRIC();

This function will return the total number of columns per detail line.

CRicDoc::TitleFirstRICPOSITION TitleFirstRIC();

ConCentRICs for Windows RIC Corp Class Libraries Document Class · 41

Page 54: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

This function will return the position of the first Title line in the document. When you access the data for a given line, you need to reference the line by position number.

CRicDoc::TitleLineRICCString TitleLineRIC(pos);

POSITION pos; // Position of the Title line to retrieve

This function will return the data in the Title line for the given position. You will use the CString returned in your application.

CRicDoc::TitleNextRICCString TitleNextRIC(pos);

POSITION* pos; // Position of the Title line to retrieve

This function will return the data in the current Title line relative to the given position, and it will increment the pos variable to the next record. This function is very useful if you are looping through all of the Title lines.

CRicDoc::TitleNumRICint TitleNumRIC();

This function will return the total number of Title lines.

CRicDoc::TitlePosRICPOSITION TitlePosRIC(recnum);

int recnum; // The Title line number you want to access

This function will return the position of a given Title line in the document. When you access the data for a given line, you need to reference the line by position number. This function will return the position number of any Title line. You can then use this value in the TitleLineRIC and TitleNextRIC functions.

CRicDoc::UndoStateRICBOOL UndoStateRIC();

This function will return TRUE if the undo command can be used otherwise it will return FALSE, do not use the undo command. This flag will be set automatically by the system after a successful maintenance operation has been performed.

42 · Document Class ConCentRICs for Windows RIC Corp Class Libraries

Page 55: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

Main Class

class CRicMain

IntroductionThe CRicMain class is a base class used to initialize the application for ConCentRICs and to set the security of the current user. This class will be declared in your App program such as SYST.CPP. The Document class and View class will reference the information in this class.

Implementation - Public MembersLoginRIC Logs user into the ConCentRICs system

LogoutRIC Logs user out of the ConCentRICs system

LogputRIC Writes a log entry into the system log

NadrPrintRIC Controls name and address print options

NadrWinRIC Controls name and address window options

NewMailStatusRIC Sets or retrieves the real New Mail flag on file

OnAboutRIC Controls the About dialog box

OnHelpComandRIC Processes users request for help

OnHelpRIC Executes help commands

OrgChgRIC Allows the user to change organizations

OrgStateRIC Indicates if user has access to multiple orgs

PasswordRIC Allows the user to change their password

SageExitRIC Ends SAGE processing with a Result Code

SageReadRIC Retrieves a SAGE parameter

SageWriteRIC Stores a SAGE parameter

SecurityRIC Logs user and work station into system and sets all the user security and variables

SetFileNumRIC Sets the current file number

TitlePgRIC Sets the title page option on and off

ConCentRICs for Windows RIC Corp Class Libraries Main Class · 43

Page 56: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

UserPrintRIC Controls the settings of the User's Print Options

Extraction - Public MembersDateHeadStateRIC Returns if current date will be in page heading

FileNumRIC Returns the current file number setting

HelpFileRIC Returns the full file name of the help file

JustifyStateRIC Returns the print justification setting

LoginsRIC Returns the number of user logins

MailStateRIC Returns if the user has access to E-Mail

NewMailStateRIC Returns if the New Mail flag is set

OrgDirRIC Returns the directory for the current organization

OrgNameRIC Returns the current organization name

OrgNumRIC Returns the current organization number

OSRIC Returns the work station's operating system

PageFormStateRIC Returns the page number format setting

PathDirRIC Returns the directory path for the pathname file

PathNameRIC Returns the directory of any pathname

RootDirRIC Returns the directory path of the system files

SecurityLevelRIC Returns the current users security level

StatNumRIC Returns the current work station number

SystemCodeRIC Returns the system code of the application

SystemNameRIC Returns the name of the overall system

SystemNumRIC Returns the system number of the application

TimeHeadStateRIC Returns if current time will be in page heading

TitlePgStateRIC Returns if the title page option is active or not

TruncateStateRIC Returns the print truncation setting

UserDeptRIC Returns the number of the user's Department

UserDepartmentRIC Returns the name of the user's Department

UserkeyRIC Returns the user's name and address key

UsernumRIC Returns the number of the current user

UserFnameRIC Returns the current users first name

UserLnameRIC Returns the current users last name

UserNameRIC Returns the first and last name of the current user

UserPrRIC Returns the full filename of the user's profile

UserStationRIC Returns the name of the Work Station

UserTitleRIC Returns the title of the current user

44 · Main Class ConCentRICs for Windows RIC Corp Class Libraries

Page 57: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

VersionRIC Returns the current version number of system

YearDirRIC Returns the directory path for a calendar year

Data Members - Public Membersm_Dial Indicates if work station can autodial

m_IconId Value of current options icon resource

m_lpfind Pointer to Find Dialog structure

m_Find Find Dialog structure

m_FindDlg Handle to Find Dialog box

m_FindWhat String to search for

m_FindWhatPtr Pointer to search string

m_HelpOffset Trigger passed to the common help routine

m_MapiSession Session number of MAPI Login

m_ModuleId Current Module Id

m_SageMode Current Status of Batch processing

m_SageReg Sage Registration Address

m_SageSet Number of current SAGE process

Application ConnectionThe CRicMain class is defined to your project when you initially started your project. They have a variable assigned to it. Since it is a class you will need to use the variable name with a dot (.) or an arrow (->) then the name of the function.

The CRicMain class is available to your XXXX.CPP, XXXXDOC.CPP and XXXXVIEW.CPP programs. You can add this class to any program in your project by adding the line: extern CRicMain user; after the "blue" lines at the top of the project. The variable name for this class in all programs will be user.

Main Class Functions

CRicMain::DateHeadStateRICBOOL DateHeadStateRIC();

This function will return TRUE if the current date should be shown in the page heading or FALSE, don't show current date in heading..

CRicMain::FileNumRICint FileNumRIC();

This function will return the File number currently set. The File number usually has a value of zero. It will only have a value other than zero when a new option has been selected, but not yet started.

ConCentRICs for Windows RIC Corp Class Libraries Main Class · 45

Page 58: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicMain::HelpFileRICCString HelpFileRIC(helpfile=1);

int helpfile; // Indicates the help file you want (Optional)

This function will return the full pathname for one of the two help files. If the helpfile number is zero (0) then the General Help filename will be returned. If the helpfile number is one (1), the default, then the application's help filename will be returned.

CRicMain::JustifyStateRICchar JustifyStateRIC();

This function will return a single character to indicate the user's selection for print justification. Print justification is used when ever the number of characters in the data to be printed is smaller than the number of characters in the paper width. The possible values are L for left, R for Right, or C for Center.

CRicMain::LoginRICvoid LoginRIC(type);

int type; // Type of Login

This function will execute the ConCentRICs login process. Type will indicate how that person uses the login process. 0 = Normal Login, 1 = Forced login as new user, 5 = Work Station information only, and 9 = Password change only.

CRicMain::LoginsRICint LoginsRIC();

This function will return the number of times the current user has logged into the ConCentRICs system, not necessarily just this application. If a user starts a new application within ConCentRICs without logging out of the previous ConCentRICs option the login information is not asked for, and is not included in the login count.

CRicMain::LogoutRICvoid LogoutRIC(level=1);

int level; // Level of Logout

This function will log the current user out of the ConCentRICs system. The next ConCentRICs application started will ask for login information. It will not stop any other ConCentRICs application currently running.

A Level 1 will logout the user, stop the Pervasive/Btrieve database and exit the application. A level of 0 will just stop the Pervasive/Btrieve database and exit the application, but it will not logout the user.

CRicMain::LogputRICvoid LogputRIC(logtext);

CString logtext; // Text entry for the system log

46 · Main Class ConCentRICs for Windows RIC Corp Class Libraries

Page 59: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

This function will make a single entry in the system log each time this function is called. The function will automatically make all necessary log entries, such as the date, time, user, system number, organization, and work station. The only parameter is the text you want entered into the system log. This function should be used whenever a new process is started, with the name of the process in the parameter field.

CRicMain::m_DialBOOL m_Dial;This data item will be TRUE if the work station can autodial or FALSE, if it cannot dial. This is set if the work station autodial port is set to COM1, COM2, COM3, or COM4.

CRicMain::m_IconIdUINT m_IconId;

This will be the resource id for the icon of the last selected option. This will only be true during the initializing of the option. After that time, it will contain the icon of the last selected icon, which should have no meaning.

CRicMain::m_lpfindFINDREPLACE FAR* m_lpfind;

This data item will contain a pointer to the application's find dialog structure, so the same find dialog parameters can be used through out the entire application. If you need the actual structure itself you can use the m_Find data member.

CRicMain::m_FindFINDREPLACE m_Find;

This data item will contain the application's find dialog structure, so the same find dialog parameters can be used through out the entire application. If you need a pointer to this structure you can use the m_lpfind data member.

CRicMain::m_FindDlgHWND m_FindDlg;

The Find Dialog box is the standard Windows Find modless dialog box. The Find dialog box will remain on the screen until the user selects cancel. The handle for the dialog box will be placed in this data item, so that it is available for all the find routines.

CRicMain::m_FindWhatchar m_FindWhat;

This data item will contain the search string to use from the Find dialog box. The string is placed in this data item, so the last search string will be available for the next Find dialog box in the same application. The search string is not shared

ConCentRICs for Windows RIC Corp Class Libraries Main Class · 47

Page 60: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

between applications. If you need a pointer to the search string you can use the m_FindWhatPtr data member.

CRicMain::m_FindWhatPtrLPSTR m_FindWhatPtr;

This data item will contain a pointer to the application's Find dialog search string. If you need the actual search string itself you can use the m_FindWhat data item.

CRicMain::m_HelpOffsetint m_HelpOffset;

This data item can be used by the application to store an integer at the main application level. It is being used by Table Parameters only to designate the table/code from Group Code selection dialog box help files This is one dialog box being used for two completely different purposes. When the alternate purpose is used (Group Codes) then this item is set as a flag to the common help routines. Your application may use this field for any purpose. Just remember that a group code will use is while it's dialog box is displayed, and then will reset it to zero.

CRicMain::m_MapiSessionunsigned long m_MapiSession;

This will contain the session number of the MAPI logon. If there is no MAPI session established, then this will have a value of 0L.

CRicMain::m_ModuleIdDWORD m_ModuleId;

Contains the document's internal module identifier for the currently open document. This will let you know which part of the application is active at this time.

CRicMain::m_SageModeint m_SageMode;

Will return the status of the current SAGE process. 0 = No SAGE processing, 1 = Run Mode, 2 = Setup Mode, and -1 is used for special ConCentRICs processing.

CRicMain::m_SageRegchar m_SageReg[256];

During SAGE processing this field is used to hold the full registration path, so it does not have to be looked up each time. This field is free for your use when not in SAGE mode. Remember if you use this field it can not be in a “SAGE Aware” application.

CRicMain::m_SageSetint m_SageSet;

48 · Main Class ConCentRICs for Windows RIC Corp Class Libraries

Page 61: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

This is the unique SAGE number passed by System Agent.

CRicMain::MailStateRICint MailStateRIC();

The MailStateRIC function will return a value that represents the ConCentRICs mail situation. The result will be 0 = No ConCentRICs Mail, 1 = Regular Mail, and 2 = MAPI mail.

CRicMain::NewMailStateRICBOOL NewMailStateRIC();

The NewMailStateRIC function will return TRUE if the user's new mail flag within the application is set. It will return FALSE if the New Mail flag is not set.

CRicMain::NewMailStatusRICint NewMailStatusRIC(status=-1);

int status; // The functions control parameter

The NewMailStatusRIC function will retrieve or set the New Mail flag from the user's record, and can set the application's flags depending on the setting of status parameter. The chart below shows the action of the status parameter

Status Action Set Flags Remarks

-2 retrieve No Just returns the current status

-1 (default) retrieve Yes returns the current status

0 set No Sets the New Mail flag off

1 set No Sets the New Mail flag On

The return value will also be different depending on the status parameter. If the parameter is less than zero then the status of the flag will be returned. It will return zero (0) if it is off, or a one (1) if it is on. If the parameter is zero (0) or one (1) then it will return the file i/o status of the update action.

CRicMain::NadrPrintRICvoid NadrPrintRIC();

This function will bring up the dialog box that lets the user specify the way they would like names and addresses to print.

CRicMain::NadrWinRICvoid NadrWinRIC();

This function will bring up the dialog box that lets the user specify the way they would like name and addresses to display and sort.

ConCentRICs for Windows RIC Corp Class Libraries Main Class · 49

Page 62: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicMain::OnAppAboutRICvoid OnAppAboutRIC();

This function will control the About dialog box, which is common to all ConCentRICs applications. Your base App class needs to use this function instead of the generated routine.

CRicMain::OnHelpCommandRICvoid OnHelpCommandRIC(helpid, command);

DWORD helpid; // The help's map number of the object selected

UINT command; // The help command requested

This function will process a help requested made by the user. It will check the helpid and alter it, if appropriate. It will then execute the appropriate help file and will display the section of help indicated by the selected object. If your application needs to override the calculated help map number then you should do so before you call this function.

CRicMain::OnHelpRICvoid OnHelpRIC(helpfile=1, command=HELP_CONTENTS, data=0L);

int helpfile; // The help file requested (optional)

UINT command; // The help command requested (optional)

DWORD data; // Any data required for the help command (optional)

This function will bring up the help facility. There are two help files available to your application, the General documentation and the Application's documentation. If the helpfile is set to zero (0) you will get the general help, the default setting of one (1) will bring up the application's help file. There are several help commands available that will start the help facility in different ways. The default command is HELP_CONTENTS, which will bring up the table of contents for the selected help file. The default value for data is zero (0). If the help command you are executing requires additional data, then it is placed in the data parameter. If you call this function with no parameters you will get the table of contents for the application's helpfile.

CRicMain::OrgChgRICvoid OrgChgRIC();

This function will allow the current user to switch to a different organization database. This function is not active if the user only has access to one organization. This function will not change the setting of any open windows. This will allow the user to compare data between different organizations.

CRicMain::OrgDirRICCString OrgDirRIC();

This function will return the directory pathname for the current organization.

50 · Main Class ConCentRICs for Windows RIC Corp Class Libraries

Page 63: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicMain::OrgNameRICCString OrgNameRIC();

This function will return the name of the current organization.

CRicMain::OrgNumRICint OrgNumRIC();

This function will return the organization number of the current organization.

CRicMain::OrgStateRICBOOL OrgStateRIC();

This function will return TRUE if the user has access to more than one organization, which will allow them to change to a different organization. If the user only has access to one organization then this function will return FALSE. This is set when the application is started. If a user is added to another organization while the user has the application running, it will not take effect until the application is ended and restarted.

CRicMain::OSRICCString OSRIC();

This function will return the name of the operating system in use at the current work station. You can use the chart below to match the results of this command with the Operating System and the corresponding string table entry.

Operating System String Table Entry

Windows 3.x IDS_AP_DOS_WINDOWS

Windows 95 IDS_AP_WIN95

Windows NT IDS_AP_WINDOWS_NT

CRicMain::PageFormStateRICint PageFormStateRIC();

This function will return the format the user would like for the page numbers in the page headings of printed reports. The value will be 0 for no page numbers, 1 for Page X format, or 2 for Page X of Y format.

CRicMain::PasswordRICvoid PasswordRIC();

This function will allow the current user to change their existing password. For security purposes the current password is asked for and verified before a new password can be set.

ConCentRICs for Windows RIC Corp Class Libraries Main Class · 51

Page 64: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicMain::PathDirRICCString PathDirRIC();

This function will return the directory pathname where the pathname file (PATHNAME.SYS) can be found. It is possible for each work station to use a different directory and pathname file.

CRicMain::PathNameRICCString PathNameRIC(type, number);

int type; // Pathname type

int number; // Specific Path reference

This function will return the directory of any pathname entry in the file. The chart belows shows some of the typical pathnames you would want to retrieve.

Pathname Object Type Number

System Files 1 1

User Profiles 1 2

Help Files (16-bit) 1 3

Electronic Mail 1 4

Executables (16-bit) 1 5

Executables (32-bit) 1 6

Help Files (32-bit) 1 7

Work Directory 1 9

Graphics Program 1 51

Migration Files 1 999

CRicMain::RootDirRICCString RootDirRIC();

This function will return the directory pathname where all of the ConCentRICs system files are kept.

CRicMain::SageExitRICvoid SageExitRIC(result);

int result; // Result code to return to System Agent

This function will stop SAGE processing, and return the parameter to System Agent. System Agent will use this number to display the final message.

CRicMain::SageReadRICCString SageReadRIC(key);

CString key; // Name of item to Retrieve

52 · Main Class ConCentRICs for Windows RIC Corp Class Libraries

Page 65: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

This function will retrieve a stored value from the SAGE process. The name of the item must be a name used previously with the SageWriteRIC command.

CRicMain::SageWriteRICvoid SageWriteRIC(key, value);

CString key; // Name of item to store

CString value; // Value of item to store

This function will store a value for SAGE processing. You can use any string value for key that you wish. You should keep track of what name you are using for which items, so it will be easier to retrieve them when necessary. You can retrieve any stored value with the SageReadRIC function.

CRicMain::SecurityLevelRICint SecurityLevelRIC();

This function will return the security level of the current user in the current application. Each user could have a different security level for each and every application they have access to. The chart below shows the possible values and meanings of the security levels.

Value Meaning Usage

0 No Access Can not use the maintenance at all

1 Read Only View only, no maintenance allowed

2 Normal The maintenance is a normal part of the job

3 Advanced Should be used by Facility Only - Use Normal

4 Privileged Should be used by Facility Only - Use Normal

5 Manager User has control over operating aspects

8 System System Administration

9 Development RIC Corp use only

CRicMain::SecurityRICBOOL SecurityRIC(appnum, appcode, langptr);

int appnum; // The number of the application

CString appcode;// The code of the application

HINSTANCE* lang // Pointer to a language handle

This function will initialize an application. It is called during the InitInstance function for the entire application. It will log in the user, if there is no user logged in. It will set all of the user's variables, and will set the user's security level for the application. If the Work Station the user is operating is not known to ConCentRICs then this routine will register the work station as well. This routine will return TRUE if the user logs in successfully. A return of FALSE, indicates that the user cannot log in, login has been canceled or the user has no access to the application.

ConCentRICs for Windows RIC Corp Class Libraries Main Class · 53

Page 66: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicMain::SetFileNumRICvoid SetFileNumRIC(filenum);

int filenum; // The internal control number for this option

This function will be used to start a new option or feature within the application. When the user requests to start a new option the file number must be set to the file number assigned to the desired option. When the document is started it will know which application to start by this number. When the document is started this value will be reset to zero (0) automatically.

CRicMain::StatNumRICint StatNumRIC();

This function will return the number of the current work station.

CRicMain::SystemCodeRICCString SystemCodeRIC();

This function will return the application's system code such as SYST. See Appendix A - RIC Corp Project chart for a complete list of the possible system codes. The application's system code is also called the application code.

CRicMain::SystemNameRICCString SystemNameRIC();

This function will return to overall system name such as ConCentRICs for Windows. This name is set in the System Profile.

CRicMain::SystemNumRICint SystemNumRIC();

This function will return the application's system number, also called the application number. See Appendix A - RIC Corp Project Chart for a complete list of the possible application numbers.

CRicMain::TimeHeadStateRICBOOL TimeHeadStateRIC();

This function will return TRUE if the current time should be shown in the page heading or FALSE if it should not.

CRicMain::TitlePgRICvoid TitlePageRIC(state);

BOOL state; // State of the title page

This function will set the status of the Title page. If the state is TRUE the title page will be printed, if the state is FALSE the title page will not be printed.

54 · Main Class ConCentRICs for Windows RIC Corp Class Libraries

Page 67: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicMain::TitlePgStateRICBOOL TitlePgStateRIC();

This function will return TRUE if the title page is on and it will return FALSE if the title page is off.

CRicMain::TruncateStateRICchar TruncateStateRIC();

This function will return a single character to indicate the user's selection for print truncation. Print truncation is used whenever the number of characters in the data to be printed is larger than the number of characters in the paper width. The possible values are L for left, R for Right, or F for resize to fit.

CRicMain::UserDeptRIClong UserDeptRIC();

This function will return the code number for the department that the user is assigned to.

CRicMain::UserDepartmentRICCString UserDepartmentRIC(type=0);

int type; // Indicates which description should be returned

This function will return the description of the department that the user is assigned to. If the type parameter is set to zero (0) then the full description will be returned, if it is set to one (1) then the short description will be returned.

CRicMain::UserkeyRIClong UserkeyRIC();

This function will return the key to the name and address file, for the current user. If you are going to log the user's activity, you should log the user with this number instead of their user number. The user numbers may be deleted, but their entry in the name and address file will remain.

CRicMain::UsernumRICint UsernumRIC();

This function will return the current user's user number. If you are logging the user's activity do not use this value but rather the user's name and address key instead.

CRicMain::UserFnameRICCString UserFnameRIC();

This function will return the current user's first name

ConCentRICs for Windows RIC Corp Class Libraries Main Class · 55

Page 68: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicMain::UserLnameRICCString UserLnameRIC();

This function will return the current user's last name.

CRicMain::UserNameRICCString UserNameRIC();

This function will return the user's first name and last name as one string field.

CRicMain::UserPrRICCString UserPrRIC();

All operating variables for a user are kept in an initialization file for each user. All variables for the user should be kept in this one file. This is also referred to as the user's profile. This will include such things as last organization used, last event id, last calendar year, title page setting, etc. This function will return the full filename including pathname directory for this file.

CRicMain::UserPrintRICvoid UserPrintRIC();

This function will bring up the Dialog Box of User Print Options. The user will be able to set their preference for printing reports. The user can select if a title page will be produced or not. If the current date or time will be displayed in the page headings. The format of the page number, and what to do with a report if it does not fit on the page exactly.

CRicMain::UserStationRICCString UserStationRIC();

This function will return the name of the current work station.

CRicMain::UserTitleRICCString UserTitleRIC();

This function will return the job title of the current user.

CRicMain::VersionRICCString VersionRIC();

This function will return the current version number of system. The version number comes from the System Profile.

CRicMain::YearDirRICCString YearDirRIC(calyear, orgnum);

int calyear; // The Calendar Year (optional)

56 · Main Class ConCentRICs for Windows RIC Corp Class Libraries

Page 69: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

int orgnum; // The Organization Number (optional)

This function will return the directory pathname for any of the Calendar Years. You pass the calendar year and organization number you want the pathname for. You can enter a minus 1 (-1) for both the calendar year and organization number. Minus 1 (-1) is the default value. A value of minus one (-1) will indicate to use the current calendar year and/or organization, last selected by the user. If the year is not valid then the default year directory is returned. This is year zero (0), which is the number used as the overflow year.

ConCentRICs for Windows RIC Corp Class Libraries Main Class · 57

Page 70: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

View Class

class CRicView

IntroductionThe CRicView class is a base class used to output the data in your applications document class. This class is used in your application's view class such as SYSTVIEW.CPP. The output of the data could be to any device such as the computer screen, printer, fax, or clipboard.

This class supports the user's manipulation of the data. It will allow the user to move, resize, minimize, maximize and scroll the data. The scrolling feature will only be available, if it is appropriate. If all of the data appears on the screen then no scroll bars will be present. If there is more data vertically that cannot be displayed then vertical scroll bars will be created. If the data will not fit vertically on the screen then horizontal scroll bars will be created. The scroll bars are dynamic and will change as the user resizes the screen.

This class will allow the user to select records on the computer screen. The user will be allowed to select multiple records for selected printing, or for inclusion to the Window's clipboard. If the user double clicks on a particular record, the selected record will be passed back to the document class. At that time either maintenance will be performed, or additional information can be displayed.

Normally the view will display the data as it appears in the document class. There may be rare cases that the display may be different then the data stored, or that the data stored may display a number of different formats as in the case of name and address data. In these cases there are custom features available. The custom items duplicate the document holding areas. The custom areas will be used for the display instead of the document, when instructed to do so.

The CRicView class uses the following structure to communicate between the application and the library.

struct ViewDataRIC

{

CString Title; // Custom Report Title

CString DocTitle; // Name of the Document

CString Format; // Format of the View

ConCentRICs for Windows RIC Corp Class Libraries View Class · 59

Page 71: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CString FloatTitle; // Floating title for the View

CString MultiCols; // Stores multi columns

CstringList Titles; // Custom Titles

CstringList Index; // Custom Indexes

CStringList Detail; // Custom Detail Lines

CStringList Tab; // Custom Tab Stops

LOGFONT lfont; // View's LogFont

CWordArray SelRec; // Selected Record Table

CSize ViewSize; // Size of View Area

CSize ViewPage; // Size of View Page

CSize ViewLine; // Size of View Line

CUIntArray CPages; // Custom Page Tracker

};

Implementation - Public MembersBeginPrintRIC Establishes the print conditions

ChgViewRIC Selects or deselects particular detail lines

ContextMenuRIC Operates right click Context popup menu

CopyFlagRIC Indicates if the screen can be sent to clipboard

CustomColNxtRIC Returns the Custom column numbers before and after the screen position passed to it

CustomColTabRIC Returns the Custom column's starting position, length and allignment

CustomSelRangeRIC Returns number of records before and after the specified custom record that forms the block

DialRIC Performs autodial feature

DialUpdateRIC Indicates if autodial feature is available

DrawLinesRIC Draws straight lines anywhere in view area

EndPrintRIC Terminates a print operation

FindRecRIC Searches the view for a particular search string

FontSelRIC Allows the user to change the view's font

InitCustomRIC Initializes the custom display area

InitialUpdate Ties the document to the view

InitPrintRIC Initialize the print variables

InitViewRIC Initialize the view variables

LButtonDownRIC Controls the action of a mouse click

MouseMoveRIC Controls the actions of a mouse movement

OnCopyRIC Displays the document in the clipboard

OnDrawRIC Displays the document to the computer screen

60 · View Class ConCentRICs for Windows RIC Corp Class Libraries

Page 72: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

OnKeyDownRIC Processes a user's function/control key action

OnPrintRIC Displays the document to a print device

OnScrollRIC Processes the user's scrolling requests

OnSizeRIC Determines the view size of the document

OnTimerRIC Processes standard timer messages

PreparePrintRIC Controls the setup of a print operation

PrintToFileRIC Places the output in a file instead of the printer

SagePrintRIC Automates printing for SAGE processing

SelColChkRIC Indicates if a column has been checked

SelRecBaseRIC Returns the base record of the selected records

SelRecChkRIC Determines if a particular detail line is selected

SelRecColRIC Returns the first selected column number

SelRecEndRIC Determines the first or last selected record

SelRecInitRIC Initializes the selection variables

SelRecNumRIC Returns the number of selected records to a particular detail line

SelRecOnRIC Indicates if any of the records have been selected

SelRecRIC Determines which record number was selected based on the position on the computer screen

SelRecSetRIC Selects a range of detail lines

SelRecTotRIC Returns the total number of selected records

SendMailRIC Sends current window to E-Mail as a file

SetCustomColRIC Sets the starting position, length, and alignment for custom report columns

SetScrollRIC Determines the appropriate scroll size

Data Members - Public Membersm_Active Indicates user functions are active

m_AddMode Indicates if an Add maintenance action is valid

m_ChgMode Indicates if a Change maintenance action is valid

m_cPages First line number on a page for the custom display

m_Custom Indicates to use custom display instead of doc

m_CustomClipCol Last column number to use in column clipping

m_CustomFBox First box column in custom display

m_CustomLBox Last box column in custom display

m_CustomMaxCol Maximum number of columns in custom display

ConCentRICs for Windows RIC Corp Class Libraries View Class · 61

Page 73: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

m_DelMode Indicates if a Delete maintenance action is valid

m_Detail Detail lines of custom display

m_Doc Pointer to the document's CRicDoc class

m_DocTitle Title of the application's function or option

m_Format Application use to indicate display format

m_hWnd Handle of the View's window

m_icon Indicates an Icon document or text document

m_Index Index lines of custom display

m_Initialize Indicates if the view is being initialized

m_MapMode Indicates current mapping mode of the view

m_pCustom Indicates if the print should use custom display

m_sCustom Indicates if the screen should use custom display

m_RecSel Indicates record selection mode

m_RecSel2 Indicates multiple record selection by mouse

m_RecSelK Indicates multiple record selection by keyboard

m_Tab Column indicators for custom display

m_Title Title of the custom display

m_Titles Title lines of the custom display

m_ViewLine Size of a line on the current view device

m_ViewPage Size of a page on the current view device

m_ViewSize Size of the total document display on the current view device

Application ConnectionThe CRicView class is defined to your project when you initially started your project. The class has a variable assigned to it. Since it is a classes you will need to use the variable name with a dot (.) or an arrow (->) then the name of the function.

The CRicView class is only available to your XXXXVIEW.CPP program. It will have a variable name of vw.

View Functions

CRicView::BeginPrintRICvoid BeginPrintRIC(pDC, pInfo);

CDC* pDC; // Pointer to output device

CPrintInfo* pInfo; // Pointer to print data structure

62 · View Class ConCentRICs for Windows RIC Corp Class Libraries

Page 74: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

The BeginPrintRIC function establishes the print conditions. It will set the font, map mode, character size, line size, and will set the date and time for the printed pages.

CRicView::ChgViewRICvoid ChgViewRIC(highlight=0, recnum=-1);

int highlight; // Sets the highlight condition (optional)

int recnum; // Record number to change (optional)

The ChgViewRIC function selects or deselects particular detail lines. This function is called whenever the user chooses a particular icon or detail line. The record number parameter indicates the record or icon that the user selected. If the record number is minus one (-1) the default, then all currently selected records will be used. The highlight parameter indicates what to do with the record number item. If the item is selected it will be highlighted, if it is deselected then it will return to the normal display color. The chart below shows the possible values for the highlight parameter.

Highlight value Selection Repaint Screen

0 None Repaint detail line

1 Deselection Repaint detail line

2 Selection Repaint detail line

3 Selection Repaint entire window

8 Non-sequential Repaint detail line

9 Deselection Repaint entire window

CRicView::ContextMenuRICvoid ContextMenuRIC(point, appitems);

CPoint point; // Point on screen where right clicked

CStringList* appitems; // Additional items to add to menu

This function will construct and then display the Context Popup Menu. This is the menu that will display with the click of the right mouse button. This feature is only available in 32-bit systems. The point will be given to you by the system, you just pass it to this routine. The appitems is optional. It will allow you to add your own options to this menu.

Each menu item needs to be a single string entry added to appitems. The format of each entry is: <priority number>\t<option prompt>\t<resource id>

The priority number is a three digit number. This will indicate where the new option will be placed on the menu. The first item you see has a priority of 010, then next 020 and so on. You then make your priority number inbetween the priority number of the options on either side.

The option prompt is the exact string text you want displayed. This should come from the string table and one letter of the text should be preceeded by an &. The letter after this will display underlined and will serve as a hot key. It is important

ConCentRICs for Windows RIC Corp Class Libraries View Class · 63

Page 75: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

that you review the current popup menu. Do not use a letter that is already underlined on the standard popup menu.

The resource id is the number in your string table that is assigned to the object being added to the menu.

CRicView::CopyFlagRICBOOL CopyFlagRIC();

The CopyFlagRIC function will return TRUE if the copy feature to the clipboard is active, otherwise if the copy feature is not active, it will return as FALSE.

CRicView::CustomColNxtRICvoid CustomColNxtRIC(col, previous, next);

int col; // Column character position

int *previous; // Pointer to previous column number

int *next; // Pointer to next column number

The CustomColNxtRIC function if provided with a column character position. The function will return the column number prior to the given position, and the column number next to the given position.

Parameterscolumn is the column character position of a given point.

previous is a pointer to a variable that will contain the nearest column number to the left of the given point. This value will be zero if there is no previous column.

next is a pointer to a variable that will contain the nearest column number to the right of the given point. This value will be zero if there is no column after this point.

Return ValueThis function will return values in the previous and next variables. These will contain the previous and next column numbers to the given point.

CommentsThe detail lines of the custom display are usually divided into columns. The columns could be made up of various size of characters. Given any character point in the line, this function will return the column numbers to the left and right of this point. This function is very beneficial to scrolling, since it can align the scroll on the next or previous columns.

CRicView::CustomColTabRICvoid CustomColTabRIC(column, start , length, alignment)

int column; // Column number

int *start; // Pointer to the starting position

int *length; // Pointer to the length of the column

64 · View Class ConCentRICs for Windows RIC Corp Class Libraries

Page 76: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

int *alignment; // Pointer to the column's alignment

The CustomColTabRIC function will return the starting position, length, and the alignment of a given column. These are the characteristics of the column.

Parameterscolumn is the column number that you want the characteristics for, where the first column would be column one (1).

Start is a pointer to a variable that will contain the starting character position of the column.

length is a pointer to a variable that will contain the total length of the column in character positions.

alignment is a pointer to a variable that will contain value of the text alignment of the column. The chart below shows the possible values for the alignment:

Value Alignment Use

0 Left (default) most text fields

1 Right numeric values

2 Centered titles

9 Vertical bar Charts and boxes

Return ValueThis function will return values in the start, length, and alignment variables to indicate the characteristics of the data column.

CommentsThe detail lines of the custom view are usually divided into columns. The columns could be made up of various size of characters, and can be aligned in different formats when displayed. This function will allow you to see the characteristics of any given column number.

Exampleint start, length, align;

int column = 2;

CustomColTabRIC(column, &start, &length, &align);

CRicView::CustomSelRangeRICvoid CustomSelRangeRIC(recnum, before, after);

int recnum; // Record number of inquiry

int *before; // Number of records before this one

int *after; // Number of records after this one

This function is used to retrieve block information. It is possible, but optional, that multiple custom detail lines can be tied together to form a block. This function is

ConCentRICs for Windows RIC Corp Class Libraries View Class · 65

Page 77: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

controlled by the record number passed in the first parameter. This indicates the current record. The function will return the number of records in front of this one in the block in the before parameter. The number of records beyond this one will be in the after parameter. If there is no block with this record, both the before and after parameters will be zero (0) to indicate none before or after this one.

CRicView::DialRICvoid DialRIC(viewptr);

CRicView* viewptr // Pointer to the view class

The DialRIC function will bring up the autodialer dialog box. It will allow you to dial any number in the view, or the selected entries in the view. This function needs a pointer to the CRicView class so it can determine what the selected records are.

CRicView::DialUpdateRICBOOL DialUpdateRIC();

The DialUpdateRIC function will determine if the autodialer function is available. The function will return TRUE if autodialing can be performed, or FALSE, if it cannot be performed. It will be available only if the work station has an autodial port, and if the view contains name and address information.

CRicView::DrawLinesRICvoid DrawLinesRIC(hdc, lines);

HDC hdc; // Handle of the view area

CStringList* lines; // Pointer to table of line specifications

This function will draw any number of straight lines, anywhere in the view area. The lines table will have one entry for each series of continues lines to be drawn. The format of each line has 6+ parameters separated by tabs. The value of each parameter is as follows:

size, where 1 is a thin line and 4 is a thick line

Red color

Green color

Blue color

x,y is the start from position

x,y is the move to position, you can have any number of these as parameters 7, 8, 9, etc.

You can draw a box with one entry. You only need separate entries if you want the pen to be picked up before the next line is drawn.

CRicView::EndPrintRICvoid EndPrintRIC(pDC, pInfo);

CDC* pDC; // Pointer to output device

CPrintInfo* pInfo; // Pointer to the print data structure

66 · View Class ConCentRICs for Windows RIC Corp Class Libraries

Page 78: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

The EndPrintRIC function terminates a print operation. If we reinitialize the view and delete any objects such as fonts that were required for the print operation

CRicView::FindRecRICLRESULT FindRecRIC(wParam, lParam);

WPARAM wParam; // Find Command

LPARAM lParam; // Pointer to the find data structure

The FindRecRIC function will process the message sent from the Find Dialog box. It will search the view for a particular search string. If the search string is found it will highlight the record found. If the search string was not found it will display a message box informing the user that the string was not found.

CRicView::FontSelRICBOOL FontSelRIC();

The FontSelRIC function allows the user to change the view's font selection. It will return TRUE if the font was changed, or it will return FALSE, if no change was made.

CRicView::InitCustomRICvoid InitCustomRIC();

The InitCustomRIC function will initialize the custom display option. Normally the view will display or print the document data. In some instances you may need a custom display instead of the document display. You should call this function prior to building a custom display.

CRicView::InitialUpdateRICvoid InitialUpdateRIC();

The InitialUpdateRIC function ties the document to the view by passing the pointer of the document to the view class. It will also set any of the view variables that are based on the document.

CRicView::InitPrintRICBOOL InitPrintRIC(pInfo);

CPrintInfo* pInfo; // Pointer to the printer data structure

The InitPrintRIC function initializes the print variables. It will set the paper size, paper orientation, and if the print should be in color. This function will return TRUE if the print can continue. If there is any reason that print cannot be done, then this routine will return FALSE. This could be caused if the user selects envelope paper and there is no address data in the document.

CRicView::InitViewRICvoid InitViewRIC(dc);

CDC* dc; // Pointer to the device contents

ConCentRICs for Windows RIC Corp Class Libraries View Class · 67

Page 79: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

The InitViewRIC function is called the first time a document calls the view. It will initialize the view variables for a new view.

CRicView::LButtonDownRICvoid LButtonDownRIC(point);

CPoint point; // The cursor position on the screen

The LButtonDownRIC function will select the record that the user clicked on. If the user clicks on a non-data element of the screen, such as the column titles, then nothing will be done.

CRicView::m_ActiveBOOL m_ActiveThe value of this item will be TRUE if user functions can be performed, otherwise FALSE, they cannot be performed.

CRicView::m_AddModeBOOL m_AddModeIf the user can perform add maintenance for this option the value will be TRUE, if the user cannot, the value will be FALSE.

CRicView::m_ChgModeBOOL m_ChgModeIf the user can perform change maintenance for this option the value will be TRUE, if the user cannot, the value will be FALSE.

CRicView::m_CPagesCUIntArray m_CPagesThis array will be used if the custom display places lines in particular positions. Each page number will have an entry in this array. The value of that entry will be the first line of data that should appear on that page.

CRicView::m_CustomBOOL m_CustomThis variable will return TRUE if the display should come from the custom data instead of the normal data from the document.

CRicView::m_CustomClipColint m_CustomClipColThis variable will contain the last column number of a clip column range in the custom display. Clip columns are line headings. Line headings must start with column one, but can include any number of columns. The returned value will be

68 · View Class ConCentRICs for Windows RIC Corp Class Libraries

Page 80: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

the last column to include in line headings. If there are no line headings, then set this variable to zero (0).

CRicView::m_CustomFBoxint m_CustomFBoxThis variable will contain the first column of a boxed entry in the custom display. It is used to determine box edging and corners.

CRicView::m_CustomLBoxint m_CustomLBoxThis variable will contain the last column of a boxed entry in the custom display. It is used to determine box edging and corners.

CRicView::m_CustomMaxColint m_CustomMaxColThis variable will contain the maximum column number in the custom display. It will show the total width of the display.

CRicView::m_DelModeBOOL m_DelModeIf the user can perform delete maintenance for this option the value will be TRUE, if the user cannot, the value will be FALSE.

CRicView::m_DetailCStringList m_DetailThis list will contain all of the detail lines for the custom display.

CRicView::m_DocCRicDoc* m_DocPointer to the document's CRicDoc class.

CRicView::m_DocTitleCString m_DocTitleTitle of the application's function or option.

CRicView::m_FormatCString m_FormatThis variable can be used by an application for any purpose they wish. It is usually used to determine the format of the output display.

ConCentRICs for Windows RIC Corp Class Libraries View Class · 69

Page 81: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicView::m_hWndHWND m_hWndHandle of the View's window

CRicView::m_iconBOOL m_icon_This item will be TRUE if the document is an Icon window or FALSE if it is a Text window.

CRicView::m_IndexCStringList m_IndexThis item will contain all of the index values for the custom display. There will be one index line for each detail line.

CRicView::m_InitializeBOOL m_InitializeThis item will be TRUE if the view is being initialized, or FALSE if the view is ready for use.

CRicView::m_MapModeint m_MapModeIndicates current mapping mode of the view. Icon views are in MM_TEXT mode and text views are in MM_LOENGLISH mode.

CRicView::m_pCustomBOOL m_pCustomThis item will contain TRUE if the custom display should be used during printing instead of the document data. It will be FALSE if the document data should be used as normal.

CRicView::m_sCustomBOOL m_sCustomThis item will contain TRUE if the custom display should be used during window displays instead of the document data. It will be FALSE if the document data should be used as normal.

CRicView::m_RecSelBOOL m_RecSelThis item will be TRUE if multiple sequential records can be chosen.

70 · View Class ConCentRICs for Windows RIC Corp Class Libraries

Page 82: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicView::m_RecSel2BOOL m_RecSel2This item will be TRUE if multiple non-sequential records can be chosen with the mouse.

CRicView::m_RecSelKBOOL m_RecSelKThis item will be TRUE if multiple non-sequential records can be choose with the keyboard.

CRicView::m_TabCStringList m_TabThis item will contain an entry for each column in the custom display. A column will consist of the starting position, length, and the alignment of the column.

CRicView::m_TitleCString m_TitleThis item will contain the title of the custom display.

CRicView::m_TitlesCStringList m_TitlesThis item will contain an entry for each title line required for the custom display.

CRicView::m_ViewLineCSize m_ViewLineSize of a line on the current view device.

CRicView::m_ViewPageCSize m_ViewPageSize of a page on the current view device.

CRicView::m_ViewSizeCSize m_ViewSizeSize of the total document display on the current view device.

CRicView::MouseMoveRICvoid MouseMoveRIC(point);

CPoint point; // Position on the cursor on the screen

ConCentRICs for Windows RIC Corp Class Libraries View Class · 71

Page 83: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

The MouseMoveRIC function controls the actions of a mouse movement. This function will not perform an action if the left mouse button is not pushed when the mouse is moved. If the left button is down, then this function will select the record under the mouse's cursor, if it is not selected already.

CRicView::OnCopyRICvoid OnCopyRIC();

The OnCopyRIC function will only be active if the user has selected records. This function will copy the column headings to the clipboard along with any selected detail records.

CRicView::OnDrawRICvoid OnDrawRIC(pDC);

CDC* pDC; // Pointer to the device contents

The OnDrawRIC function will displays the document to the computer screen

CRicView::OnKeyDownRICint OnKeyDownRIC(nChar, nRepCnt, nFlags);

UINT nChar; // The keyboard key that was struck

UNIT nRepCnt // Number of repetitive key strokes

UNIT nFlags // Any additional key conditions

The OnKeyDownRIC function will process a user's function/control key action. If the key or key combination are not supported by a ConCentRICs action then the key(s) are ignored. If the keyboard action selects a record for processing then this function will return the record number selected, else it will return a minus one (-1).

CRicView::OnPrintRICvoid OnPrintRIC(pDC, pInfo);

CDC* pDC; // Pointer to the printer device

CPrintInfo* pInfo; // Pointer to the print data structure

The OnPrintRIC function will display the document to a print device. If there are no selected records the entire document will be printed. If there are selected records, then only the page headings and selected records will be printed.

CRicView::OnScrollRICvoid OnScrollRIC(nSBCode, type=SB_VERT, nPos=0);

UINT nSBCode; // Scroll condition

int type; // Scroll action SB_VERT or SB_HORIZ

UNIT nPos; // Position of the Scroll button

The OnScrollRIC function will process the user's scrolling requests. The screen will be moved appropriately depending on the scroll action that the user selected.

72 · View Class ConCentRICs for Windows RIC Corp Class Libraries

Page 84: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicView::OnSizeRICvoid OnSizeRIC(width, length);

int width; // The width of the screen in pixels

int length; // The length of the screen in pixels

The OnSizeRIC function is called whenever the size or shape of the view changes. It will then recalculate the size of the scrolling, and character display to fit the new size of the view.

CRicView::OnTimerRICvoid OnTimerRIC(timer);

UINT timer; // The number of the mature timer

The OnTimerRIC function will process timer actions. When a timer is set, it will send a message at the end of the time period, by returning the timer number. This function will process any timers in use by standard RIC Corp routines. This will be used for such things as the clock on the status bar.

CRicView::PrintToFileRICBOOL PrintToFileRIC(section, excon, clipboard=NULL);

CString section; // Section for INI file to store file

BOOL excon; // Indicates external connections are allowed

CString* clipboard; // Pointer to Clipboard, defaults to NULL

The PrintToFileRIC function will ask the user for a file name, if there is not already one preset. It will default to the same name that was used last time. That name is stored in the INI file with a section name that you provide. It will then place the data that would have been sent to a printer, to the file instead. The file will contain to page headings or page breaks, just the data that would have appeared on paper. The field separaters used are controlled by the user. It is common practice to allow external connections after any file is created, so the user can automatically use the file in a third party application. You should set the excon parameter to TRUE, and only set it to FALSE if you do not want External Connections for any reason, such as you are going to use the file for something immediately after creation.

CRicView::PreparePrintRICvoid PreparePrintRIC(pInfo);

CPrintInfo* pInfo; // Pointer to the print data structure

The PrepareRIC function will control the setup of a print operation. It will set the max page and print preview size etc., prior to the Print dialog box appearing.

CRicView::SagePrintRICvoid SagePrintRIC(pInfo);

CPrintInfo* pInfo; // Pointer to the print data structure

ConCentRICs for Windows RIC Corp Class Libraries View Class · 73

Page 85: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

This function will perform no action unless SAGE processing is either being set or run. Then the normal print functions will be overridden to allow for automated unattended printing.

CRicView::SelColChkRICBOOL SelColChkRIC(index, column, type=0);

int index; // The detail record number to be checked

int column; // The column number to be checked

int type; // Type of selection (optional)

The SelColChkRIC function determines if a particular column on a detail line is selected. It will return TRUE if the column is selected or FALSE if it is not selected. The default value for type is zero (0) which will return TRUE if the column is selected in any way. If the value of type is one (1) it will only return TRUE if the column is a base record or a non-sequential multiple selection.

CRicView::SelRecBaseRICint SelRecBaseRIC();

The SelRecBaseRIC function will return the base record for multiple sequential record selection mode. When multiple sequential records are selected, the first record selected is the base record. All other selections are relevant to the base record. If the current selection is further from the base record then it is selected, if it is closer to the base record then it is deselected. If there is no base record then this function will return a minus one (-1).

CRicView::SelRecChkRICBOOL SelRecChkRIC(index, type=0);

int index; // The detail record number to be checked

int type; // Type of selection (optional)

The SelRecChkRIC function determines if a particular detail line is selected. It will return TRUE if the record is selected or FALSE if it is not selected. The default value for type is zero (0) which will return TRUE if the record is selected in any way. If the value of type is one (1) it will only return TRUE if the record is a base record or a non-sequential multiple selection.

CRicView::SelRecColRICint SelRecColRIC(index, direction=0, type=””);

int index; // The line number to be checked

int direction; // first or last selected record (optional)

CString type; //

The SelRecColRIC function will return the first selected column on the given record if the direction is set to the default value of zero (0). The last selected column on the given record will be returned if the direction value is one (1). If there are no selected columns this function will return a minus one (-1). If you pass

74 · View Class ConCentRICs for Windows RIC Corp Class Libraries

Page 86: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

a value in the type parameter the system will return the column that contains that value.

CRicView::SelRecEndRICint SelRecEndRIC(direction=0);

int direction; // first or last selected record (optional)

The SelRecEndRIC function will return the first selected record if the direction is set to the default value of zero (0). The last selected record will be returned if the direction value is one (1). If there are no selected records this function will return a minus one (-1).

CRicView::SelRecInitRICvoid SelRecInitRIC(size=0);

int size; // Total number of detail records

The SelRecInitRIC function will initialize the selected record table for a document. The first time a document is tied to a view, this function will be called with the total number of detail lines. This will create a selection table of the appropriate size. If this function is called without a size parameter designated or a size of zero, it will reset the selection table so that there are no records are selected.

CRicView::SelRecNumRICint SelRecNumRIC(count);

int count; // Record offset of a detail line

The SelRecNumRIC function will return the record number of a selected record. The record number of the xth selected record will be returned. The count field represents the xth value. Record numbers may not be selected sequentially. Maybe the 2nd, 4th and 6th records are selected. The second selected item is record number 4. If you used this function with this example, and set the count to 2, then 4 will be returned. If you pass a 3 for count then the number 6 will be returned. If you put a number higher than the number of selected records then –1 is returned.

CRicView::SelRecOnRICBOOL SelRecOnRIC();

The SelRecOnRIC function will return TRUE if there are any records selected. It will return FALSE if there are no records selected.

CRicView::SelRecRICint SelRecRIC(point);

CPoint point; // A position on the terminal screen

The SelRecRIC function will determine the record number that corresponds to the screen position provided. If the screen position does not point to a detail line then this function will return minus one (-1).

ConCentRICs for Windows RIC Corp Class Libraries View Class · 75

Page 87: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicView::SelRecSetRICvoid SelRecSetRIC(record1, record2=-1, value=”1”);

int record1; // First selected record number

int record2; // Last selected record number (optional)

int value; // Set value (optional)

The SelRecSetRIC function selects or deselects a range of detail lines. If there is no record2 parameter or the value is less than zero (0) which is the default, then only the one record will be selected or deselected. The value parameter determines how the record is to be set. The chart below will show the possible values of this parameter.

Value Result

0 Deselects

1 (Default) Selects

2 Selects as base record

3 Selects as a non-sequential

CRicView::SelRecTotRICint SelRecTotRIC();

The SelRecTotRIC function will return the total number of selected records. If there are no records selected then this function will return zero (0).

CRicView::SendMailRICvoid SendMailRIC(title);

CString title; // Title of the Message

This function will take the current active window. It will be printed with the current print-to-file options. The file will then be passed to Electronic Mail. It will be ConCentRICs mail if available. It will sent to MAPI mail if there is no ConCentRICs mail. If there is no ConCentRICs mail or MAPI mail, then the command is ignored. Electronic mail will be started in Write New Note mode, and the file will be attached to the message automatically. As soon as the user completes the message, then Electronic Mail will be ended and the user will be returned to the same place in the application.

The Title parameter would normally be the title of the E-Mail messages. The Title could also be used for special purposes. You could pass the title, message and who to send it to in the Title paramter. You would need to separate each item with a “;” such as msgtitle + “;” + msg + “;” + who. You must also make sure the msgtitle and message to do already contain “;” symbols. If your msgtitle or message do contain the “;” you should use the next method.

The Title parameter could also indicate to use an external file for the message information. Set the value of Title to: SendMail; Then create a file <maildr>\SM%d.ric, where %d is user.UsernumRIC(); The format of this file is: message title\001message\001to who\002 <repeat as needed> The to who parameter has the

76 · View Class ConCentRICs for Windows RIC Corp Class Libraries

Page 88: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

following format: NK + Name and address key, DL + Distribution List key, or EP + Person’s Name + Person’s E-Mail address. You can put in multiples of each if you separate each one with a semi colon (;).

This function can be executed from a command line. The command line needs to appear like:

Mail.exe SPCL:1:R:\Riccorp\maildata\SM10.RIC:SendMail

CRicView::SetCustomColRICvoid SetCustomColRIC(start , length, alignment)

int start; // Starting position of the column

int length; // Length of the column

int alignment; // Column's alignment

The SetCustomColRIC function will allow you to set the custom display column's starting position, length, and the column's alignment.

ParametersStart is a variable that will contain the starting character position of the column.

length is a variable that will contain the total length of the column in character positions.

alignment is a variable that will contain value of the text alignment of the column. The chart below shows the possible values for the alignment:

Value Alignment Use

0 Left (default) most text fields

1 Right numeric values

2 Centered titles

9 Vertical bar Charts and boxes

CommentsThe detail lines of the custom display are usually divided into columns. The columns could be made up of various size of characters, and can be aligned in different formats when displayed. This function will allow you to set the characteristics of any given column number. You can enter the columns in any order, and columns can overlap one another. The order of the columns indicates the order of the TAB (\t) indicators you need to add to the custom detail lines. The twelfth (12th) column would need eleven (11) TAB (\t) indicators prior to the data.

CRicView::SetScrollRICvoid SetScrollRIC();

The SetScrollRIC function determines the appropriate scroll size for the current window. If the size of the view changes, or the number of detail lines change, then this function will calculate the correct scrolling size, and view attributes that match the size of the view's window.

ConCentRICs for Windows RIC Corp Class Libraries View Class · 77

Page 89: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

Data Classes

Overview

IntroductionThe Data Classes will handle complex data items, and all the functions required to handle those data items. These include date, time, number, money, and names and addresses. These data types are required by almost every ConCentRICs application. All of these data types have international implications since different countries may display the same values in a unique way. The Data Classes will handle these differences for you with no additional coding in your program. Just by using these classes, you will display the data the way you want to see it. At run time the system will look at the user's Window's control panel and will display the data as requested by the user. You can use these classes within any of your classes in any of your application modules. It is mandatory that you use these classes for those data types.

Application ConnectionWhen ever you need these classes you would define them just like any other data type. You would have a line in your program with the name of the class followed by the name of a variable that you make up. When you use the functions for the classes you use the name of the variable you made up followed by a dot (.) or an arrow (->) followed by the name of the function.

Data Class OverviewThe data classes are true representations of the Class concept in C++. The class itself represents an object within ConCentRICs, such as a Date, Time, Code, etc. The attributes of the class define the data types that make up that object. Generally you do not deal directly with these data types. Instead the class provides functions to interact with the data.

ConCentRICs for Windows RIC Corp Class Libraries Data Classes · 79

Page 90: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

class CRicCode

IntroductionThe CRicCode classis a data class used to represent application code tables. Any of your application classes may use this class. All of codes in ConCentRICs are stored and accessed from a common file or files. If the table is classified at the system level then all applications will keep their code values in the one system file. If they are classified by Org, then a unique set of codes will be maintained for each established organization. This class will control the access and maintenance of the code tables. You do not need to add any code table routines in your application. You will use this class instead. Code classes are contained in a dynamic link library. You can use the library functions to use the code functions with out having to call the code functions directly.

Implementation - Library FunctionsCodeInitRIC Performs the document init function for codes

CodeMaintRIC Performs the Code Maintenance

CodeUndoRIC Undos a code maintenance operation

Implementation - Public MembersCodeAdd Adds a new code to the table

CodeColor Will return the color of the code

CodeDesc Will return the string values of a code

CodeDialog Controls the Table and Code dialog boxes

CodeFloat Will return the decimal or dollar value

CodeInt Will return the integer value of a code

CodeLoadCombo Loads a table of codes in a combo box

CodeLoadList Loads a table of codes in a list box

CodeLong Will return the long integer value of a code

CodeLookup Finds a Table or Code record and returns it

CodeMaint Table and Code Maintenance

CodeParams Finds a Table and sets it's code parameters

CodeSearch It will list all possible Tables or Codes and allow the user to select one

Data Members - Public Membersm_Cat Table Lookup indicator

m_Cat1 System Number of Code Lookup

m_Cat2 Table Number of Code Lookup

m_CatScope The Scope of the Code Lookup

m_ColorSwt Indicates if the code has a color

m_Doc Pointer to the document's CRicDoc class

80 · Data Classes ConCentRICs for Windows RIC Corp Class Libraries

Page 91: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

m_Id The id of a specific code

m_LookupName A description of the Lookup Table

m_OptionalSwt Indicates if the variable is optional or not

m_OrgDir Pathname of the current organization

m_PrioritySwt Indicates if the code has a priority level

m_RootDir Pathname of the system files

m_Scope Indicates if the code is a system or org

m_SecuritySwt Indicates if the code has a security level

m_ShortSwt Indicates if the code has a short description

m_Sort Indicates how the user wants the list sorted

m_Summary Indicates if the display is detail or summary

m_System Indicates the current system number

m_TableName A description of the selected Table

m_Type The number of the Table

m_Var Indicates the type of Variable with the code

m_VarName A description of the codes variable

CodeInitRICCString CodeInitRIC(doc, table=0, system=0);

CRicDoc* doc; The address of the document class

int table; Optional table number

int system; Optional system number

This function will perform the init function for codes in your application. The table number is optional. It will default to zero which indicates all tables in the current application. If you want to select a particular table within the application, then set the table parameter to the number of that table. The system number is also optional, it will use the current application number for the system but can be overridden with any valid ConCentRICs system number.

This function will return the title of the table selected.

You would use this function in your application as follows:

CString title = CodeInitRIC(GetDocPtr());

if (title == “”)

{

user.SetFileNumRIC(999);

return;

}

SetTitle(title);

user.LogputRIC(GetTitle());

doc.SetModuleIdRIC(ID_TABCODE); // or whatever is appropriate

ConCentRICs for Windows RIC Corp Class Libraries Data Classes · 81

Page 92: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CodeMaintRICBOOL CodeMaintRIC(doc, key, recnum, delmode, system=0);

CRicDoc* doc; // The address of the document class

CString key; // The key to the record to be maintained

int recnum; // Record number of maintenance item

BOOL delmode; // Indicates delete button can be active

int system; // Application number

The CodeMaintRIC function will perform all file maintenance activity to the file as it was indicated by the dialog box. The system number is also optional, it will use the current application number for the system but can be overridden with any valid ConCentRICs system number. You would use this module in your application, in the document’s OnMaintDoc function as follows:

switch (doc.FileNumRIC()) {

case 1:

CodeMaintRIC(GetDocPtr(), key, recnum, delmode);

break;

}

CodeUndoRICBOOL CodeUndoRIC(doc, system=0);

CRicDoc* doc; // The address of the document class

int system; // Application number

The CodeUndoRIC function will perform the file maintenance undo activity to the file. This would reverse the last maintenance activity performed on codes. The system parameter will use the current application number when set to zero or you can override this by passing a valid ConCentRICs application number. You would use this module in your application, in the document’s OnUndoDoc function as follows:

switch (doc.FileNumRIC()) {

case 1:

CodeUndoRIC(GetDocPtr());

break;

}

CRicCode::CodeAddBOOL CodeAdd(system, table);

int system; // The Application system number

int table; // The Table number of the code

The CodeAdd function will allow you to quickly add a new Code value to a table. You just pass the system number of the application that controls the code, and the table number of the code. The add dialog box will be displayed. A value of

82 · Data Classes ConCentRICs for Windows RIC Corp Class Libraries

Page 93: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

TRUE will be returned if a code was added or it will return FALSE if a code was not added.

CRicCode::CodeColorCOLORREF CodeColor(system, table, id, field);

int system; // The Application system number

int table; // The Table number of the code

long id; // The specific id of the code

int field; // Field number to be returned

The CodeColor function will return the color associated with the specified code. If the code can not be found than a color of black (0,0,0) will be returned. The code file does not need to be declared or opened to use this function. If you are using the codefile, the record pointer may be moved. It would be best if you used a SavePosition command on the file before this function, and then a RestorePosition command after this function to restore the code file to it's original position. If the field parameter is set to one (1) the background color will be returned. If the field parameter is set to two (2) the text color will be returned. If you need both colors set as a column color, then use the CodeDesc option with a type of three (3).

CRicCode::CodeDescCString CodeDesc(system, table, id, field=0);

int system; // The Application system number

int table; // The Table number of the code

long id; // The specific id of the code (fieldname)

int field; // Field number to be returned

The CodeDesc function will return the string values of any code. If the code cannot be found than a NULL string will be returned. The code file does not need to be declared or opened to use this function. If you are using the codefile, the record pointer may be moved. It would be best if you used a SavePosition command on the file before this function, and then a RestorePosition command after this function to restore the code file to it's original position. The field number indicates which string value in the code you would like returned. Set this field number to the appropriate value in the chart below:

Field Number Returned Field

0 Description (Default)

1 Short Description (2 characters for most codes except rooms

2 Character Variable (short description for rooms)

3 Color Column String

Field numbers 0, 1 and 2 are just accessing fields in the file. Field Number 3 will build a string from six fields in the file. The Color Column String will return the codes colors in the format required for a column color. A color is made up of three numbers for Red, Green and Blue. A column color is made up of two different

ConCentRICs for Windows RIC Corp Class Libraries Data Classes · 83

Page 94: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

colors, the first for the background color, the second for the foreground color. This is a total of six numbers for one column color. Each color number is separated by a comma for the column color format. The exact string returned would be:

bkgrnd red, bkgrnd green, bkgrnd blue, text red, text green, text blue

This resulting string can be used in the building of the color string to attach to the key in a standard print/display line that you want to use with color.

CRicCode::CodeDialogBOOL CodeDialog(maint);

MaintBlockRIC maint; // pointer to a maintenance block

The CodeDialog function will control the Table and Code dialog boxes, just as a normal dialog function would do in your document. You would not call this function directly but use the library function CodeMaintRIC to perform the maintenance.

CRicCode::CodeFloatfloat CodeFloat(system, table, id);

int system; // The Application system number

int table; // The Table number of the code

long id; // The specific id of the code

The CodeFloat function will return the decimal or money value associated with the specified code. If the code cannot be found than a value of zero will be returned. The code file does not need to be declared or opened to use this function. If you are using the codefile, the record pointer may be moved. It would be best if you used a SavePosition command on the file before this function, and then a RestorePosition command after this function to restore the code file to it's original position.

CRicCode::CodeIntint CodeInt(system, table, id, field=0);

int system; // The Application system number

int table; // The Table number of the code

long id; // The specific id of the code

int field; // Field number to be returned

The CodeInt function will return the string values of any code. If the code cannot be found then a zero value will be returned. The code file does not need to be declared or opened to use this function. If you are using the codefile, the record pointer may be moved. It would be best if you used a SavePosition command on the file before this function, and then a RestorePosition command after this function to restore the code file to it's original position. The field number indicates which integer value in the code you would like returned. Set this field number to the appropriate value in the chart below:

Field Number Returned Field

84 · Data Classes ConCentRICs for Windows RIC Corp Class Libraries

Page 95: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

0 Priority Level (Default)

1 Security Level

2 Integer Variable

CRicCode::CodeLoadCombovoid CodeLoadCombo(combobox, system, type, id=0);

CComboBox* combobox; // Pointer to the combo box to be filled

int system; // Application system number of table

int table; // The table number of the code

long id; // The specific code number to be selected

The CodeLoadCombo function will fill the combo box pointed to by the combobox parameter with the table referenced by the system and table parameters. The id parameter is optional. If there is a value greater than zero in this parameter than the combo box will have that key record pre-selected. There are also some special values allowed for this parameter. If it is set to zero (0), the default, then the highest priority one will be selected. If more than one have the same priority then the first one with the highest priority will be selected. If there are no priority settings for the code, then the first record found will be pre-selected. If you enter a minus one (-1) for this parameter, then no entry will be pre-selected.

CRicCode::CodeLoadListvoid CodeLoadList(listbox, system, type, id);

CListBox* listbox; // Pointer to the list box to be filled

int system; // Application system number of table

int table; // The table number of the code

long id; // The specific code number to be selected

The CodeLoadList function will fill the list box pointed to by the listbox parameter with the table referenced by the system and table parameters. The id parameter is optional. If there is a value greater than zero in this parameter than the list box will have that key record pre-selected. There are also some special values allowed for this parameter. If it is set to zero (0), the default, then the highest priority one will be selected. If more than one have the same priority then the first one with the highest priority will be selected. If there are no priority settings for the code, then the first record found will be pre-selected. If you enter a minus one (-1) for this parameter, then no entry will be pre-selected.

CRicCode::CodeLonglong CodeLong(system, table, id, field=0);

int system; // The Application system number

int table; // The Table number of the code

long id; // The specific id of the code

int field; // Field number to be returned

ConCentRICs for Windows RIC Corp Class Libraries Data Classes · 85

Page 96: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

The CodeLong function will return the long integer values of any code. If the code cannot be found than a zero value will be returned. The code file does not need to be declared or opened to use this function. If you are using the codefile, the record pointer may be moved. It would be best if you used a SavePosition command on the file before this function, and then a RestorePosition command after this function to restore the code file to it's original position. The field number indicates which long value in the code you would like returned. Set this field number to the appropriate value in the chart below:

Field Number Returned Field

0 Table Number (Default)

2 Long Variable

NOTE: The variables interger value is actually stored in the Long variable, so that it can hold a very large number. The Int variable above only holds the yes/no response.

CRicCode::CodeLookupBOOL CodeLookup(fileptr, system, table, id=0, find=TRUE);

cCODEFILE* fileptr; // Pointer to a Code file

int system; // Application system number of table

int table; // The table number of the code

long id; // The specific number of the code

BOOL find; // Indicates the actual record is to be found

The CodeLookup function will return the actual code or table record for any code or table established. The file must be declared but not opened before this routine can be used. You declare the file, pass the system number, table number, and id of the code to this function, and it will return TRUE if the record is found or FALSE if it is not found. You can access the fields for the codefile directly from the file using the fileptr parameter. When the find parameter is set to TRUE the actual record will be found, but if it is set to FALSE then only the proper codefile will be opened.

CRicCode::CodeMaintBOOL CodeMaint(fileptr, maint);

cCODEFILE* fileptr; // Pointer to the Table or Code file

MaintBlockRIC maint; // Pointer to the Maintenance data block

The CodeMaint function will perform all file maintenance activity to the file as it was indicated by the dialog box. This function should not be called directly but rather through the CodeMaintRIC function.

CRicCode::CodeParamsBOOL CodeParams(system, table);

int system; // Application system number

86 · Data Classes ConCentRICs for Windows RIC Corp Class Libraries

Page 97: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

long table; // Table number of the code

The CodeParams function will search for the parameters of a code and set the appropriate data members as to the exact configuration of the table. The following data members will be set by calling this function: m_ShortSwt, m_ColorSwt, m_PrioritySwt, m_SecuritySwt, m_Scope, m_Cat, m_Cat1, m_Cat2, m_CatScope, m_Var, m_TableName, m_VarName, m_LookupName, and m_AppSwt.

CRicCode::CodeSearchBOOL CodeSearch(level, report);

int level; // Determines the level of the search

BOOL report; // Indicates if report question is asked

The CodeSearch function will allow the user to select a table, or to select a particular code from a table. The m_System field is used to determine which application the table belongs to. It will default to the current application, and does not need to be set unless the table is in a different application system. You would set it to the application number in the RIC Corp Project Chart in Appendix A. It will use the m_Type field to determine if a list of tables or codes are displayed. If the m_ Type field is zero (0) then a list of the tables for that Application System will be displayed. If the m_ Type field has a value then the codes for that table will be displayed. If the level field is set to one (1) then the TABLE button will be displayed to allow the user to get to the tables themselves. A level of two (2) would display the ADD button and allow the user to add a new code to the table. A level value of zero (0) would not show either button. A level of nine (9) will not search at all, but will bring up the report criteria dialog box only. The Report switch is set to TRUE or FALSE depending if the detail/summary report question will be asked. If report is set to TRUE then the question will be asked and the value will be placed in the m_Summary data member. If the ADD button is active and selected then the user will be allowed to add a new code to the table. The function will return TRUE if a code has been selected or FALSE if the search was canceled without selected a code. If a code is added it is automatically returned as the selected code, in the variable m_Id.

long id;

CRicCode code;

code.m_Type = 1;

if (!code.CodeSearch(2, TRUE)

{

user.SetFileNumRIC(999);

return;

}

id = code.m_Id;

CRicCode::m_Catint m_CatA code can have a lookup table or string table associated with it. This field will contain which is associated with this code. A value of 0 will indicate neither a 1

ConCentRICs for Windows RIC Corp Class Libraries Data Classes · 87

Page 98: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

will be a lookup table or a value of 2 will be a string table. The CodeParams function will set this value.

CRicCode::m_Cat1int m_Cat1If a code has a lookup table or string table associated with it, then this item will contain a system number for a lookup table, or the first value in the string table. The CodeParams function will set this value.

CRicCode::m_Cat2int m_Cat2If a code has a lookup table or string table associated with it, then this item will contain the table number for a lookup table, or the last value in the string table. The CodeParams function will set this value.

CRicCode::m_CatScopeint m_CatScopeThis variable will determine if the table is at the system level or is there a different table for each organization. This field will have a value of 0 if it is at the system level, and a value of 1 will indicate organization. The CodeParams function will set this value.

CRicCode::m_ColorSwtBOOL m_ColorSwtThis variable indicates if there is a color associated with the code. This value will be TRUE if there is color or FALSE if no color. The CodeParams function will set this value.

CRicCode::m_DocCRicDoc* m_DocThis class will contain the functions necessary to easily add tables and codes to your application. In order to tie the Tables and Codes to your document, the CRicCode class needs to have a pointer to the document's CRicDoc class. Place the pointer for that class in this data member.

CRicCode::m_Idlong m_IdThis variable will contain the number of a specific code. If you are dealing with one specific code, you set the value of that code to this data member.

CRicCode::m_LookupNameCString m_LookupName

88 · Data Classes ConCentRICs for Windows RIC Corp Class Libraries

Page 99: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

If the code has an associated lookup table or string table than this variable will contain the name of that table, or the words string table. The CodeParams function will set this value.

CRicCode::m_OptionalSwtBOOL m_OptionalSwtThis value will be TRUE if the code's variable is optional, or FALSE if the code's variable is mandatory.

CRicCode::m_OrgDirCString m_OrgDirThis data member will contain the pathname of the current organization. This data member will be filled automatically when the class is created. You can override it if you wish to use a pathname for a different organization other than the currently selected one.

CRicCode::m_PrioritySwtBOOL m_PrioritySwtThis variable will indicate if the code has a Priority Level associated with it. The CodeParams function will set this value.

CRicCode::m_RootDirCString m_RootDirThis variable will contain the pathname of the system files. This field will be filled in automatically when the class is created. It can be overwritten.

CRicCode::m_Scopeint m_ScopeThis variable will indicate if the code is system wide or is there a separate set of codes for each organization. The value will be zero (0) if the table is system wide, or it will have a value of one (1) if there is a separate set for each organization. The CodeParams function will set this value.

CRicCode::m_SecuritySwtBOOL m_SecuritySwtThis variable will indicate if there is a security level associated with a code. The value will be TRUE if there is a security level or FALSE if there is not. The CodeParams function will set this value.

CRicCode::m_ShortSwtBOOL m_ShortSwt

ConCentRICs for Windows RIC Corp Class Libraries Data Classes · 89

Page 100: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

This variable will indicate if there is a short two character description associated with a code. The value will be TRUE if there is a short description, or FALSE, if there is not. The CodeParams function will set this value.

CRicCode::m_Sortint m_SortThis variable will contain the value of the user selected sort option. This field will contain one of the values in the chart below:

Value Description

0 File Key or No Sort

1 Priority Level

2 Code Description

3 Short Description

CRicCode::m_SummaryBOOL m_SummaryThis variable will indicate if the report will be displayed in summary or detail form. The value will be TRUE for summary format or FALSE for the detail format. The CodeSearch function will allow the user to set this value.

CRicCode::m_Systemint m_SystemThis data member will contain the Application System Number for the code process. When the class is created it will be automatically filled with the current application system number. You may reset this value to a different application if you wish to access a code from a different application.

CRicCode::m_TableNameCString m_TableNameThis variable will contain a description of the Table. The CodeParams function will set this value.

CRicCode::m_Typeint m_TypeThis variable will contain the table number requested. You would set this to a value of zero to access the tables themselves, or set it to a specific table number to access that table. When the class is created this value will be set to zero.

90 · Data Classes ConCentRICs for Windows RIC Corp Class Libraries

Page 101: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicCode::m_Varint m_VarThis variable will indicate which variable type is associated with the code. All the codes could have a variable associated with it. If this value is zero (0) there is no variable for the code. A value of one (1) will indicate a character variable held in the CHAR field. A value of two (2) will indicate an integer field whose value is held in the INT field. A value of three (3) will indicate a money variable whose value is held in the FLOAT field. A value of four (4) will indicate a yes no question, and the value will be in the INT field where 1 is on and other value is off. The CodeParams function will set this value.

CRicCode::m_VarNameCString m_VarNameIf this code has a variable associated with it, then this data member will contain the name of that variable. The CodeParams function will set this value.

class CRicDate

IntroductionThe CRicDate class is a data class used to represent date data. It provides a variety of functions to store, display and retrieve date information. The routine will allow you to store dates from a number of different sources and will give you great control of the display of that date information.

The date data structure will contain the month, day, and year with century. You may retrieve any portion of the date, or date parameters.

Construction - Public MembersChgDate Change date by a specific number of days

Set Assigns a new date value

Extraction - Public MembersCentury Returns the Century portion of the date

ChkDate Compares two CRicDate variables

DateInRange Compares two date ranges for overlap

Display Used to output the date in different formats

DD Returns the Day parameter

MaxMonth Returns the maximum day of any month/year

MM Returns the Month parameter

Order Returns the user preference of date format

Symbol Returns the character used to separate the monthfrom the day and year

Value Extracts the whole date in Btrive format

ConCentRICs for Windows RIC Corp Class Libraries Data Classes · 91

Page 102: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

YEAR Returns the four digit Year parameter

YY Returns the last two digits of the Year parameter

Operators - Public Members+= Add a number of days to the date data

-= Subtract a number of days from the date data

++ Add one (1) day to the date data

-- Subtract one (1) day from the date data

= Set the date data from another CRicDate

- Number of days between two dates

> Compare one date greater than another

>= Compare one date greater than or equal to

< Compare one date less than another date

<= Compare one date less than or equal another

== Compare if two dates are equal

!= Compare if two dates are not equal

CRicDate::Centuryint Century()

The Century function will extract the century portion of the date.

Return ValueThis function will return numeric value that represents the date's century. If the date was December 25, 1994 then this routine would return 1900.

CRicDate::ChgDatevoid ChgDate(value)

int value // Number of days to add or subtract from date data

The ChgDate function will allow you to add or subtract a specified number of days to the date data. If you add three days to the date of February 27, 1994 you would get March 2, 1994. You add by supplying a positive number and subtract by supplying a negative number. This can also be done with the +=, -=, ++, and -- operators.

CRicDate testdate;

testdate.Set(2,27,1994);

testdate.ChgDate(3);

CRicDate::ChkDateBOOL ChkDate(date)

int direction; // Indicates less then, equal, or greater than compare

92 · Data Classes ConCentRICs for Windows RIC Corp Class Libraries

Page 103: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicDate date; // CRicDate variable with valid date data.

The ChkDate function will allow you to compare two CRicDate variables. The result will be TRUE if they compare and FALSE if they do not. This function can also be done with the >, >=, <, <=, ==, and != operators. Use the chart below to set the direction parameter.

Direction Value Comparison Made

-1 Less than

0 Equal to

1 Greater than

The following example will check if two dates are equal to each other:

CRicDate datea, dateb;

datea.Set(2,27,1994);

dateb = datea;

if (datea.ChkDate(0, dateb)); // The result of this if would be

CRicDate::DateInRangeBOOL DateInRange(sdaterange, edaterange, sdatetest, edatetest, within=FALSE)

CRicDate sdaterange; // Starting Date of Range

CRicDate edaterange; // Ending Date of Range

CRicDate sdatetest; // Starting Test Date

CRicDate edatetest; // Ending Test Date

BOOL within; // Test dates inclusive of range

The DateInRange fucntion will compare two sets of dates to determine if the test or second set of dates intersects with the range or first set of dates. The within parameter determines the scope of the compare. If this value is FALSE then if any of the test dates falls on a range date than the compare will be TRUE. If the within parameter is TRUE then all of the test dates must be within the range dates for TRUE to be returned. This is an optional parameter that will default to FALSE. You must provide both a starting and ending date to this function. If you only have one of the two dates, you can set the starting and ending date to the same value. The chart below will give you several examples of what results you will get with certain parameter settings.

sdaterange edaterange stestdate etestdate within result

6/1/1996 7/31/1996 5/1/1996 7/1/1996 FALSE TRUE

6/1/1996 7/31/1996 5/1/1996 7/1/1996 TRUE FALSE

6/1/1996 7/31/1996 5/1/1996 8/1/1996 FALSE TRUE

6/1/1996 7/31/1996 5/1/1996 8/1/1996 TRUE FALSE

6/1/1996 7/31/1996 5/1/1996 5/15/1996 either FALSE

6/1/1996 7/31/1996 6/15/1996 7/1/1996 either TRUE

ConCentRICs for Windows RIC Corp Class Libraries Data Classes · 93

Page 104: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicDate::DayOfWeekint DayOfWeek()

The DayOfWeek function will return the day of week number for the date. The return values will be as follows: 0=Sunday, 1=Monday, 2=Tuesday, 3=Wednesday, 4=Thursday, 5=Friday, 6= Saturday. If you want the name of the day then you can use this result to obtain that with CString dow = LSRIC(IDS_AP_SUNDAY + date.DayOfWeek()); You can replace IDS_AP_SUNDAY with IDS_AP_SUN for the short day of weeks.

CRicDate::DisplayCString Display(size=0, format=””)

int size; // Indicates the short, long or custom date output

CString format; // Date style to use for display

The Display function will take the date data and put it in a CString variable in a variety of formats, that you can use in the application to display the date to the user.

ParametersBoth of the parameters are optional, and should only be used if you want the date in a specific format. If you leave off both parameters the date will be displayed in the format that the user has selected. This should be the way you would normally display dates. Only use the parameters if you have a special need to display a date in a specific format.

size indicates if the short, long, custom or the special date format will be used. The chart below shows the value to use for the size parameter.

Size Value Result Example Date

0 short 2/7/94

1 long Monday February 7, 1994

2 custom Programmer's Format

3 special 1994 2 7

The default is zero (0) for the short format. An invalid size will use the default short format.

Format indicates the style to use to display the date. The default value is NULL. A NULL format will display the date in the style the user has selected. You can customize the date output by entering date format parameters. The chart below shows the effect of the different format parameters. A size value of 3 (special) ignores this parameter. You can combine any of the format parameters to obtain the exact date format you want.

Format Parameter

Result Example DateMonday February 7, 1994

94 · Data Classes ConCentRICs for Windows RIC Corp Class Libraries

Page 105: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

DDDD long day of week Monday

DDD short day of week Mon

DD day number with leading zeros 07

D day number 7

MMMM long month name February

MMM short month name Feb

MM month number with leading 0's 02

M month number 2

YYYY full year with century 1994

YY year 94

/ user's short date separator \

You can use upper or lower case values. The way the format parameters generate a date depend completely on the size parameter. The position of the month, day and year parameters could vary from country to country. The United States uses the month day year format, where in Europe they use the day month year format. Some countries use year month day. When you use a size parameter of zero (0) or one (1) the actual order of the date fields will be determined by the settings in the Windows control panel. The length of the fields will be determined by the format parameter. For example we have a control panel set in European format day month year. if you wanted a short date format with a full year you would enter a size parameter of zero (0) and a format of MDYYYY. The system will give you 7/2/1994. If you want the short year you enter a size of zero (0) and a format of MDYY. The system will give you 7/2/94. If you want to override the user settings and show a month, a slash and the day, you would enter a size parameter of two (2) for custom and a format of M/D. The system will output 2/7. Any date field you leave out of the format parameter will not be added to the date display. When you use the custom format any character between a date field will be displayed as that character. You will need to add spaces, commas, or any other punctuation between the date fields. If you need to use a date parameter between the date fields, then you can enclose it with single (') or double (") quotes.

Return ValueThe return value is the formatted date in a CString variable.

CommentsThe normal use of this function is with no parameters, or just the size parameter of one (1). This will display the full date either short or long in the user selected format. Only use a size parameter of custom two (2) when the program requires a specific date format. You should try to implement the user's preference where ever possible.

ExampleCString result;

CRicDate testdate;

testdate.Set("1994 2 7");

result = testdate.Display(); // result will be 2/7/1994

result = testdate.Display(1); // result will be Mon Feb 2, 1994

ConCentRICs for Windows RIC Corp Class Libraries Data Classes · 95

Page 106: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

result = testdate.Display(0, "MD"); // result will be 2/7

result = testdate.Display(1, "MMMMD"); // result will be February 2

result = testdate.Display(2, "ddd. mmm. d"); // result will be Mon. Feb. 2

CRicDate::DDint DD()

The DD function will return the numeric day of the date data.

CRicDate::LeapYearBOOL LeapYear(year)

int year; // The year to be checked

The LeapYear function will determine if the year that is passed to it is a leap year or not. The function will return TRUE if it is a leap year. It will return FALSE if it is not a leap year.

CRicDate::MaxMonthint MaxMonth(month, year)

int month; // Month in question

int year; // Year in question - Critical for month of February

The MaxMonth function will return the maximum valid day number of the month in question. The months April, June, September, and November will always return a value of 30. January, March, May, July, August, October and December will always return a value of 31. The month of February depends on the year parameter. Leap years are taken into account. A leap year will return a value of 29, else it will always return a value of 28 for February

CRicDate::MMint MM()

The MM function will return the month field in the date data.

CRicDate::Orderint Order()

The Order function will return the position of the date fields. The chart below shows the possible returned values.

Returned Value Field Positions

0 month day year

1 day month year

2 year month day

96 · Data Classes ConCentRICs for Windows RIC Corp Class Libraries

Page 107: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicDate::SetBOOL Set()

BOOL Set(month, day, year=0)

BOOL Set(&btrvdate)

BOOL Set(ctime)

BOOL Set(timet)

BOOL Set(strdate)

int month; // Month parameter of the date

int day; // Day parameter of the date

int year; // Year parameter of the date (optional)

BtrvDateRIC* btrvdate; // Pointer to a Btrieve date structure

CTime ctime; // Date from a C++ date/time function

time_t timet; // Date in a C++ date/time structure

CString strtime; // Date as a character string

Set is an overloaded function that will allow you to initialize the date from many different sources. This function supports every known date format.

Current DateUse the Set function with no parameters to load the current system date.

Return ValueThe return value is TRUE if the date was set. The return value will be FALSE if the input date was invalid in any way.

CommentsIf the date parameter used for this function is not a valid date, the function will return FALSE, and will set the date to a NULL date. A NULL date is no date at all. If you display a NULL date you will get no display at all. You can use this function to validate dates that are input by the user, by passing the inputted date to the Set function and then testing the result. When you use Set with a date in string format, it will use any non-numeric character to separate the date fields. A non-numeric character will be ignored except to indicate a new field. Each date field needs to be separated by some non-numeric character. If you use no date field separators then it must be in a set date format of YYYYMMDD, where you enter the full year, with month then year with leading zeros or spaces. You could enter Feb 7, 1994 as 19940207 or 1994 2 7 only. A character date with field separators must be in the order specified by the Windows control panel. If the user specifies month day year format then the string order must be in that same order. If the user specifies day month year format, then the string order must be in day month year order. If the program is loading a specific date then it should use the YYYYMMDD format, so the user order does not matter. The year is optional. If no year is entered the current year will be used automatically. If the year is less than 100 it will use the current century with the year entered.

ConCentRICs for Windows RIC Corp Class Libraries Data Classes · 97

Page 108: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

ExampleCRicDate workdate;

workdate.Set("2.7.1994");

CRicDate::SymbolCString Symbol()The Symbol function will return the character the user would like used to separate the month, day, and year fields of the date. In the United States this symbol is usually a slash (/), in Europe they may use a dot (.). The user can set the character they would like to use in their Window's control panel.

CRicDate::Valuevoid Value(&btrvdate)

BtrvDateRIC* btrvdate; // Pointer to Btrieve date format

The Value function will output the date in Btrieve format. This will be used to load the date in a Btrieve file.

Parametersbtrdate is a pointer to the Btrieve date structure to use for the date data

ExampleCRicDate workdate;

BtrvDateRIC loaddate;

workdate.Set("2.7.94");

workdate.Value(&loaddate);

CRicDate::YEARint YEAR()

The YEAR function will return the full year portion of the date data such as 1994. (Example : int year; year = workdate.YY();

CRicDate::YYint YY()

The YY function will return the year portion of the date data, such as 94 for 1994.

CRicDate::operator +=void operator+=(value)

int value // Number of days to add to date data

The += operator will allow you to add a specified number of days to the date data. If you add three days to the date of February 27, 1994 you would get March 2, 1994.

98 · Data Classes ConCentRICs for Windows RIC Corp Class Libraries

Page 109: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicDate testdate;

testdate.Set(2,27,1994);

testdate += 3;

CRicDate::operator -=void operator-=(value)

int value // Number of days to subtract from date data

The -= operator will allow you to subtract a specified number of days from the date data. If you subtract three days from the date of March 2, 1994 you would get February 27, 1994.

CRicDate testdate;

testdate.Set(3,2,1994);

testdate -= 3;

CRicDate::operator ++void operator++()

The ++ operator will allow you to add one day to the date data. If you use this function on the date of February 28, 1994 you would get March 1, 1994.

CRicDate testdate;

testdate.Set(2,28,1994);

++testdate;

CRicDate::operator --void operator--()

The -- operator will allow you to subtract one day to the date data. If you use this function on the date of March 1, 1994 you would get February 28, 1994.

CRicDate testdate;

testdate.Set(3,1,1994);

--testdate;

CRicDate::operator =void operator=(date)

CRicDate date // CRicDate variable with valid date data.

The = operator will allow you to set the date in the current variable to a date in another CRicDate variable.

CRicDate sourcedate, targetdate;

sourcedate.Set(2,27,1994);

targetdate = sourcedate;

ConCentRICs for Windows RIC Corp Class Libraries Data Classes · 99

Page 110: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicDate::operator -long operator-(date)

CRicDate date // CRicDate variable with valid date data.

The - operator will allow you to subtract one CRicDate variable from another, giving the number of days between the two dates. If you subtracted February 27, 1994 from March 2, 1994, you would get three days. This routine has been tested out to the year 3000.

CRicDate datea, dateb;

datea.Set(2,27,1994);

dateb.Set(3,2,1994);

int days = dateb - datea;

CRicDate::operator >BOOL operator>(date)

CRicDate date // CRicDate variable with valid date data.

The > operator will allow you to compare two CRicDate variables to see if one is greater than the other. The result will be TRUE, if one is greater and FALSE, if not.

CRicDate datea, dateb;

datea.Set(2,27,1994);

dateb.Set(3,2,1994);

if (datea > dateb); // The result of this if would be TRUE

CRicDate::operator >=BOOL operator>=(date)

CRicDate date // CRicDate variable with valid date data.

The >= operator will allow you to compare two CRicDate variables to see if one is greater than or equal to the other. The result will be TRUE, if one is greater and FALSE, if not.

CRicDate datea, dateb;

datea.Set(2,27,1994);

dateb.Set(3,2,1994);

if (datea >= dateb); // The result of this if would be TRUE

CRicDate::operator <BOOL operator<(date)

CRicDate date // CRicDate variable with valid date data.

The < operator will allow you to compare two CRicDate variables to see if one is less than the other. The result will be TRUE, if one is less and FALSE, if not.

CRicDate datea, dateb;

100 · Data Classes ConCentRICs for Windows RIC Corp Class Libraries

Page 111: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

datea.Set(2,27,1994);

dateb.Set(3,2,1994);

if (datea < dateb); // The result of this if would be FALSE

CRicDate::operator <=BOOL operator<=(date)

CRicDate date // CRicDate variable with valid date data.

The <= operator will allow you to compare two CRicDate variables to see if one is less than or equal to the other. The result will be TRUE if they are and FALSE if they are not.

CRicDate datea, dateb;

datea.Set(2,27,1994);

dateb.Set(3,2,1994);

if (datea <= dateb); // The result of this if would be FALSE

CRicDate::operator ==BOOL operator==(date)

CRicDate date // CRicDate variable with valid date data.

The == operator will allow you to compare two CRicDate variables to see if one is equal to the other. The result will be TRUE, if one is less and FALSE, if not.

CRicDate datea, dateb;

datea.Set(2,27,1994);

dateb.Set(3,2,1994);

if (datea == dateb); // The result of this if would be FALSE

CRicDate::operator !=BOOL operator!=(date)

CRicDate date // CRicDate variable with valid date data.

The != operator will allow you to compare two CRicDate variables to see if one is not equal to the other. The result will be TRUE if they are and FALSE, if not.

CRicDate datea, dateb;

datea.Set(2,27,1994);

dateb.Set(3,2,1994);

if (datea != dateb); // The result of this if would be TRUE

ConCentRICs for Windows RIC Corp Class Libraries Data Classes · 101

Page 112: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

class CRicName

IntroductionThe CRicName class is a data class used to represent name and address data. Any of your application classes may use this class. All of names and addresses in ConCentRICs are stored and accessed from a common file. This class will control the access and maintenance of the Name and Address data. You do not need to add any name and address routines in your application. You will use this class instead. The CRicName class is contained in a dynamic link library. You can use the library functions to use the name functions with out having to call the name functions directly.

Implementation - Library FunctionsNameInitRIC Performs the name Document init function

NameInquiryRIC Performs a name inquiry

NameMaintRIC Performs the name maintenance functions

NameMergeRIC Writes Name and Address data to a file

NamePrintRIC Formats Names and Addresses for Printing

NameSetInitRIC Performs the name Document initialization

NameUndoRIC Undos the last name maintenance activity

Implementation - Public MembersNameDialog Controls the Name and Address dialog box

NameDoc Constructs name and address data as one line

NameFind Gets a new or existing name and address key

NameFormat Formats a person's name or display

NameHook Name and Address maintenance within another dialog box

NameLabels Returns the labels or formats of all the fields

NameLink Controls the maintenance of a name link

NameLookup Finds a Name and Address record

NameMaint Name and Address Maintenance

NameParams Gathers the name and address user options

NameRecord Formats name and address for window display

NameSearch Allows user to enter name and address fields and categories for search purposes

NameSortIn Takes selected names and adds them to the document or sort, if appropriate

NameSortOut Sends sorted names to the document

Data Members - Public Membersm_Category Name and Address Category

102 · Data Classes ConCentRICs for Windows RIC Corp Class Libraries

Page 113: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

m_Doc Pointer to the document's CRicDoc class

m_Lines Formatted name and address record

m_NumFields The number of fields returned.

m_Seq Key to the Name and Address file

m_Title Title of the Name and Address operation

m_Username Name of the person

m_View Pointer to the view's CRicView class

NameInitRICCString NameInitRIC(doc, category=0);

CRicDoc* doc; The address of the document class

int category; Optional category number

This function will perform the init function for names in your application. The category number is optional. It will default to zero which indicates all name and address categories in the system. If you want to select a particular name and address category or an application area, then set the cateogory parameter to the number of that category or the application area such as IDS_AP_SECR1. This function will return the title of the category selected.

You would use this function in your application as follows:

CString title = NameInitRIC(GetDocPtr());

if (title == “”)

{

user.SetFileNumRIC(999);

return;

}

SetTitle(title);

user.LogputRIC(GetTitle());

doc.SetMaintLevelsRIC(2,2,2); // or whatever is appropriate

doc.SetModuleIdRIC(ID_NA); // or whatever is appropriate

NameInquiryRICBOOL NameInquiryRIC(doc, title, app=0, category=0);

CRicDoc* doc; // The address of the document class

CString title; // Title for the Dialog box

int app; // Optional Application specific

int category; // Optional Name and address category

The NameInquiryRIC function will allow you to easily add an Name and Address Inquiry to your application. The app field is optional. It will allow you to set it to your current appliation number. It will default to zero which indicates to allow the inquiry on all names in the data base. You set the application number by using

ConCentRICs for Windows RIC Corp Class Libraries Data Classes · 103

Page 114: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

IDS_AP_SECRx where x is the application number as it appears in Appendix A - RIC Corp Project Chart. Category is optional, and will allow you to narrow the search to a specific name and address category. It will default to zero to indicate all name and address categories, or you can set it to a specific category.

The following is an example for the Scheduling Client Inquiry Option:

void CSchdDoc::ClntInit()

{

CString title = LSRIC(IDS_AP_CLIENTINQ);

if (!NameInquiryRIC(GetDocPtr(), title, IDS_AP_SECR4))

{

user.SetFileNumRIC(999);

return;

}

SetTitle(title);

user.LogputRIC(GetTitle());

doc.SetMaintLevelsRIC(0, 2, 0);

doc.SetModuleIdRIC(ID_CLIENT);

}

CRicName::m_TitleCString m_TitleThe Name and Address maintenance functions could be called from any application for a wide variety of reasons. You have the option to place a title on the Name and Address maintenance screen, by placing a title in this data member. If this item has no value, then the words Name and Address Maintenance will be used.

CRicName::m_UsernameCString m_UsernameAfter a Name and Address maintenance activity, this data item will contain the name of the person that maintenance was performed on. If your application displays the name of the person, after maintenance is performed, you should refresh your name display with the value in this data member, since their name could have been changed in the maintenance activity.

CRicName::m_ViewCRicView* m_ViewThis variable will contain a pointer to the view's CRicView class.

CRicName::NameDialogBOOL NameDialog(maint);

104 · Data Classes ConCentRICs for Windows RIC Corp Class Libraries

Page 115: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

MaintBlockRIC* maint; // Pointer to the maintenance block

The NameDialog function will control the Name and Address dialog box, just as a normal dialog function would do in your document. You should not use this function directly in your application. You should use the library function of NameMaintRIC.

CRicName::NameDocCString NameDoc(nakey params, level);

CString NameDoc(fileptr, params, level);

long nakey; // Key to a Name and Address record

CString params; // User name and address selections

cNAMEADDR* fileptr; // Pointer to pre-opened name and address file

int level; // How much data to return

The NameDoc function will format the data of a single name into one CString item. Each of the fields will be separated by a tab (\t). The params parameter is the user's name and address format options. You obtain this field with the NameParams function. You can pass a name and address key to the function, or if you already have a name and address record, you can just pass the file pointer. You may parse the returned CString to obtain any field in particular with the ParseStrRIC command.

The level will indicate how many fields to return. Level 0 will return the first 17 fields. Level 1 will include the first 19 fields which includes the Cell and Home phone numbers. Level 2 includes the E-Mail Address, Level 3 includes the Website Address, Level 4 the Notes and Level 9 will include all the auxilary fields.The variable m_NumFields will be set to the total number of fields returned. The chart below will show which parameter contains which field:

Field Description

1 Name Key

2 Last Name

3 Company Name

4 First Name

5 Name Prefix

6 Person's Title

7 Address Line 1

8 Address Line 2

9 Address Line 3

10 City

11 State / Province

12 Zip or Postal Code

13 Country

14 Phone Number

15 Fax Number

16 Alternate Phone Number

ConCentRICs for Windows RIC Corp Class Libraries Data Classes · 105

Page 116: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

17 Formatted name in User's format

18 Cell Number

19 Home Phone Number

20 E-Mail Address

21 Website Address

22 Notes

23 + All other names fields

CRicName::NameFindlong NameFind(maint, delmode=TRUE, maintswt=FALSE, addmode=TRUE,

application=0)

MaintBlockRIC* maint; // Pointer to the maintenance block

BOOL delmode; // Indicates if delete is allowed

BOOL maintswt; // Indicates if in maintenance mode

BOOL addmode; // Indicates if a name can be added

int application; // Indicates an optional application number

The NameFind function will locate an existing name in the name and address database. If the addmode parameter is set to TRUE then a name can be added if not found. This is the default setting. You should set this to TRUE unless you are in inquiry mode. The maint parameter should be set to TRUE if you are in a name and address maintenance option. If you are calling this function from another dialog box, then you should set this parameter to FALSE, so the document is not updated with the new name and address information. Set the delmode to TRUE or FALSE depending on if you want the delete mode active in the Name and Address Maintenance dialog box. The Name and Address dialog box will be brought up whenever a name is selected unless the addmode is FALSE. If the first three parameters are all set to FALSE, then only one name can be found. This will set a special control in the names that will display the links associated with the name when it is displayed. The application parameter is optional. It will default to zero (0). If it is set to zero (0) then all names in the database will be used for the search.You can set this parameter to an application number by setting it equal to IDS_AP_SECRx where the x is the application number as it appears in Appendix A - RIC Corp Project Chart. When this parameter has a non-zero value then only the names linked to that application will be used in the search.

In order to restrict the search to a particular category of names, then set the “type” field in the MaintBlockRIC to the number of the category, or application number with IDS_AP_SECRx. Set the type to -1 for a full search. You can set the mode to a –11 to force a name search by default or –12 to force a company name search by default.

The name key is only returned by this function for Inquiry functions. When the Add or Maintenance functions are used then the name key is returned in the name.m_Seq field.

ExampleMaintBlockRIC maint;

106 · Data Classes ConCentRICs for Windows RIC Corp Class Libraries

Page 117: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

maint.type = (int) IDS_AP_SECR1; // Set to -1 for all names

maint.recnum = -1;

maint.data = "";

maint.mode = 1; // -11=Name Search or –12=Company Search

maint.dir = name.NameParams();

sprintf(name.m_Title, “%s”, <title>);

long nakey = name.NameFind(&maint, FALSE, FALSE, FALSE);

if (nakey < 1) <cancel mode>

if (nakey == 0) nakey = name.m_Seq;

In the above example only names attached to System Administration (System Users) will be selected for the search, but this can be turned off by the user. The selected name and address key will be placed in the field nakey. The nakey will be minus one (-1) if the search was cancelled.

CRicName::NameFormatvoid NameFormat(data, params, prnt=TRUE);

CString data; // Name and address data

CString params; // User name and address options

BOOL prnt; // Indicates if print or window

This NameFormat function will create one or more lines of a formatted name and address record. The formatted lines will be placed in the m_Lines variable. It will take the user specified format requirements and will make the appropriate number of m_Line entries for the name. The data parameter comes from the NameDoc function, the params comes from the NameParams option. You set the prnt parameter to TRUE if the name is to be printed, or FALSE to display in a window.

Very Important Point:

This function formats the lines into a CStringList variable that is referenced in the CRicName header file. The CStringList variable is only a pointer though. You need to define a CStringList and point it to the Name class before you call this function. If you do not, then the program will get an application error and will abort.

CStringList namelines;

CRicName name;

name.m_Lines = &namelines;

CRicName::NameHookvoid NameHook(key);

CString key; // Key to the Name and Address file

The NameHook function will allow you to perform Name and Address maintenance from another maintenance function. You could be working with another dialog box, that needs to maintain Name and Address information. You would normally have a button on your dialog box to update the name information.

ConCentRICs for Windows RIC Corp Class Libraries Data Classes · 107

Page 118: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

When this button is pressed you would call this function. Pass whatever key you have for the person.

void CUserDlg::OnClickedNameBut()

{

CRicName name;

name.m_Category = 1;

name.m_Title = LSRIC(IDS_AP_USER);

name.NameHook(m_NameKey);

if (m_NameKey == "" && name.m_Seq >= 0)

{

m_Username = name.m_Username;

m_Seq = name.m_Seq;

char str[80];

sprintf(str, "%ld", name.m_Seq);

m_NameKey = str;

}

SetDlgItemText(IDC_DB_NAME, m_Username);

}

CRicName::NameLabelsvoid NameLabels(level);

int level; // How may labels or formats will be returned

The NameLabel function will return either the labels of all the name fields or the format of all the fields. The labels or formats will match the fields returned by the NameDoc() function. You should use the same level number here that you do on the NameDoc() function. This function returns a single string with each field separated by a tab character. The m_NumFields variable is set with the number of fields returned.

The level will indicate how many fields to return. Level 0 will return the first 17 fields. Level 1 will include the first 19 fields which includes the Cell and Home phone numbers. Level 2 includes the E-Mail Address, Level 3 includes the Website Address, Level 4 the Notes and Level 9 will include all the auxilary fields.The variable m_NumFields will be set to the total number of fields returned.

If you use a negative level number then the format for the each of the fields will be returned. The number of the level has the same meaning, but when it is turned into a negative the format for the fields are returned instead. Each field is separted by a tab character and each format characteristic is separated by commas. The format characteristics returned are as follows:

1) Field Type

2) Size

3) Decimal Places

4) Alignment

108 · Data Classes ConCentRICs for Windows RIC Corp Class Libraries

Page 119: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

5) Total Switch

6) System

7) Table

The field types used are as follows:

30191 = Number Field

30192 = Amunt Field

30193 = Yes/No Field

30194 = Date Field

30195 = Text Field

32101 = Table Field

32102 = Name Field

CRicName::NameLinkvoid NameLink(key, category, reference, orgnum, addmode);

long key; // Key to the name being referenced

long category; // Application Number to be referenced

long reference; // The reference number in the application

long orgnum; // Organization number that generated the link

BOOL addmode; // Indicates if the link is added or deleted

The NameLink function will control all file maintenance involved in linking a name to an application system. The key parameter must be a valid name and address reference number. The category parameter will be set to IDS_AP_SECRx where x is the application number that appears in Appendix A - RIC Corp Project Chart. The reference parameter will be the key value from the application. In System Administration it would be their user number. In Scheduling Administration this would be an event id. The orgnum parameter is the organization number that generated the link. This value can be obtained with the following command user.OrgNumRIC(). If the addmode parameter is set to TRUE then the link will be added. If it is set to FALSE then the link will be deleted. No error will occur if the link is already there when you add one, or has already been deleted if you delete one.

CRicName::NameLookupCString NameLookup(fileptr, key, format=0);

CString NameLookup(nakey, format=0);

cNAMEADDR* fileptr; // Pointer to a Name and Address file

long nakey; // Key to a Name and Address record

int format; // Format of the output name

The NameLookup function will return the actual name for any person. The file must be opened before this routine can be used. There is an option to include the key or not. If the key is present then the record will be found for that key before the record is formatted. If there is no key parameter, the current record will be

ConCentRICs for Windows RIC Corp Class Libraries Data Classes · 109

Page 120: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

formatted. The format parameter determines how the name will be output. The chart below shows the possible values for the format parameter.

Format Result Example

0 (Default) first name last name John Doe

1 first name last name, title John E. Doe, President

2 last name, first name Doe, John E.

3 last name, first name, title Doe, John E. President

4 prefix, first name, last name Mr John E. Doe

5 prefix, first name, last name, title Mr John E. Doe President

6 person’s name, if blank, company John E. Doe

7 company, if blank, person’s name ABC Corporation

8 Company Name ABC Corporation

9 City, State Zip Country Ft Wayne, IN 46804 USA

10 Person’s Initials JED

CRicName name;

CString username = name.NameLookup(userfile->GetNAMEKEY(), 0);

CRicName::NameMaintBOOL NameMaint(fileptr, maint);

cNAMEADDR* fileptr; // Pointer to the Name and Address file

MaintBlockRIC maint; // The record buffer before update

The NameMaint function will perform all file maintenance activity to the file as it was indicated by the dialog box. Your application should not call this function directly, but you should use the NameMaintRIC function instead.

CRicName::NameParams()CString NameParams();

The NameParams option will create one CString parameter will all of the user name and address formatting specifications. Each field the user can set for names and addresses is placed in this field. You may parse the field with the ParseStrRIC command to obtain any of the parameters in particular. The chart below will show where each field is located.

Field Description

1 Who format 0 = Name and Company, 1 = Company and Name, 2 = Name or Company, 3 = Company or Name

2 Show Address 0 = No, 1 = Yes

3 Show Phone Number 0 = No, 1 = Yes

4 Show Fax Number 0 = No, 1 = Yes

5 Show Alternate phone number 0 = No, 1 = Yes

110 · Data Classes ConCentRICs for Windows RIC Corp Class Libraries

Page 121: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

6 Format of Person's name 0 = First Last, 1 = Last First

7 Name Sort 0 = None, 1 = Who, 2 = Zip

8 Show name prefix 0 = No, 1 = Yes

9 Show title 0 = No, 1 = Yes

10 Format of printed name and address 0 = As Displayed, 1 = Name List 2 = Envelope, 3 = Mailing Labels, 4 = Phone List, 5 = Address Book, 6 = Merge data file

11 Phone List format 0 = Phone, 1 = Fax, 2 = Alternate, 3 = All

12 Envelope Position across in inches

13 Envelope Position down in inches

14 Number of Mailing Labels across

15 Number of Mailing Labels down

16 Size of Mailing Label across in inches

17 Size of Mailing Label down in inches

18 Position of first Mailing label across in inches

19 Position of first Mailing label across in inches

20 Name size (maximum size of name in Who Format)

21 WWW E-Mail Address Lock 0 = Unlocked 1 = Locked by E-Mail

CRicName::NameRecordint NameRecord(fileptr, maint);

cNAMEADDR fileptr; // Pointer to a pre-opened name record

MaintBlockRIC maint; // Pointer to the maintenance data block

The NameRecord function will write the existing name record to the disp variable in the MaintBlockRIC structure. The file must be opened and the name and address record to be sent to the function must be pre-selected. You must declare a MaintBlockRIC variable before calling this function. You may set that structure to the following values:

type = -1;

recnum = -1;

data = “”;

mode = 1;

dir = name.NameParams();

You may then use the SetDocRIC function to display the resulting lines.

CRicName::NameSearchBOOL NameSearch(fileptr, stringptr);

cNAMEADDR fileptr; // Pointer to a pre-opened name file

CString* stringptr; // Pointer to a string to hold categories

The NameSearch function will bring up the Name and Address dialog box. The user will be able to enter any of the Name and Address fields, and/or select any of the name and address categories. The results of the entry will be returned in the

ConCentRICs for Windows RIC Corp Class Libraries Data Classes · 111

Page 122: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

record pointed to by fileptr and the categories will be placed in the CString pointed to by stringptr. These fields can then be used to search the name and address file. The Name and Address file must be open before calling this function. If either of the pointers have any data, it will be displayed. If you want the Dialog Box to display no entries you should clear the name and address record with the command nameaddr.ClearRec(); and clear the categories with categories.Empty() command. This function will return TRUE if the user has made a selection or FALSE if user hit the CANCEL button.

CRicName::NameSortInvoid NameSortIn(fileptr, sortptr, maint);

cNAMEADDR* fileptr; // Pointer to pre-opened name record

CRicSort* sortptr; // Pointer to a CRicSort class

MaintBlockRIC maint; // Pointer to the maintenance data block

The NameSortIn function will take a name record and pass it to the MaintBlockRIC structure if no sort is indicated, or will pass it to the sort class if it is to be sorted. The name and address file must be open, and the desired record must be selected. You must declare a CRicSort object, and pass the pointer to this function. You must declare a MaintBlockRIC variable before calling this function. You may set that structure to the following values:

type = -1;

recnum = -1;

data = “”;

mode = 1;

dir = name.NameParams();

CRicName::NameSortOutvoid NameSortOut(fileptr, sortptr, maint);

cNAMEADDR* fileptr; // Pointer to pre-opened name record

CRicSort* sortptr; // Pointer to a CRicSort class

MaintBlockRIC maint; // Pointer to the maintenance data block

The NameSortOut function will take the sorted names and pass it to the document class of the application. The name and address file must be open, but no record needs to be selected. You must have a CRicSort object previously declared and have the appropriate name and address records places in it, usually with the NameSortIn function. You need to pass the pointer of the CRicSort object to this function. The maint parameter should be the same one used for the NameSortIn function. You may then use the SetDocRIC function to display the resulting lines.

After using this function the outputted names are in the CStringList member of the MaintBlockRIC structure. You can use the names directly from the MaintBlockRIC structure. If you want to just output the results you can use the SetDocRIC function. Don’t forget to skip the output if the user has selected output to file. The following example will demonstrate how to handle that.

CRicName name;

CRicSort sort;

112 · Data Classes ConCentRICs for Windows RIC Corp Class Libraries

Page 123: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

MaintBlockRIC maint;

cNAMEADDR nameaddr;

CString parms = name.NameParams();

nameaddr.JustOpen(user.RootDirRIC() + “NAMEADDR.SYS”);

ret = nameaddr.GetFirst();

while (ret == 0)

{

name.NameSortIn(&nameaddr, &sort, &maint);

ret = nameaddr.GetNext();

}

if (ParseStrRIC(7, params) != 0)

{

name.NameSortOut(&nameaddr, &sort, &maint);

SetDocRIC(GetDocPtr(), &maint);

}

class CRicNum

IntroductionThe CRicNum class is a data class used to represent numeric data. This includes money. It provides a variety of functions to store, display and retrieve numeric information. The routine will allow you to store numbers from many different sources and will give you great control of the display of that numeric information.

Money data is just a subset of the CRicNum class. You initialize, store, and retrieve money data the same way you would any other numeric data. The only difference is how you would display it. Numbers would be displayed with the Display command and money would be displayed with the Money command.

Some countries may display numbers and money in different ways. The users can set how they want numbers and money to be displayed in the Windows Control Panel option. This class will access that information to display both numbers and money.

Construction - Public MembersSet Assigns a new numeric value

Extraction - Public MembersDecimals Returns number of decimal places in the number

DecimalPoint Returns the character used for a decimal place

Display Used to output the number in different formats

Money Used to output the number in a money format

ConCentRICs for Windows RIC Corp Class Libraries Data Classes · 113

Page 124: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

Separator Returns the character to separate thousands

Size Returns the minimum number of columns required to display the entire number

Symbol Returns the character used to represent money ($)

Value Returns the number as a numeric variable

Operators - Public Members++ Increment the number by 1

-- Decrement the number by 1

* Multiply the number with another number

/ Divide the number with another number

+ Add the number with another number

- Subtract the number with another number

*= Multiply the number by another number

/= Divide the number by another number

+= Add the number by another number

-= Subtract the number by another number

> Compare number greater than another number

>= Compare number greater than or equal to

< Compare number less than another number

<= Compare number less than or equal to another

== Compare if two number are equal

!= Compare if two number are not equal

CRicNum::Decimalsint Decimals()

The Decimals function will return the number of decimal places in the number.

CRicNum::DecimalPointCString DecimalPoint()

The DecimalPoint function will return the character used to represent a decimal point.

CRicNum::DisplayCString Display(size=0, decimals=-2)

int size; // Maximum number of columns to display the number in

int decimals; // Number of decimal positions

114 · Data Classes ConCentRICs for Windows RIC Corp Class Libraries

Page 125: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

The Display function will take the numeric data and put it in a CString variable with the size and number of decimal places you indicate. You can use this string in your application to display the numeric data to the user.

Parameterssize indicates the maximum number of characters to use to display the number. The number will be right justified within the characters. The thousands will be separated by the appropriate character such as a comma (,). If the size you indicate will not hold the entire number, the thousands separators will be eliminated first. If the numbers still does not fit, then the decimal positions will be truncated. If the number still does not fit in the size then asterisks (*) will be displayed for the number. This parameter is optional. If you do not indicate a size or have a size less than 1 then the result will only use the minimum number of characters required to display the entire number.

Decimals indicates the number of decimal positions to be displayed. You may also set the number of decimals to specific negative numbers to indicate special decimal handling as illustrated in the chart below.

Decimal Value Result

-1 Number of decimal places the number has

-2 Number of decimal places for money as indicated by user

The default value is minus 1 (-1).

Return ValueThe return value is the formatted number in a CString variable.

CommentsWhen you display a number with standard C++ routines, there is no punctuation. You may use this method if that is the desired result. Normally you would want to separate the thousands with a symbol such as a comma (,), you would want the number to fit in a specific size to display in a report column, and want it to be right justified, so that all of the numbers in the column will line up properly. This function will do all of that automatically. If you are displaying the number as money, you should use the Money function instead of this one.

ExampleCString result;

CRicNum testnum;

testnum.Set(9876543.21);

result = numtime.Display(); // result will be 9,876,543.21

result = testtime.Display(9); // result will be 9876543.2

result = testtime.Display(11); // result will be 9876,543.21

result = testtime.Display(6); // result will be *********

ConCentRICs for Windows RIC Corp Class Libraries Data Classes · 115

Page 126: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicNum::MoneyCString Money(size=0, decimals=-1)

int size; // Maximum number of columns to display the number in

int decimals; // Number of decimal positions

The Money function is identical to the Display function only it will add extra punctuation to the display. Money display's will begin with a special character such as a dollar sign ($) to indicate a money value. The user can set any symbol they want to use for money in the Window's control panel. The Money function will place this character in the correct position of the number, as indicated by the user. Negative money can have a unique display as well.

Parameterssize indicates the maximum number of characters to use to display the money number. The number will be right justified within the characters. The thousands will be separated by the appropriate character such as a comma (,). If the size you indicate will not hold the entire number, the thousands separators will be eliminated first. If the numbers still does not fit, then the decimal positions will be truncated. If the number still does not fit in the size, then asterisks (*) will be displayed for the number. This parameter is optional. If you do not indicate a size or have a size less than 1, then the result will only use the minimum number of characters required to display the entire number.

Decimals indicates the number of decimal positions to be displayed. You may also set the number of decimals to specific negative numbers to indicate special decimal handling as illustrated in the chart below.

Decimal Value Result

-1 Number of decimal places the money value actually has

-2 Number of decimal places for money as indicated by user

The default value is minus 2 (-2).

Return ValueThe return value is the formatted number in a CString variable.

CommentsWhen you display a number with standard C++ routines, there is no punctuation. You may use this method if, that is the desired result. Normally you would want to separate the thousands with a symbol such as a comma (,) or if you would want the number to fit in a specific size to display in a report column, it should be right justified, so that all of the numbers in the column will line up properly. Money in particular, starts with a special symbol such as a dollar sign ($) to indicate a money value. Negative money can be displayed in many different ways depending on the country. The user sets this preference in their Windows Control Panel option. This function will set the punctuation for the money values automatically. This function should only be used for Money values. If the value is not money then use the Display function.

116 · Data Classes ConCentRICs for Windows RIC Corp Class Libraries

Page 127: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

ExampleCString result;

CRicNum testnum;

testnum.Set(9876543.21);

result = numtime.Money(); // result will be $9,876,543.21

result = testtime.Money(8); // result will be $9876543

result = testtime.Money(12); // result will be $9876,543.21

result = testtime.Money(7); // result will be $*********

CRicNum::SeparatorCString Separator()

The Separator function will return the character used to separate the thousands in the number. This is set by the user in the Window's Control Panel

CRicNum::SetBOOL Set()

BOOL Set(ldnum)

BOOL Set(double)

BOOL Set(fnum)

BOOL Set(dwnum)

BOOL Set(lnum)

BOOL Set(unum)

BOOL Set(inum)

BOOL Set(numstr)

long double ldnum; // Number in long double format

double dnum; // Number in double format

float fnum; // Number in float format

DWORD dwnum; // Number in double word format

long lnum; // Number in long format

UINT unum; // Number in unsigned integer format

int inum; // Number in an integer format

CString strnum; // Number as a character string

Set is an overloaded function that will allow you to initialize the number from many different numeric data types. You should be able to load the CRicNum variable from any type of number you are working with in your application.

Return ValueThe return value is TRUE if the number was set. The return value will be FALSE if the inputted number was invalid in any way.

ConCentRICs for Windows RIC Corp Class Libraries Data Classes · 117

Page 128: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CommentsIf you are setting the number from a text string, then only numeric characters will be used from the string, any non-numeric character, other than the decimal place symbol will be ignored.

ExampleCRicNum worknum;

worknum.Set("123456.78");

CRicNum::SizeInt Size()

The Size function will return the minimum number of characters required to display the entire number.

CRicNum::SymbolCString Symbol()The Symbol function will return the character the user would like used to represent the money value such as a dollar sign ($).

CRicNum::Valuelong double Value();

The Value function will return the numeric data as a numeric variable, so the number can be used in math functions. You can use the result in any mathematics equation.

long double result;

CRicNum numa, numb;

numa.Set(56);

numb.Set("44");

result = numa.Value() + numb.Value(); // Result is equal to 100

CRicNum::operator++void operator++()

The ++ operator will allow you to increment the number by 1. This has the same effect as adding one (1) to the number.

CRicNum::operator--void operator--()The -- operator will allow you to decrement the number by 1. This has the same effect as subtracting one (1) from the number.

118 · Data Classes ConCentRICs for Windows RIC Corp Class Libraries

Page 129: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicNum::operator*CRicNum operator*(ricnum)

CRicNum operator*(number)

CRicNum ricnum; // Number to multiply

long double number; // Number to multiply

The * operator will allow you to multiply the number with another number. The parameter on the right will be multiplied with this number, and the result will be the return value. Nither this number or the parameter number will have it's value changed.

CRicNum::operator/CRicNum operator/(ricnum)

CRicNum operator/(number)

CRicNum ricnum; // Number to divide

long double number; // Number to divide

The / operator will allow you to divide the number with another number. The parameter on the right will be divided with this number, and the result will be the return value. Nither this number or the parameter number will have it's value changed.

CRicNum::operator+CRicNum operator+(ricnum)

CRicNum operator+(number)

CRicNum ricnum; // Number to add

long double number; // Number to add

The + operator will allow you to add the number with another number. The parameter on the right will be added with this number, and the result will be the return value. Nither this number or the parameter number will have it's value changed.

CRicNum::operator-CRicNum operator-(ricnum)

CRicNum operator-(number)

CRicNum ricnum; // Number to subtract

long double number; // Number to subtract

The - operator will allow you to subtract the number with another number. The parameter on the right will be subtracted with this number, and the result will be the return value. Nither this number or the parameter number will have it's value changed.

ConCentRICs for Windows RIC Corp Class Libraries Data Classes · 119

Page 130: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicNum::operator=void operator=(ricnum)

void operator=(number)

CRicNum ricnum; // Number that contains new value

long double number; // Number that contains new value

The = operator will allow you to set the number equal to another number. The parameter on the right will be used for the new value of this number. The parameter number will not have it's value changed.

CRicNum::operator*=void operator*=(ricnum)

CRicNum operator*=(number)

CRicNum ricnum; // Number to multiply

long double number; // Number to multiply

The *= operator will allow you to multiply the number by another number. The parameter on the right will be multiplied with this number, and the result will replace the current value of this number. The parameter number will not have it's value changed.

CRicNum::operator/=void operator/=(ricnum)

CRicNum operator/=(number)

CRicNum ricnum; // Number to divide

long double number; // Number to divide

The /= operator will allow you to divde the number by another number. The parameter on the right will be divided with this number, and the result will replace the current value of this number. The parameter number will not have it's value changed.

CRicNum::operator+=void operator+=(ricnum)

CRicNum operator+=(number)

CRicNum ricnum; // Number to add

long double number; // Number to add

The += operator will allow you to add the number by another number. The parameter on the right will be added with this number, and the result will replace the current value of this number. The parameter number will not have it's value changed.

CRicNum::operator-=void operator-=(ricnum)

120 · Data Classes ConCentRICs for Windows RIC Corp Class Libraries

Page 131: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicNum operator-=(number)

CRicNum ricnum; // Number to subtract

long double number; // Number to subtract

The -= operator will allow you to subtract the number by another number. The parameter on the right will be subtracted with this number, and the result will replace the current value of this number. The parameter number will not have it's value changed.

CRicNum::operator>BOOL operator>(ricnum)

CRicNum operator>(number)

CRicNum ricnum; // Number to compare

long double number; // Number to compare

The > operator will allow you to compare the number with another number. If this number is greater than the parameter on the right than the result will be TRUE, if it is not the result will be FALSE.

CRicNum::operator>=BOOL operator>=(ricnum)

CRicNum operator>=(number)

CRicNum ricnum; // Number to compare

long double number; // Number to compare

The >= operator will allow you to compare the number with another number. If this number is greater than or equal to the parameter on the right than the result will be TRUE, if it is not the result will be FALSE.

CRicNum::operator<BOOL operator<(ricnum)

CRicNum operator<(number)

CRicNum ricnum; // Number to compare

long double number; // Number to compare

The < operator will allow you to compare the number with another number. If this number is less than the parameter on the right than the result will be TRUE, if it is not the result will be FALSE.

CRicNum::operator<=BOOL operator<=(ricnum)

CRicNum operator<=(number)

CRicNum ricnum; // Number to compare

long double number; // Number to compare

ConCentRICs for Windows RIC Corp Class Libraries Data Classes · 121

Page 132: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

The <= operator will allow you to compare the number with another number. If this number is less than or equal to the parameter on the right than the result will be TRUE, if it is not the result will be FALSE.

CRicNum::operator==BOOL operator==(ricnum)

CRicNum operator==(number)

CRicNum ricnum; // Number to compare

long double number; // Number to compare

The == operator will allow you to compare the number with another number. If this number is equal to the parameter on the right than the result will be TRUE, if it is not equal the result will be FALSE.

CRicNum::operator!=BOOL operator!=(ricnum)

CRicNum operator!=(number)

CRicNum ricnum; // Number to compare

long double number; // Number to compare

The != operator will allow you to compare the number with another number. If this number is not equal to the parameter on the right than the result will be TRUE, if it is equal the result will be FALSE.

class CRicSort

IntroductionThe CRicSort class is a data class used to sort your data into ascending or descending order. There is no sort available through C++ or with Btrieve. A sort class had to be created to accomplish the sorting of the data. This is not a “true” class but a group of functions that act as a class. This allows the sort and data to be placed in the common Dynamic Link Library and used by all functions without taking space in the application’s executable file.

There are functions provided to add data to the sort class and to get data from the sort class, but you may notice that there is no function to actually sort the data. This is due to the fact that there is no sort in the sort class. The sort is actually an ordered list. This means that the data is placed in the sorted position when it is added to the sort class.

The sort class uses a binary search to place the data. It will start in the middle of the list, and keep dividing the data in half until the correct position is found. This will make sure that the ordered list is not searched more than 20 times before the correct location is found, no matter how many records are in the sort. There is no limit to the sort size, the only limit is the amount of memory available for the sort. Larger files should not take any longer than smaller files. The only difference in time will be the time it takes to put your data in the sort class.

122 · Data Classes ConCentRICs for Windows RIC Corp Class Libraries

Page 133: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

The only difference between the ascending and descending sort is the order it is retrieved from the ordered list. The list is always in ascending order. If you ask for an ascending sort, it will retrieve the records from the beginning of the list first. If you ask for a descending sort, they will be retrieved from the end of the list first.

The sort using a structure that you have access to in your programs by putting the name of the CRicSort variable and a dot or -> and the name of the field:

struct CRicSort

{

CStringList SortData; // String Array to sort

BOOL SortAscend; // True=Ascending False=Descending

POSITION SortPos; // Position of current sort loop

}

Performing a SortWhen you are ready to use the sort, you must first declare the sort data area with the following command:

CRicSort sort; // where sort is the name of the variaable and can be anything

When you use any of the sort functions you then pass the sort data area you created as an address. In order to use the sort you build a string to pass to the sort. The first field in the string should be the first field you want to sort on. Each field that you want to sort on should follow that. Each sort field should be separated by a tab (\t) character. After the last sort field place a line feed character (\n). This will easily separate the sort fields from the data.

You then format the data section. You have two choices at this point. You could simply just place the key of the record in the data section, and then use the key to find the file again. You could format the entire output line and place it in the data section. That is why we use the line feed character (\n) to separate the sort fields from the data. This makes is very easy to separate the two after the sort.

Certain types of data fields needs special formatting when you use them as sort fields. If you do not use the specified format then the field will not sort properly. Each of these fields types is discussed below

Numeric FieldsIf you are sorting numeric fields, then make sure you right justify the number or it will not sort correctly. You can do this easily in your format statement for the string. If you have a maximum 8 digit number then instead of using the format %d use the format %8d. This hold true for all types of numerics long use %12ld instead of %ld, or float %16f instead of %f, etc.

Date FieldsDate fields must be displayed with year first, then month, then day in order to sort properly. In the format string use %s then for the date display use: date.Display(3).

Time FieldsTime fields must be displayed in the 24 hour clock to allow them to sort properly. In the format string use %s then for the time display use: time.Display(0,1) for hour

ConCentRICs for Windows RIC Corp Class Libraries Data Classes · 123

Page 134: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

and minute sort, time.Display(1,1) for hours, minutes, and seconds, or time.Display(2,1) for hours, minutes, seconds, and hundreds of seconds.

Sort ExampleThis example will sort the name and address file by company name.

int i, ret;

long seq;

char str[80];

CString data;

CRicSort sort;

cNAMEADDR nameaddr;

nameaddr.JustOpen(user.RootDirRIC() + "NAMEADDR.SYS");

ret = nameaddr.GetFirst();

while (ret == 0)

{

sprintf(str, "%s\n%ld", nameaddr.GetAddrCOMPANY()

nameaddr.GetSEQ());

SortAddRIC(&sort, str);

nameaddr.GetNext();

}

SortSetStreamRIC(&sort);

while (SortStreamRIC(&sort, &data))

{

seq = (long) CharToFloatRIC(ParseStrRIC(2, data, ‘\n’));

nameaddr.GetEqualOnSEQ(seq, 0);

< application logic to process sorted record >

}

Sort FunctionsSortAddRIC Adds records to the sort

SortGetRIC Retrieves records from the sort

SortResetRIC Empties the sort class of data

SortSetStreamRIC Initializes a sort loop

SortSizeRIC Returns number of records in the sort class

SortStreamRIC Performs a sort loop

SortAddRICvoid SortAddRIC(sort, data);

124 · Data Classes ConCentRICs for Windows RIC Corp Class Libraries

Page 135: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicSort* sort; // Address of the sort data

CString data; // data string to be sorted

The SortAddRIC function will add a data string to the sort class to be sorted. You will need to format a CString variable with the fields you would like sorted from your file. You can have any number of fields in the sort string. It is recommended that you separate each field with a tab (\t), and that you make the key field(s) of the file the last fields in the sort string.

SortGetRICCString SortGetRIC(sort, recnum, ascending=TRUE);

CRicSort* sort; // Address of the sort data

int recnum; // The sorted position to retrieve

BOOL ascending; // The sort direction

The SortGetRIC function will retrieve a sorted record. You will ask it to retrieve a particular record number and the sorted string will be returned. You will need to parse the string with the ParseStrRIC function to retrieve the file key from the sort record. You will then find that record in your file and use that record in your processing. The Sort direction switch is optional. It will default to TRUE which indicates an ascending (normal) sort. If you want a descending sort then put FALSE in this parameter. The first record number is always zero.

SortResetRICvoid SortResetRIC(sort);

CRicSort* sort; // Address of the sort data

The SortResetRIC function will initialize the sort class. It will remove all records from the sort class, so you can add different sort records to it. If you are sorting more than one file, or sorting a file more than one way, you must use this function before you add more data to the class. If you don't reset it, the new data will be added to the data that already exists in the class. This function will not effect the ascending or descending direction of the sort. The sort direction will remain at it's previous setting. This function does need to be used the first time the sort class is used. You only use it if you want to use the sort class more than once.

SortSetStreamRICvoid SortSetStreamRIC(sort, ascend=TRUE);

CRicSort* sort; // Address of the sort data

BOOL ascending; // The sort direction

The SortSetStreamRIC function must be called before using the Sort Loop command of SortStreamRIC. This will initialize the sort and set the direction of the sort. You pass the address of the sort variable in the sort parameter. You would only set the direction if you want it to be decending and then you would set it to FALSE in that case.

SortSizeRICint SortSizeRIC(sort);

CRicSort* sort; // Address of the sort data

ConCentRICs for Windows RIC Corp Class Libraries Data Classes · 125

Page 136: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

The SortSizeRIC function will return the number or records in the sort class. You will use this number to retrieve the records from the sort class.

SortSetStreamRICBOOL SortStreamRIC(sort, data);

CRicSort* sort; // Address of the sort data

CString data; // The variable you want a sort record placed in

The SortStreamRIC function will perform a sort loop. It will take a single record on each pass and place it in the data variable. You must call the SortSetStreamRIC command before using this command to initialize the sort and to set it’s direction. This function will return TRUE if a record was returned or will return FALSE after the last record has been passed by the loop.

CRicText

IntroductionThe CRicText class is a data class used to control free form text data. It provides a variety of functions to manipulate the text from the file to the dialog box or strings, from the dialog box or strings to the file, and from strings to your CRicDoc class.

This implements the concept of floating text. This allows the user to enter text as long as they like. It does not matter how big the field is on the data file. It does not matter how big the area in the dialog box is, or how big the output will be. The system will let the user enter any amount of text. The system will write as much as it can to one record, and then the next record until all data has been stored. The system can also put it back together to redisplay in the dialog box again. When it is time to output this data, you just tell this class how wide an area you have. It will then restrict the lines to no more than that many characters and it will not allow a word to break on a line, unless the word is bigger than the line allows, and it will put as much as it can on the first line, and will put the rest on the next line.

If you are building your own text lines to be used by CRicText it is important to know that the only special characters that it looks at is a carriage return/line feed combination (\r\n) to indicate a new line.

ImplementationDataboxToTable CEdit dialog box text to CStringList

DataboxToFile CEdit dialog box text to cNATEXT file

FileOutput cNATEXT file outputed to CRicDoc

FileToDatabox cNATEXT file loaded into dialog box Cedit

FileToString cNATEXT file returned as a single string

FileToTable cNATEXT file loaded to CStringList for output

StringOutput CString text outputed to CRicDoc

StringToFile CString text written to a cNATEXT file

TableOutput CStringList raw in and formated out

TableToDatabox CStringList text loaded into dialog box Cedit

126 · Data Classes ConCentRICs for Windows RIC Corp Class Libraries

Page 137: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

TextDialog A common Dialog routine for cNATEXT

TextMaint A common Maint routine for CString text

TextOutput CString in formatted to CStringList for output

CRicText::DataboxToFilevoid DataboxToFile( databox, natext, key)

CEdit* databox; // Pointer to the dialog box's CEdit variable

cNATEXT* natext; // Pointer to your opened cNATEXT file

long key; // The key of the records to be extracted

The DataboxToFile function will take the text out of a dialog box variable and write it to the natext file that is already opened. It will perform all the maintenance required to put the text into the file for the specified key.

CRicText::DataboxToTablevoid DataboxToTable( databox, table, size, delete=TRUE)

CEdit* databox; // Pointer to the dialog box's CEdit variable

CStringList* table; // Pointer to string table to place output

int size; // Size of maximum text per line

BOOL delete; // Indicates to delete table before filling it

The DataboxToTable function will take the text out of a dialog box variable and place it in a CStringList with just the size lines needed for your file. You would use this function if you had a custom text file, and you are ready to rebuild you file from the dialog box. You then use the resulting CStringList to rebuild your data file. See the example at the end of this section.

CRicText::FileOutputvoid FileOutput( natext, doc, key, size, recnum, keystr, nadr=”~”, before=””,

after=””)

cNATEXT* natext; // Pointer to your opened cNATEXT file

CRicDoc* doc; // Pointer to your CRicDoc (GetDocPtr)

long key; // The key of the records to be extracted

int size; // The size of the resulting output column

int recnum; // The recnum value for DocLineRIC

CString keystr; // The key value for DocLineRIC

CString nadr; // The name and address value for DocLineRIC

CString before; // The string to attach in front of the text

CString after; // The string to attach to the end of the text

The FileOutput function will take the text for a particular key in your cNATEXT file and will actually output it into your CRicDoc class. It will perform the DocLineRIC command for you. The file must already be open and the pointer to the file and your document needs to be passed to the command. You get your

ConCentRICs for Windows RIC Corp Class Libraries Data Classes · 127

Page 138: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicDoc pointer with the GetDocPtr command. Pass the key of the data within the file. This is the primary key, not the text indexes. The text indexes are handled automatically. The size is the maximum number of characters that can appear in a text line. If the size is a negative then the system will make it a positive and the text lines will not be linked together.

The recnum, keystr, and nadr parameters are just what you would pass if you were building the DocLineRIC command yourself. It will fill in the data parameter for you with the text itself. You may need tabs or a literal before the text, and you may need tabs or a literal after the text lines. You put that in the before and after parameters. This routine will concatentate the before variable, then the text data, then the after variable to create the data variable for DocLineRIC. The text will automatically be blocked as one item. The nadr, before, and after parameters are optional. The nadr will default to "~" and the before and after will default to blank.

CRicText::FileToDataboxvoid FileToDatabox( natext, databox, key)

cNATEXT* natext; // Pointer to your opened cNATEXT file

CEdit* databox; // Pointer to the dialog box's CEdit variable

long key; // The key of the records to be extracted

The FileToDatabox function will take the text out of a natext file for the specified key and place it in the dialog box variable. If natext is NULL and the key has a value of zero (0), then the data from the clipboard will be gathered instead.

CRicText::FileToStringCString FileToString( natext, key)

cNATEXT* natext; // Pointer to your opened cNATEXT file

long key; // The key of the records to be extracted

The FileToString function will take the text out of a natext file for the specified key and will return it as a single string variable. If natext is NULL and the key has a value of zero (0), then the data from the clipboard will be gathered instead.

CRicText::FileToTablevoid FileToTable( natext, table, key, size, delete=TRUE)

cNATEXT* natext; // Pointer to your opened cNATEXT file

CStringList* table; // Pointer to string table to place output

long key; // The key of the records to be extracted

int size; // The size of the resulting output column

BOOL delete; // Indicates to delete table before filling it

The FileToTable function will take the text out of a natext file for the specified key and will format it into format output lines. Each line will have a maximum of size characters, and the resulting text lines will be placed in the string table.

128 · Data Classes ConCentRICs for Windows RIC Corp Class Libraries

Page 139: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicText::StringOutputvoid StringOutput( data, doc, size, recnum, keystr, nadr=”~”, before=””,

after=””, delete=TRUE)

CString data; // String containing all of the text data

CRicDoc* doc; // Pointer to your CRicDoc (GetDocPtr)

int size; // The size of the resulting output column

int recnum; // The recnum value for DocLineRIC

CString keystr; // The key value for DocLineRIC

CString nadr; // The name and address value for DocLineRIC

CString before; // The string to attach in front of the text

CString after; // The string to attach to the end of the text

BOOL delete; // Reserved for future use

The StringOutput function will take the text contained in a CString variable and will actually output it into your CRicDoc class. It will perform the DocLineRIC command for you. You get your CRicDoc pointer with the GetDocPtr command. The size is the maximum number of characters that can appear in a text line. If the size is a negative then the system will make it a positive and the text lines will not be linked together.

The recnum, keystr, and nadr parameters are just what you would pass if you were building the DocLineRIC command yourself. It will fill in the data parameter for you with the text itself. You may need tabs or a literal before the text, and you may need tabs or a literal after the text lines. You put that in the before and after parameters. This routine will concatentate the before variable, then the text data, then the after variable to create the data variable for DocLineRIC. The text will automatically be blocked as one item. The nadr, before, and after parameters are optional. The nadr will default to "~" and the before and after will default to blank.

CRicText::StringToFilevoid StringToFile( data, natext, key)

CString data; // Contains all the text as a single string

cNATEXT* natext; // Pointer to your opened cNATEXT file

long key; // The key of the records to be extracted

The StringToFile function will take the text out of a CString variable and write it to the natext file that is already opened. It will perform all the maintenance required to put the text into the file for the specified key.

CRicText::StringToTablevoid StringToFile( data, table, size, delete=TRUE)

CString data; // Contains all the text as a single string

CStringList* table; // Pointer to string table to place output

int size; // Size of maximum text per line

BOOL delete; // Delete the table before filling it

ConCentRICs for Windows RIC Corp Class Libraries Data Classes · 129

Page 140: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

The StringToTable function will take the text out of a CString variable and break it into individual lines in the table. Make delete TRUE if you want this table emptied first of make if FALSE to just add the new entries to any other entries already in the table. The size will indicate the length you want each of the resulting lines. This routing ignores all carriage return and line feeds and character breaks. It will make each line the exact same size. You would use this routine when you have a text box you are loading to a custom file and you want each record filled to capacity.

CRicText::TableOutputvoid TableOutput( table, size)

CStringList* table; // Pointer to string table to place output

int size; // Size of maximum text per line

The TableOutput function will take the text out of a StringList variable. The text in this table can be of any size. It can be in the size and format of any data file holding the text. This function will put all the text in a single string and will then reformat the text so that no text line is longer than the size parameter. It will put the formatted text back into the same CStringList table variable.

CRicText::TableToDataboxvoid TableToDatabox( table, databox)

CStringList* table; // Pointer to string table to place output

CEdit databox; // Pointer to the dialog box variable

The TableToDatabox function will take the text out of a StringList variable and but it directly into a dialog box variable.

CRicText::TextDialogvoid TextDialog( natext, key, title, delete)

cNATEXT* natext; // Pointer to your opened cNATEXT file

long key; // The key of the records to be extracted

CString title; // Title of the Dialog Box

BOOL delete; // Indicates if delete is available

The TextDialog function will perform all the text maintenance necessary including the dialog box for the specified key. The data must be kept in a cNATEXT file, but it can have any filename since you open the file before calling this routine. If you have the data in a custom file, you should use the Text Maint function for this purpose. The title variable is what will appear at the top of the dialog box. The delete indicator will active the delete button or not. The delete button is not important on a text box, since the user could remove all the text, which would have the same effect as a delete.

CRicText::TextMaintBOOL TextMaint( data, title, delete)

CString data; // Contains all the text as a single string

130 · Data Classes ConCentRICs for Windows RIC Corp Class Libraries

Page 141: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CString title; // Title of the dialog box

BOOL delete; // Indicates if delete is available

The TextMaint function will perform all the text maintenance necessary including the dialog box for any string of data. The title variable is what will appear at the top of the dialog box. The delete indicator will active the delete button or not. The delete button is not important on a text box, since the user could remove all the text, which would have the same effect as a delete. This routine will return FALSE if the Cancel button was used, else it will return TRUE.

CRicText::TextOutputvoid TextOutput(data, table, size, delete=TRUE)

CString data; // Contains all the text as a single string

CStringList* table; // Pointer to a string table to receive the output

int size; // Size of the output column

BOOL delete; // Delete the table before filling it

The TextOutput function will take the text as a CString and will format the data into text lines. No line will be longer than the size variable, but they could be shorter if an entire word does not fit on the line. The resulting strings will be placed in the table parameter. If you want this table emptied first then set the delete paramter to TRUE else set it to FALSE.

Custom Text FilesYou can do text very easily in your application if you use the cNATEXT file template with any file name you would like to make it unique to your application. This file has a single long key that will allow you to tie it to your specific items. There are a number of functions provided that will let you do the text automatically from that file. Since you open the file before calling these routines then the text is done very easily. This is not always possible, since cNATEXT uses only a single key. There may be times whey you need this text feature in your own datafiles with your own dialog boxes. This section will outline how you do that.

In the Init or Record section of this option, pull the text out of the file, and build it into a single CString. In the document you then pass this text to StringOutput function to show it in your document.

If you do not have your own dialog box you can then use the common dialog box at this point with the TextMaint function.

In the Init dialog box, pull all the text out of the file, and put it into a single CString variable. Then you can put that string to your variable with the SetWindowText command. Your CEdit dialog box variable must have the following styles only, all the others ones should be turned off. Multiline, Align Left, Vertical Scroll, Want Return and Border.

In the OnOk function in the dialog box, you should create a CStringList variable, take the text out of the dialog box control pass it to the TextOutput command. Set the size variable to the EXACT size of the your text data field. You can then write the resulting CStringList command back to your file with the following.

You will need to get the maximum index first, with the following:

int max = -1;

ConCentRICs for Windows RIC Corp Class Libraries Data Classes · 131

Page 142: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

ret = m_File->GetGreaterOrEqualOnKEY(key, 0, 0);

while (ret == 0 && m_File->GetKEYFIELD() == key)

{

if (m_File->GetINDEX() > max) max = m_File->GetINDEX();

ret = m_File->GetNext();

}

Then you maintain your file with the following logic:

int index = 1;

POSITION pos = stringlist.GetHeadPosition();

while (pos != NULL)

{

CString data = stringlist.GetNext(pos);

BOOL add = FALSE;

ret = m_File->GetEqualOnKEY(key, index, 0);

if (ret != 0) add = TRUE;

m_File->ClearRec();

m_File->SetKEYFIELD(key);

m_File->SetINDEX(index);

m_File->SetTEXT(data);

if (add) m_File->Insert();

else m_File->Update();

++index;

}

for (; index <= max; index++)

{

ret = m_File->GetEqualOnKEY(key, index, 0);

if (ret == 0) m_File->Delete();

}

Custom Text ScreensYou can have you own text dialog box, you just need to add a few standard items. The Text input is just a regular data box that can be any width, but should be strectched to allow multiple line entry. Set the Style with the following attributes only: Multiline, Align Left, Auto Vscroll, Want Return, and Border.

You will need three small buttons, in order to support cut, copy and paste. These normally appear above the text box. You may copy these from the model's sample IDD_TEXT dialog box. This will give you the standard size, shape and spacing for these buttons. These buttons must have the specific names: ID_EDIT_CUT, ID_EDIT_COPY and ID_EDIT_PASTE. These names are critical. You only need a variable for the Paste button called m_Paste. If you want to hide or disable the

132 · Data Classes ConCentRICs for Windows RIC Corp Class Libraries

Page 143: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

other two for some reason you will need variables for the other two. For each of the buttons have Class Wizard add a function for each of the buttons, select message BN_CLICKED and use the default name for the function.

In your InitDialog function, label the buttons as shown:

SetDlgItemText(ID_EDIT_CUT, LSRIC(IDS_AP_CUT));

SetDlgItemText(ID_EDIT_COPY, LSRIC(IDS_AP_COPY));

SetDlgItemText(ID_EDIT_PASTE, LSRIC(IDS_AP_PASTE));

In your InitDialog function, after the magic OnInitDialog command type:

if (!IsClipboardFormatAvailable(CF_TEXT))

m_Paste.EnableWindow(FALSE);

If you have a need to hide the buttons use the following, but this is optional and only should be used if you have a special need to do so, such as using the dialog box in Read Only mode:

m_Cut.ShowWindow(SW_HIDE);

m_Copy.ShowWindow(SW_HIDE);

m_Paste.ShowWindow(SW_HIDE);

The following functions would have been added automatically by ClassWizard, enter the appropriate statements listed for each function:

void CTextDlg:OnEditCut()

{

m_Text.Cut();

m_Paste.EnableWindow(TRUE);

}

void CTextDlg::OnEditCopy()

{

m_Text.Copy();

m_Paste.EnableWindow(TRUE);

}

void CTextDlg::OnEditPaste()

{

CRicText text;

Text.FileToDatabox(NULL, &m_Text, 0);

}

ConCentRICs for Windows RIC Corp Class Libraries Data Classes · 133

Page 144: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

class CRicTime

IntroductionThe CRicTime class is a data class used to represent time data. It provides a variety of functions to store, display and retrieve time information. The routine will allow you to store the time information from a number of different sources and will give you great control of the display of that time information.

The time data structure will contain the hours, minutes, seconds, and hundreds of seconds for a time. You may retrieve any portion of the time, or time parameters.

Construction - Public MembersSet Assigns a new time value

Extraction - Public MembersAMPM Indicates the use of 24-hour or 12-hour format

ChkTime Compares two CRicTime variables

Display Used to output the time in different formats

HH Returns the Hours

HS Returns the Hundreds of Seconds

MM Returns the Minutes

SS Returns the Seconds

Symbol Returns the character used to separate the hours from the minutes and seconds

TimeInRange Compares two time ranges for overlap

Value Extracts the whole time in Btrive format

Operators - Public Members- Subtracts two times

= Set the time data from another CRicTime

+= Adds to an existing time

-= Subtracts from an existing time

> Compare one time greater than another

>= Compare one time greater than or equal to

< Compare one time less than another date

<= Compare one time less than or equal another

== Compare if two times are equal

!= Compare if two times are not equal

CRicTime::AMPMBOOL AMPM()

134 · Data Classes ConCentRICs for Windows RIC Corp Class Libraries

Page 145: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

The AMPM function will identify if the user desires time displayed in 12-hour or 24-hour format based on the settings they made in the Window's Control Panel.

Return ValueThis function will return TRUE if the user wants a 12-hour time format followed by an AM or PM. The function will return FALSE if the user would like a 24-hour time display.

CRicTime::ChkTimeBOOL ChkTime(time)

int direction; // Indicates less than, equal, or greater than compare

CRicTime time; // CRicTime variable with valid time data.

The ChkTime function will allow you to compare two CRicTime variables. The result will be TRUE if they compare and FALSE, if they do not. This function can also be done with the >, >=, <, <=, ==, and != operators. Use the chart below to set the direction parameter.

Direction Value Comparison Made

-1 Less than

0 Equal to

1 Greater than

The following example will check if two times are equal to each other:

CRicTime timea, timeb;

timea.Set(2:22);

timeb = timea;

if (timea.ChkTime(0, timeb)); // The result of this if would be TRUE

CRicTime::DisplayCString Display(size=0, style=0)

int size; // Number of time fields to show

int style; // Time format to use for display

The Display function will take the time data and put it in a CString variable in a variety of formats, that you can use in the application to display the time to the user.

ParametersBoth of the parameters are optional, and should only be used if you want the time in a specific format. If you leave off both parameters the time will be displayed in the format that the user has selected. This should be the way you would normally display times. Only use the parameters if you have a special need to display a time in a specific format.

ConCentRICs for Windows RIC Corp Class Libraries Data Classes · 135

Page 146: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

size indicates how many time fields to show. The chart below shows the effect of the different sizes. The default size is zero (0), and an invalid size will be set to zero (0).

Size Value Result

0 HH:MM

1 HH:MM:SS

2 HH:MM:SS:HS

Style indicates the format to use to display the time. The chart below shows the effect of the different style values. The default style is zero (0), and an invalid style will be set to zero (0).

Style Value Result

0 User Setting

1 24 hour (13:00)

2 12 hour (1:00 PM)

Return ValueThe return value is the formatted time in a CString variable.

CommentsThe normal use of this function is with no parameters. This will display the hours and minutes in the user format.

ExampleCString result;

CRicTime testtime;

testtime.Set("13:30:15:45");

result = testtime.Display(); // result will be 1:30 PM

result = testtime.Display(0, 1); // result will be 13:30

result = testtime.Display(2, 1); // result will be 13:30:15:45

CRicTime::HHint HH()

The HH function will return the hours portion of the time data.

CRicTime::HSint HS()

The HS function will return the hundred seconds portion of the time data.

136 · Data Classes ConCentRICs for Windows RIC Corp Class Libraries

Page 147: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicTime::MMint MM()

The MM function will return the minutes portion of the time data.

CRicTime::SetBOOL Set()

BOOL Set(hours, minutes, seconds=0, hseconds=0)

BOOL Set(&btrvtime)

BOOL Set(ctime)

BOOL Set(timet)

BOOL Set(strtime)

int hours; // Hours parameter of the time

int minutes; // Minutes parameter of the time

int seconds; // Seconds parameter of the time (optional)

int hseconds; // Hundreds of seconds of the time (optional)

BtrvTimeRIC* btrvtime; // Pointer to a Btrieve time structure

CTime ctime; // Time from a C++ date/time function

time_t timet; // Time in a C++ date/time structure

CString strtime; // Time as a character string

Set is an overloaded function that will allow you to initialize the time from many different sources. This function supports every known time format.

Current TimeUse the Set function with no parameters to load the current system time.

Return ValueThe return value is TRUE if the time was set. The return value will be FALSE if the input time was invalid in any way.

CommentsIf the time parameter used for this function is not a valid time, the function will return FALSE, and will set the time to a NULL time. A NULL time is no time at all. If you display a NULL time you will get no display at all. You can use this function to validate times that are input by the user, by passing the inputted time to the Set function and then testing the result. When you use Set with a time in string format, it will use any non-numeric character to separate the time components. A non-numeric character will be ignored except to indicate a new component. A character time must have hours first, then minutes. Seconds and hundreds of seconds are optional. Time can be in 24-hour or 12-hour formats. The system will look for just an "a" or just a "p" to indicate am, or PM in 12-hour format. If neither "a" or "p" are present, it will default to an AM time. The "a" and "p" are not case sensitive.

ConCentRICs for Windows RIC Corp Class Libraries Data Classes · 137

Page 148: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

ExampleCRicTime worktime;

worktime.Set("13.30.15.45");

CRicTime::SymbolCString Symbol()The Symbol function will return the character the user would like used to separate the hours, minutes, seconds and hundreds of seconds in the time. In the United States this symbol is usually a colon (:), in Europe they use a period (.). However, the user can set the character they any one they would like to use from within their Window's control panel.

CRicTime::SSint SS()

The SS function will return the seconds portion of the time data.

CRicTime::TimeInRangeBOOL TimeInRange(stimerange, etimerange, stimetest, etimetest, within=FALSE)

CRicTime stimerange; // Starting Time of Range

CRicTime etimerange; // Ending Time of Range

CRicTime stimetest; // Starting Test Time

CRicTime etimetest; // Ending Test Time

BOOL within; // Test times inclusive of range

The TimeInRange fucntion will compare two sets of times to determine if the test or second set of times intersects with the range or first set of times. The within parameter determines the scope of the compare. If this value is FALSE then if any of the test times falls on a range time than the compare will be TRUE. If the within parameter is TRUE then all of the test times must be within the range times for TRUE to be returned. This is an optional parameter that will default to FALSE. You must provide both a starting and ending time to this function. If you only have one of the two times, you can set the starting and ending time to the same value. The chart below will give you several examples of what results you will get with certain parameter settings.

stimerange etimerange stesttime etesttime within result

2:00 pm 5:00 pm 1:00 pm 3:00 pm FALSE TRUE

2:00 pm 5:00 pm 1:00 pm 3:00 pm TRUE FALSE

2:00 pm 5:00 pm 1:00 pm 6:00 pm FALSE TRUE

2:00 pm 5:00 pm 1:00 pm 6:00 pm TRUE FALSE

2:00 pm 5:00 pm 1:00 pm 2:00 pm either FALSE

2:00 pm 5:00 pm 3:00 pm 4:00 pm either TRUE

138 · Data Classes ConCentRICs for Windows RIC Corp Class Libraries

Page 149: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicTIme::Valuevoid Value(&btrvtime)

BtrvTimeRIC* btrvtime; // Pointer to Btrieve time format

The Value function will output the time in Btrieve format. This will be used to load the time in a Btrieve file.

Parametersbtrvtime is a pointer to the Btrieve time structure to use for the time data

ExampleCRicTime worktime;

BtrvTimeRIC loadtime;

worktime.Set("1:30:15:45");

worktime.Value(&loadtime);

CRicTime::operator-

BtrvTimeRIC operator-(time)

CRicTime time // CRicTime variable with valid time data.

The - operator will allow you to obtain the difference between two times. It will determine how many hours, minutes, seconds, and hundreds of seconds there are from the parameter time to this time. The parameter time can be less than less this time. This function will assume that time is the next day. If the two times are equal then the result will be 0 hours, 0 minutes, 0 seconds, and 0 hundreds of seconds. The maximum result time would be 23 horus, 59 minutes, 59 seconds, and 59 hundreds of seconds. The following chart will show you some examples.

Base Time Parameter Hours Minutes Secs HS

1:00pm 11:00am 2 0 0 0

1:00pm 2:00pm 23 0 0 0

9:00pm 1:30am 4 30 0 0

CRicTime::operator =void operator=(time)

CRicTime time // CRicTime variable with valid time data.

The = operator will allow you to set the time in the current variable to a time in another CRicTime variable.

CRicTime sourcetime, targettime;

sourcetime.Set(10:30);

targettime = sourcetime;

CRicTime::operator+=void operator+=(time)

ConCentRICs for Windows RIC Corp Class Libraries Data Classes · 139

Page 150: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

BtrvTimeRIC time // BtrvTimeRIC variable containing incrementation

The += operator will allow you to offset the time by a given number of hours, minutes and seconds. You pass the number of hours, minutes, seconds and hundreds of seconds to offset the time by, and the this function will add that number of units to this time. Days do not play a part in this function. It will push the time into the next day, but it will not indicate that in any way. This function will always leave a valid time as a result.

CRicTime::operator-=void operator-=(time)

BtrvTimeRIC time // BtrvTimeRIC variable containing incrementation

The -= operator will allow you to offset the time by a given number of hours, minutes and seconds. You pass the number of hours, minutes, seconds and hundreds of seconds to offset the time by, and the this function will subtract that number of units to this time. Days do not play a part in this function. It will push the time into a past day, but it will not indicate that in any way. This function will always leave a valid time as a result.

CRicTime::operator >BOOL operator>(time)

CRicTime time // CRicTime variable with valid time data.

The > operator will allow you to compare two CRicTime variables to see if one is greater than the other. The result will be TRUE if greater and FALSE, if less.

CRicTime timea, timeb;

timea.Set(11:30);

timeb.Set(2:30);

if (tima > timeb); // The result of this if would be TRUE

CRicTime::operator >=BOOL operator>=(time)

CRicTime time // CRicTime variable with valid time data.

The >= operator will allow you to compare two CRicTime variables to see if one is greater than or equal to the other. The result will be TRUE, if they are and FALSE, if they are not.

CRicTime timea, timeb;

timea.Set(11:30);

timeb.Set(2:30);

if (timea >= timeb); // The result of this if would be TRUE

CRicTime::operator <BOOL operator<(time)

CRicTime time // CRicTime variable with valid time data.

140 · Data Classes ConCentRICs for Windows RIC Corp Class Libraries

Page 151: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

The < operator will allow you to compare two CRicTime variables to see if one is less than the other. The result will be TRUE, if they are and FALSE, if they are not.

CRicDate timea, timeb;

timea.Set(11:30);

timeb.Set(2:30);

if (timea < timeb); // The result of this if would be FALSE

CRicTime::operator <=BOOL operator<=(time)

CRicTime time // CRicTime variable with valid time data.

The <= operator will allow you to compare two CRicTime variables to see if one is less than or equal to the other. The result will be TRUE, if they are and FALSE, if not.

CRicTime timea, timeb;

timea.Set(11:30);

timeb.Set(2:30);

if (timea <= timeb); // The result of this if would be FALSE

CRicTime::operator ==BOOL operator==(time)

CRicTime time // CRicTime variable with valid time data.

The == operator will allow you to compare two CRicTime variables to see if one is equal to the other. The result will be TRUE if they are and FALSE if they are not.

CRicTime timea, timeb;

timea.Set(11:30);

timeb.Set(2:30);

if (timea == timeb); // The result of this if would be FALSE

CRicTime::operator !=BOOL operator!=(time)

CRicTime time // CRicTime variable with valid time data.

The != operator will allow you to compare two CRicTime variables to see if one is not equal to the other. The result will be TRUE, if they are and FALSE, if they are not.

CRicTime timea, timeb;

timea.Set(11:30);

timeb.Set(2:30);

if (timea != timeb); // The result of this if would be TRUE

ConCentRICs for Windows RIC Corp Class Libraries Data Classes · 141

Page 152: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

142 · Data Classes ConCentRICs for Windows RIC Corp Class Libraries

Page 153: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

Dialog Classes

Overview

Introduction The Dialog Classes are common dialog boxes that can be used by all applications that need these functions. This includes such things as the About Box, Password acceptance, along with Table, Code, and Name and Address handling. Each of these classes are discussed in detail in the alphabetical class sections following the General Functions section.

Application ConnectionWhen you use these classes you would normally declare the class in the function that required the use of the dialog box. You would then set any required variables in the class. You would then perform a DoModal function with the variable you defined for the class. You can then use the class functions to retrieve the results of the dialog box. Some of these objects have exceptions to this, and they will be noted in the detail description of the class.

CAboutDlg

IntroductionThe CAboutDlg class is a base class used to display the About Box for the application. The About box is standard in ConCentRICs applications. It will display information about the current work station and user in a consistent manner. This class is implemented in your App class such as SYST.CPP.

Data Members - Public Membersm_Return Author/Return button status

m_Data Data to display in About Box

ConCentRICs for Windows RIC Corp Class Libraries Dialog Classes · 143

Page 154: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CAboutDlg::m_ReturnBOOL m_Return;

This item will be TRUE if the button is in Author mode. The button will display Return in this mode. This item will be FALSE if the button is in About mode. The button will display Author in this mode.

CAboutDlg::m_DataCString m_Data;

This variable will contain the variable data to be displayed in the about box.

class CPswdDlg

IntroductionThe CPswdDlg class was designed to ask the user for a password, and to stay on this dialog box until a valid password was entered, or the user pushes the cancel button. The dialog box could be used though to ask the user for any single character string of information.

This function is contained within a dynamic link library, so you should use this function by calling the library function PassWordRIC. This function will return the status of the dialog box such as IDOK or IDCANCEL.

PassWordRICint PassWordRIC(title, prompt, password, hide)

CString title; The title of the dialog box

CString prompt; The field prompt to show the user

CString* password; The actual password to be matched or the data to be returned

BOOL hide; Indicates that the data entered by the user should be hidden from view

TitleSet this variable to a string value that you want to use for the title of the Dialog box. Usually you would set this to the title of the option.

PromptSet this variable to the screen prompt you want to show the user for their entry. If you have them entering a password you can set this variable to IDS_AP_PASSWORD, which will prompt the user for a password. If you want the user to enter some other value, then set this variable to an appropriate message to indicate what you want the user to enter in the dialog box.

PasswordIf the data entered by the user needs to match a predetermined value, then set this variable to that predetermined value. This would be used for password processing.

144 · Dialog Classes ConCentRICs for Windows RIC Corp Class Libraries

Page 155: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

Set this variable to the actual password. When the user enters their data and hits RETURN or enters their data and pushes the OK button, then the dialog box will compare their entry to this variable, if it matches the dialog box it will end and return an IDOK value. If the data entered by the user does not match this value they will get a warning message, and be asked to enter it again. If you want the user to enter any string value, and not to match it, then set this variable to "" and what ever the user enters will be acceptable. This variable with then contain the value entered by the user. Your function can then use this value as the user's input.

HideSet this variable to TRUE if you want the data entered by the user to be hidden, or FALSE if the data entered can be displayed. If the data entered by the user is hidden then an asterick (*) character will appear for each character entered instead of the actual character. You would set this to TRUE if the user was entering a password, so no one else would see the password. If the user is entering some other data that can be displayed, then set this variable to FALSE.

class CRicMig

IntroductionThe CRicMig class is a virtual function class. This class will handle all the overhead involved in Migrating files. There are six virtual functions that your application must declare and override to add your application dependent logic to the migration process. The Model program you started with should have included the use of this class. The Data Migration section of this document describes in detail what goes into each of the six virtual functions. See that section for more detail on this class.

CRicMig::OnMigrateInitvirtual void OnMigrateInit();

This function needs to be overridden by the application. This function is used to identify the name and size of the source migration file.

CRicMig::OnMigrateDelvirtual void OnMigrateDel();This function needs to be overridden by the application. This function is used to delete any existing data in the current file(s) if the user indicated they wanted the file deleted first.

CRicMig::MigrateFileOpenvirtual BOOL MigrateFileOpen();

This function needs to be overridden by the application. This function is used to open the appropriate windows file for the migration. This function will return TRUE if the open was successful. It will return FALSE if the file could not be opened.

ConCentRICs for Windows RIC Corp Class Libraries Dialog Classes · 145

Page 156: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicMig::MigrateFileClosevirtual void MigrateFileClose();

This function needs to be overridden by the application. This function is used to close the appropriate windows file that was loaded in the migration.

CRicMig::MigrateFileAddvirtual int MigrateFileAdd(data);

CString data; // The data buffer to be added to the file

This function needs to be overridden by the application. This function will add the data parameter to the file being migrated.

CRicMig::OnMigrateEndvirtual void OnMigrateEnd();

This function needs to be overridden by the application. This function is only called if a single option in the application is being migrated. This function allows mutiple files to be migrated for one application option.

class CScdeDlg

IntroductionThe CScdeDlg class is a dialog class that will present the user with two list boxes. In the middle of the two list boxes will be two arrow buttons. The first arrow button will point to the right list box, and the second arrow button will point the left list box. The left list box will contain the possible selection choices the user has, that have not already been selected. The right list box will contain the selected choices. The user may select an entry by double clicking the entry in the left box, or by selecting the entry in the left box and hit the first arrow button. When an entry is selected it will disappear from the left box, and will reappear in the right box. The user may deselect an entry by double clicking the entry in the right box, or by selecting the entry in the right box and hit the second arrow button. When an entry is deselected it will disappear in the right box, and will reappear in the left box.

ImplementationThe CScdeDlg class is contained within a dynamic link library, so you can not access it directly. You have a structure available to interface with the library. The following is an example of the use of this structure:

CStringList codes, actions;

CodeSelectRIC selection; ***

selection.AddMode = FALSE;

selection.Title = “Code Selection”;

selection.Dir = user.OrgDirRIC();

selection.Nakey = 0;

146 · Dialog Classes ConCentRICs for Windows RIC Corp Class Libraries

Page 157: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

selection.System = 2;

selection.Table = 30002;

selection.Category = -1;

selection.UserSecurity = user.SecurityLevelRIC();

selection.File = NULL;

selection.Codes = &codes;

selection.Actions = &actions;

selection.DefTable = NULL;

return SelectCodesRIC(&selection);

The function will return the status of the DoModal function. You can test the return for IDCANCEL to determine if the cancel button was pressed. The selected codes will be in the codes CStringList variable.

Each of the fields in this structure are discussed below:

Data MembersAddMode Indicates a new entry can be added

Title Title for the Dialog Box

Dir Directory for the code file

Nakey Key to the reference file

System System number of the Table

Table Table number of the Codes

Category Default Category

UserSecurity Security level of the user

File Pointer to the reference file

Codes Currently selected codes

Actions Indicates the disposition of the entry

DefTable A custom filled selection string

AddModeBOOL AddMode;

This item will be TRUE, if a new table entry can be added during the process, or a value of FALSE, will not allow the user to add a new entry.

TitleCString Title;

This item will contain the title to use in the dialog box.

DirCString Dir;

ConCentRICs for Windows RIC Corp Class Libraries Dialog Classes · 147

Page 158: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

This item will contain the directory to use for the code file that will be the source list for the codes.

Categoryint Category;

This item will contain a default category. This will be a category that the user must have for this code. It will make the item automatically selected. If the user deselects the entry the system will automatically restore it.

Nakeylong Nakey;

This item will contain the key of the object being reference. This will be things like a name, event, etc.

Systemint System;

This item will contain the Application number of the table. The application number comes from the RIC Corp Project Chart in Appendix A. If you want the dialog box to use the custom list of codes, then this parameter must be set to zero (0), and the list of codes must be built in the m_DefTable variable.

Tableint Table;

This item will contain the unique table number in the application that contains the codes that will be listed in the possible selections for the user. The system will match the possible entries with the currently selected entries. As it reads all of the possible codes, it will place selected entries in the right box, and unselected entries in the left box.

UserSecurityint UserSecurity;

This item will contain the current users security level. If the codes have a security level, then only the codes that are within the security range of the user will be displayed.

FilecCODEREF* File;

This item will contain a pointer to the reference file of the currently selected codes. There is a common file template used to reference codes to a key. You can open the file associated with this key and pass the pointer to the dialog box. With this method the dialog box will automatically find the selected codes, and will fill in the Codes and Actions variables appropriately. It will also process the results of the dialog box and will update the reference file automatically. There is a second method to implement this dialog box. You can set the file reference to NULL. You

148 · Dialog Classes ConCentRICs for Windows RIC Corp Class Libraries

Page 159: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

can then set the Codes and Actions appropriately. The example shows an illustration of both methods.

CodesCStringList Codes;

This item will contain a list of the currently selected codes. Each entry in this list must have a corresponding entry in the m_Actions list. See the special note on m_File.

ActionsCStringList* Actions;

This item will have an entry for each selected entry. It will have a constant value of "N" for each entry. When the dialog box completes this item will determine the final disposition of the corresponding data item in the m_Code item. If the value is still "N" no further action is required on the item. If the action is "A" it will indicate that the code was a new selection by the user. If the action is "D" it will indicate that the code was deselected by the user. If the action is "X" it will indicate the code was a new selection and then deselected again by the user during the process. No action should be taken on "X" actions. See the special note on m_File.

DefTableCStringList* DefTable;

This is a pointer to a string list that contains the data to be displayed in the Choose box. This will allow you to restrict some of the codes in a list. If you are using this variable, then you must set the System variable to zero (0). That is how the dialog box knows you have a custom selection table. The string list must have the following format. The description must come first, then a tab (\t) followed by the key to the table. Do not space the key out from the data.

ConCentRICs for Windows RIC Corp Class Libraries Dialog Classes · 149

Page 160: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

Scheduling Class Library

Overview

IntroductionThe RIC Corp Scheduling Library will contain all of the common scheduling functions that are used by all applications. This includes such things as Event Search, Event Profile, Event Maintenance, Scheduling Help, Location / Inventory Rates and the Automated Inventory and Checklists.

Application ConnectionWith the RIC Corp base libraries, all the functions are available immediately because the base library header is automatically included in your project. You added the base library itself when you initally built the project. The Scheduling library must be added manually the first time. The instructions for this are in two separate sections. The first section called Application Connection is used any time a project needs access to the scheduling functions. The second section called Tie Project to an Event is used when the entire project is dependent on a single event, such as Event Settlement.

Scheduling FunctionsThe Scheduling library provides functions that will perform must of the common things you need to do with the Scheduling System. These functions will allow any application to perform Scheduling activities with out having to know anything about the inner workings of the Scheduling Application. Each of the functions are described in detail in their own section.

Application Connection

IntroductionThe items in this section are required when ever a project needs to use the scheduling library. You would perform these steps only once in the life time of your project. Once you complete these items you will be able to use the functions

ConCentRICs for Windows RIC Corp Class Libraries Scheduling Class Library · 151

Page 161: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

in the scheduling libarary anywhere in your project. The functions themselves are detailed in their own chapter.

If all of the functions in your project are dependent on a single event being selected then you must follow all the items in this section and you must also follow all the items in the section called Tie Project to an Event.

Project ResourcesYou must first include the scheduling resources into your project. This is one of the items you must do separately for the 32-bit version, and again for the 16-bit version.

32-bit ResourcesSelect View menu and choose Resource Includes…

In the Read-Only Symbol Directives box add this line at the bottom of the box: #include "resschd.h"

In the Compile-Time Directives box add this line after the #include ricres.rc line: #include "ricschd.rc" // RIC Corp scheduling resources

Push the OK button

You will get a Microsoft Developer Studio warning box, push the OK button.

Open the project's resources

Push the + in front of the the Menu folder

Double-click on the IDR_XXXXTYPE object

Add the following item to the Help menu, between What's This? and ConCentRICs: ID = ID_SCHDBASIC Caption = &Sched. Basics…

Save and Close the resources

16-bit ResourcesStart App Studio

On the File Menu, select the Set Includes… option

In the Read-Only Symbol Directives box add this line at the bottom of the box: #include "reschd16.h"

In the Compile-Time Directives box add this line after the #include ricres16.rc line: #include "ricsch16.rc" // RIC Corp scheduling resources

Push the OK button

You will get a Microsoft Developer Studio warning box, push the OK button.

In type: Menu Resource, select IDR_XXXXTYPE

Add the following item to the Help menu, between What's This? and ConCentRICs: ID = ID_SCHDBASIC Caption = &Sched. Basics…

Close and Save App Studio

Library FileYou must add the Scheduling Library to your project. You must do this in both the 32-bit and 16-bit versions of your project.

152 · Scheduling Class Library ConCentRICs for Windows RIC Corp Class Libraries

Page 162: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

32-bit LibraryOn the Build Menu, select Settings…

Select the Link tab

Add ricschd.lib to the end of the library list

16-bit LibraryOn the Options Menu, select Project…

Push the Linker… button.

Add ricschd to the end of the library list

Main HeaderIn your project's main header file (XXXX.H) make the following changes:

After the line: #include "resource.h"

Add the line: #include "resschd.h"

After the line: #include "res16.h"

Add the line: #include "reschd16.h"

After the line: afx_msg void OnHelp();

Add the line: afx_msg void OnSchdbasic();

Main ProgramIn your project's main program file (XXXX.CPP) make the following changes:

After the line: #include "xxxx.h"

Add the line: #include "schdric.h"

After the line: ON_COMMAND(ID_HELP, OnHelp)

Add the line: ON_COMMAND(ID_SCHDBASIC, OnSchdbasic)

In the Win Help function after the line: DWORD helpid = data;

Add the line: if (SchdBasicHelp(helpid, cmd)) return;

Add the following function at the end of the program:

void CEvstApp::OnSchdbasic()

{

SchdBasicHelp(131292, HELP_CONTENTS);

}

All ProgramsAny program in the project that requires the use of any of the scheduling functions must have the following header included at the top of the program:

#include "schdric.h"

ConCentRICs for Windows RIC Corp Class Libraries Scheduling Class Library · 153

Page 163: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

Event FilesThe following chart shows the event files that are used for all the event data.

Description Template Filename

Event Master cEVENTFILE EVNTFILE.SYS

Event References cEVNTREF EVNTREF.SYS

Event Date Blocks cDATEBLK EVNTDATE.SYS

Client Contacts cCODEREF EVNTCLNT.SYS

Staff Contacts cCODEREF EVNTPERS.SYS

Event Audit cEVNTAUDT EVNTAUDT.SYS

Client Use Days cUSEDAY USEDAY.SYS

Event Notes cEVNTNOTE EVNTNOTE.SYS

Event Locations cEVNTLOC EVNTLOC.SYS

Location Items cLOCITEM LOCITEM.SYS

Event Calendar cEVNTCAL EVNTCAL.SYS

Check Lists cCKLIST CKLIST.SYS

Attendance per Day CEVNTQTY EVNTQTY.SYS

Text Fields CEVNTNOTE EVNTNOTE.SYS

Standard Event FieldsThere are several event fields that some projects needs to use as constants, but the user can set them to any table entry they defined. The project can retrieve these values by using the following function:

long key = code.CodeLong(4, 32005, <type>);

where type is the constant value desired. The chart below shows all of the appropriate values for the type parameter.

Type Event Constant

1 Main Event Contact

2 Contract Person

3 Invoice/Bill to Person

4 Sales Person

5 Event Manager

6 Food Person

7 Cross Reference Event

8 Initial Attendance

9 Attendance per Session

11 Tax Exempt

12 Hotel Rooms

154 · Scheduling Class Library ConCentRICs for Windows RIC Corp Class Libraries

Page 164: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

13 Tax Exempt Number

14 Type of Event

15 Decorator

16 Public Event

Data Formats

Event Key1 Event Id

2 File Year

3 Event Year

Booking Status TypesCRicCode code;

long type = code.CodeLong(4, 30001, <booking status code>, 0);

If you want to get the type from the file then use the field codefile.GetTABLE(). The value of type will be the following:

0 No longer valid

1 Definite

2 Tentative

3 Internal

4 No Commitment

5 Hard Cancel

6 Soft Cancel

LocListRIC with tabs1 Short Desc

2 Description

3 Location Key

4 Priority

LocListRIC no tabs1 Short Desc – Description

2 Location Key

3 Priority

ConCentRICs for Windows RIC Corp Class Libraries Scheduling Class Library · 155

Page 165: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

Tie Project to an Event

IntroductionThe items in this section are required if all the options in your project are dependent on a single event being selected. You must have previously completely the items in the section called Application Connection before you can complete the steps in this section.

Main HeaderIn your project's main header file (XXXX.H) add the current event structure:

Add the current event structure just before the following line:

class CSystApp : public CWinApp

Type the structure as it appears below:

struct CurrentEvent

{

long EventId;

int EventYear;

int FileYear;

CString YearDir;

CString Title;

CString Restrict;

BOOL MaintSwt;

};

Main ProgramIn the application's main program (XXXX.CPP) add the following line immediately after all the blue lines:

CurrentEvent curevent;

In the same program the following line will appear twice.

if (!user.SecurityRIC(X, "XXXX", &hLangInst)) return FALSE;

Add the following lines after both occurances of the above line:

curevent.EventId = -1;

curevent.EventYear = curevent.FileYear = 0;

curevent.YearDir = curevent.Title = "";

Document HeaderIn your project's document header (XXXXDOC.H) add the following function declaration:

void NewEvent();

156 · Scheduling Class Library ConCentRICs for Windows RIC Corp Class Libraries

Page 166: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

Document ProgramIn your project's document program (XXXXDOC.CPP) add the following line immediately after all the "blue" lines:

extern CurrentEvent curevent;

In the function MainInit()

After the lines:

SetModifiedFlag();

doc.IconsPerLineRIC(5);

Add the following lines:

NewEvent();

SetTitle(curevent.Title);

Add the following function to the program:

void CXxxxDoc::NewEvent()

{

int ret, year, usage;

long eventid;

char str[500];

CString file, section, dir, evntname, restrict;

CStringList criteria, userbook;

BOOL valid;

cEVNTREF evntref;

cEVNTFILE evntfile;

cLOCITEM locitem;

file = user.UserPrRIC();

sprintf(str, "EVENT%d", user.OrgNumRIC());

section = str;

GetPrivateProfileString(section, "EVENTID", "0", str, 80, file);

eventid = CharToLongRIC(str);

if (curevent.EventId == eventid) return;

valid = TRUE;

if (eventid == 0)

{

MessageBeep(MB_ICONASTERISK);

if (MessageBox(GetActiveWindow(),

LSRIC(IDS_EM_NOEVENT),

LSRIC(IDR_MAINFRAME),

MB_OKCANCEL | MB_ICONASTERISK) == IDOK)

ConCentRICs for Windows RIC Corp Class Libraries Scheduling Class Library · 157

Page 167: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

valid = FALSE;

}

for (;;)

{

if (!valid)

eventid = EventSearchRIC(NULL, &criteria, 1, FALSE,

TRUE);

if (eventid == 0)

{

if (user.SecurityLevelRIC() < 8) return;

user.LogoutRIC(0);

exit(0);

}

GetPrivateProfileString(section, "FILEYEAR", "0", str, 80, file);

year = CharToIntRIC(str);

dir = user.YearDirRIC(year);

usage = 0;

evntref.JustOpen(dir + "EVNTREF.SYS");

ret = evntref.GetEqualOnREFKEY(eventid, 1, 30001, 0);

if (ret == 0) usage = BookStatUser(evntref.GetVALUE(),

&restrict, &userbook);

if (usage != 3 && usage != 11 && usage != 12) restrict = "";

evntref.Close();

valid = TRUE;

if (usage == 1 || usage == 2) valid = FALSE;

if (usage == 3 || usage == 11)

{

if (restrict != "")

{

if (restrict.GetAt(0) == '0' ||

restrict.GetAt(1) == '0') valid = FALSE;

if (restrict.GetAt(2) == '0' ||

restrict.GetAt(3) == '0') valid = FALSE;

if (restrict.GetAt(0) == '10') valid = FALSE;

}

}

158 · Scheduling Class Library ConCentRICs for Windows RIC Corp Class Libraries

Page 168: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

if (valid)

{

evntfile.JustOpen(dir + "EVNTFILE.SYS");

ret = evntfile.GetEqualOnEVENTID(eventid, 0);

if (ret == 0)

{

sprintf(str, "%s", evntfile.GetAddrNAME());

evntname = str;

evntfile.Close();

break;

}

evntfile.Close();

valid = FALSE;

}

MessageBeep(MB_ICONHAND);

sprintf(str, (const char*) LSRIC(IDS_EM_ENTEREVST),

eventid);

if (MessageBox(GetActiveWindow(), str,

LSRIC(IDR_MAINFRAME),

MB_YESNO | MB_ICONHAND) == IDNO)

{

if (user.SecurityLevelRIC() > 8) break;

user.LogoutRIC(0);

exit(0);

}

}

curevent.EventId = eventid;

GetPrivateProfileString(section, "CALYEAR", "0", str, 80, file);

curevent.EventYear = CharToIntRIC(str);

curevent.FileYear = year;

curevent.YearDir = dir;

curevent.Usage = usage;

curevent.Restrict = restrict;

curevent.MaintSwt = TRUE;

if (usage > 0 && usage < 11) curevent.MaintSwt = FALSE;

else

{

ConCentRICs for Windows RIC Corp Class Libraries Scheduling Class Library · 159

Page 169: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

if (usage == 11 || usage == 12)

{

if (restrict != "")

{

if (restrict.GetAt(0) == '0' || restrict.GetAt(1) ==

'0') curevent.MaintSwt = FALSE;

if (restrict.GetAt(2) == '0' || restrict.GetAt(3) ==

'0') curevent.MaintSwt = FALSE;

if (restrict.GetAt(0) == '10')

curevent.MaintSwt = FALSE;

}

}

}

if (curevent.MaintSwt && user.SecurityLevelRIC() < 5)

{

locitem.JustOpen(dir + "LOCITEM.SYS");

ret = locitem.GetEqualOnITEMKEY(eventid, 0, 0, 0, 0, 0, 0);

if (ret == 0 && locitem.GetAUTO() == 1)

curevent.MaintSwt = FALSE;

locitem.Close();

}

sprintf(str, "%07ld - %s", eventid, (const char*) evntname);

curevent.Title = str;

}

In the same program you may need an Event Inquiry option that will let the user switch events. You may also allow the profile and/or audit to be shown. In that case you will need the following functions:

In your InitDocument function add the following cases to the switch statement:

case 100:

EvntInit();

break;

case 501:

EvntProf();

break;

case 502:

EvntAudit();

break;

In your OnCommandDoc function add the following lines:

160 · Scheduling Class Library ConCentRICs for Windows RIC Corp Class Libraries

Page 170: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

if (object == "EVNT")

{

user.SetFileNumRIC(100);

SendMessage(GetActiveWindow(), WM_COMMAND,

ID_FILE_NEW, 0);

return;

}

if (object == "PROF")

{

user.SetFileNumRIC(501);

SendMessage(GetActiveWindow(), WM_COMMAND,

ID_FILE_NEW, 0);

return;

}

if (object == "AUDT")

{

user.SetFileNumRIC(502);

SendMessage(GetActiveWindow(), WM_COMMAND,

ID_FILE_NEW, 0);

return;

}

In the OnMaintDoc function add the following line:

case 501: return EventUpdateRIC(filekey, GetDocPtr());

In the MainInit function add the following line:

doc.AddIconRIC("EVNT", IDI_ICON_EVNT,

IDS_AP_EVENTINQUIRY, ID_EVNT);

Add the following functions:

// Application code for Event Inquiry

void CXxxxDoc::EvntInit(BOOL search)

{

int result;

result = EventOptionsRIC(GetDocPtr(), search);

NewEvent();

if (result == 1) OnCommandDoc(501, "PROF");

if (result == 2) OnCommandDoc(502, "AUDT);

if (result == 3)

{

ConCentRICs for Windows RIC Corp Class Libraries Scheduling Class Library · 161

Page 171: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

// Kriscka - Add Inits that need to be run after maintenance at this point

}

user.SetFileNumRIC(999);

}

// Application Code for Event Profile

void CXxxx::EvntProf()

{

CString title;

title = EventProfileRIC(GetDocPtr());

SetTitle(LSRIC(IDS_AP_EVENTPROFILE));

user.LogputRIC(title);

}

// Application Code for Event Audit

void CXxxx:EvntAudit()

{

CString title;

title = EventAuditRIC(GetDocPtr());

SetTitle(title);

user.LogputRIC(title);

}

View ProgramIn your project's view program (XXXXVIEW.CPP) add the following line immediately after all the "blue" lines:

extern CurrentEvent curevent;

In the function OnSelectRec(int recnum)

After the lines:

if (vw.m_icon)

{

pDoc->OnIconDoc(recnum);

Add the line:

pDoc->SetTitle(curevent.Title);

Scheduling Functions

Introduction

162 · Scheduling Class Library ConCentRICs for Windows RIC Corp Class Libraries

Page 172: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

The Scheduling library provides functions that will perform must of the common things you need to do with the Scheduling System. These functions will allow any application to perform Scheduling activities with out having to know anything about the inner workings of the Scheduling Application.

The Scheduling Library is made up of several classes. You do not interface with any of the classes directly. All of the scheduling functions are exported functions. These functions will use the appropriate scheduling classes automatically. Your only interface is with the exported functions.

Each of the available functions is listed below. The rest of this section describes each of the functions in detail.

Function Description

AutomaticCheckLists Generate appropriate predefined checklist items

AutomaticInvRIC Generate appropriate predefined inventory items

BookingDefaults Performs the mainteance to set user’s defaults

BookStatUser Returns the user’s booking status access level

DateSelection Will allow the user to select various date ranges

EventAuditRIC Produce the Event Audit for the current event

EventMaintRIC Perform maintenance on the current event

EventOptionsRIC Presents SPAM options for current event

EventProfileRIC Produce the Event Profile for the current event

EventSearchRIC Retrieves a single or range of events

EventSelectedRIC Changes to a new current event

EventUpdateRIC Update an Event and reproduce the Profile

EventYearRIC Calculates event year for any event

FindConflicts Searches for conflicts for specified location

GetEventsRIC Allows user select any number of events

InvDialogRIC Maintain Equipment/Services for an event

InvRateDescRIC Shows how rate is calculated for inventory item

InvRateRIC Calculates rate for an inventory item

IsValidYear Determines if a specified year is an event year

ListConflicts Will display the conflicts that were found

LoadValidYears Returns a list of all valid event years

LocComboRIC Loads a combo box with valid locations

LocListBoxRIC Loads a list box with valid locations

LocListRIC Returns a list of all valid locations

LocRateDescRIC Shows how a rate is calculated for a location

LocRateMaintRIC Allows the user to maintain a rate schedule

LocRateRIC Calculates rate for a specified location

LocValidRIC Determines if a user can access a location

ConCentRICs for Windows RIC Corp Class Libraries Scheduling Class Library · 163

Page 173: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

SchdBasicHelp Shows Help for common scheduling functions

SearchCodesRIC Allows access to the Selection Criteria dialog

SetEventCodesRIC Performs Event Client / Staff dialog box

SetMaintRIC Sets the maintenance levels appropriate for user

TraceCreateRIC Shows the user the Trace Control Box

UpdateCheckLists Will show list of check lists to be completed

AutomaticCheckListsvoid AutomaticCheckLists(id, dir, oldbs);

long id; // Event Id

CString dir; // Directory for the specified event

long oldbs; // Original Booking Status code

The AutomaticCheckLists function will generate any appropriate predefined check list items for the specified event. The event id parameter needs to contain the id of the specified event. The dir parameter needs to be the directory path used for the files for this event. The oldbs parameter is optional. Set it to zero and all items will be generated based on the current event status. If the event's booking status has changed within your option, then set this parameter to the original booking status before the change. This will allow all items based on the old status to be automatically completed.

AutomaticInvRICvoid AutomaticInvRIC(eventid, dateblk, lockey, items, dates);

long eventid; // Event Id

int dateblk; // Date Block number

long lockey; // Location Id number

CStringList* items; // Pointer to items attached to location

CString dates; // Dates of the booked location

The AutomaticInvRIC function will generate any predefined inventory items for the specified location. The Event id parameter needs to be set with the id of the specified event. The dateblk and lockey parameters need to be set to the same values for the selected location in the specified event. The items parameter contains all of the items currently attached to the location, in the format produced by Event Maintenance. The routine will use these to check that the predefined items do not already exist, and it will place any newly created items in this variable. It is up to the calling routine to write these back to the appropriate event files. The dates parameter have the dates of the dateblock in their standard format as produced by Event Maintenance.

BookingDefaultsvoid BookingDefaults();

The BookingDefaults function will perform all the maintenance required for a user to set their personal booking defaults value. It will bring up the actual event maintenance statistics dialog box. The mandatory fields will be limited to booking

164 · Scheduling Class Library ConCentRICs for Windows RIC Corp Class Libraries

Page 174: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

status code and rate code. The values set will be saved for that particular user. When ever that user books a new event these values will be filled in as the default values.

BookStatUserint BookStatUser(bookstat, restrict, datalist);

long bookstat; // Booking Status code to be checked

CString* restrict; // Pointer to data field to pass back restrictions

CStringList* datalist; // Pointer to list so program can run faster

The BookStatUser funciton will return the access level the current user has to the booking status code that is passed in the bookstat parameter. If the user has any restrictions they are passed back in the restrict parameter. The system needs to look up in a datafile the user’s access levels. It will store those in the datalist parameter. Pass this routine an empty CStringList and it will fill it with the appropriate entries. It will use this list for each one it needs to lookup after that. If your application needs to look up the level a lot, you may want to make this a global parameter so all the routines can use the same list.

The returned value indicates the access level the current user has with the booking status code. The chart below shows the possible values:

Returned Value Access Description

0 Full Access

1 Do not Show

2 Show as Unavailable

3 Show with restricted data

4 Show All but no Maintenance

11 Show with restricted data and restricted Maintenance

12 Show All but restricted Maintenance

13 Show All and All Maintenance except booking status code

If the booking status access contains restrictions on show or maintenance then the restrict parameter will contain those settings. This will contain a string of 30 characters. Each character will contain either a 0 or a 1. A 1 indicates that the data is available and a value of 0 would indicate that it is not available. Any character not yet in use will be preset to 1. The list belows shows what each character represents currently:

0 Event Statistics

1 Staff Contacts

2 Client Contacts

3 Locations

4 Food

5 Equipment / Services

6 Checklists

ConCentRICs for Windows RIC Corp Class Libraries Scheduling Class Library · 165

Page 175: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

7 Daily Quantities

8 Attached Objects

9 Event Comments

10 Money values

11 Rental Descriptions

DateSelectionBOOL DateSelection(datelist, init, numdays=0);

CStringList* datelist; // Pointer to list containing resulting date ranges

CString* init; // Pointer to Initialization string

int numdays; // Number of days

The DateSelection funciton will call up the same dialog box as Calendar Search Best Fit date selection. It will allow the user to select a large variety of date ranges. The date ranges selected by the user will be placed in the datelist variable. You may then use these dates in your project. You need to create an empty CString variable for init and then save it if this funciton can be recalled. By saving the results of this variable and passing it back to this routine, then the dialog box will be redisplayed the same way it appeared the last time it was used. The numdays parameter is optional. If you would like to restrict the date range selected by the user to a specific number of days, then set this paramater to that number of days. If you set this parameter to zero, then the user can select the number of days. This routine will return TRUE if dates were selected or FALSE if they canceled without selected dates.

Each entry in the datelist parameter will have two fields separated by a tab, the first field is start date, and the second field is end date. The int paramater has the following fields separated by tabs: 1 = Start Date, 2 = End Date, 3 = Number of days, 4 - 15 = Month settings, 16 - 19 = Week Settings, and 20-26 Day settings.

EventAuditRICCString EventAuditRIC(doc);

CRicDoc* doc; // Pointer to the Document's CRicDoc class

The EventAuditRIC function will produced the Event Audit for the currently selected event. You must supply the doc parameter, and you get this from your GetDocPtr function in your projects XXXXDOC.CPP program. This is indented to be called from a standard doc program init function. You can change the currently selected event with the EventSelectedRIC function.

EventMaintRICvoid EventMaintRIC(type=0, newevent=FALSE, prebook=NULL);

int type; // Type of Maintenance activity

BOOL newevent; // Indicates if this is a brand new event

CStringList* prebook; // Pointer to all values to use for booking process

166 · Scheduling Class Library ConCentRICs for Windows RIC Corp Class Libraries

Page 176: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

The EventMaintRIC function will bring up the standard event maintenance dialog boxes. The type indicates what maintenance activity will be performed. See the chart below for a list of the valid maintenance types. You should set the newevent parameter to FALSE and the prebook parameter to NULL in most cases. If you have a brand new event then you set newevent to TRUE, and fill in the prebook list will all of the data that you would like the new event to be started with.

Type Maintenance Activity

0 User selects any event maintenance activity

1 Statistics

2 Dates

3 Clients

4 Staff

11 Locations

12 Inventory

13 Food

14 Notes (51=Comments, 52=Critique, 53=Cancel notes)

15 Checklists

16 Quantities

17 Rate Adjustment

18 Misc.

21 Rebook

22 Cancel Event

23 Cross Reference

24 Produce Contract

25 Attached Objects

99 Rebuild Calendar

EventOptionsRICint EventOptionsRIC(doc, search=TRUE);

CRicDoc* doc; // Pointer to the document's CRicDoc class

BOOL search; // Indicates that a search is allowed

The EventOptionsRIC function will bring up the standard event options dialog box. The users have nicknamed this the SPAM screen based on the Event Options that can be selected. The available options are Snap Shot, Profile, Audit, and Maintenance. This will be displayed for the currently selected event. You can change the currently selected event with the EventSelectedRIC function. You must pass this function the CRicDoc class from your XXXXDOC.CPP program, and you can get this with the GetDocPtr function. Set the search parameter to TRUE if the user can search for a new event, or FALSE if they can only use the selected event. This function will return the option that the user selected. A 1 indicates Event Profile, 2 indicates Event Audit. It is the responsibility of the calling application to fulfill these requests. A return of 3 indicates that maintenance was performed. If

ConCentRICs for Windows RIC Corp Class Libraries Scheduling Class Library · 167

Page 177: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

you called this function from a report, you may need to regenerate the report to show the maintenance that was performed. The snap shot option is handled internally and does not return a value. The returned value will be zero (0) if the user pushes the Cancel button. See the Event Inquiry for example of how this command is normally used.

EventProfileRICCString EventProfileRIC(doc, type=0);

CRicDoc* doc; // Pointer to the document's CRicDoc class

int type; // Section number of profile to display

The EventProfileRIC function will produced the Event Profile for the currently selected event. You must supply the doc parameter, and you get this from your GetDocPtr function in your projects XXXXDOC.CPP program. This is indented to be called from a standard doc program init function. You can change the currently selected event with the EventSelectedRIC function. The type parameter indicates which section of the profile is produced. The chart below shows all of the possible values of this parameter.

Type Profile Section

0 Entire Profile based on user settings

1 Statistics

2 Staff

3 Client

4 Locations

5 Food

6 Inventory

7 Check Lists

8 Daily Attendance

21 Comments

22 Critiques

23 Cancel Comments

EventSearchRIClong EventSearchRIC(doc, criteria, type, rerun=FALSE, full=FALSE);

CRicDoc* doc; // Pointer to the document's CRicDoc class

CStringList* criteria; // Pointer to list of selection criteria information

int type; // Type of Search to be performed

BOOL rerun; // Indicates first time or rerun situation

BOOL full; // Indicates a full search or just search data

The EventSearchRIC function will allow the user to select a single event or a range of events. The standard Event Search dialog box will be used. You must set

168 · Scheduling Class Library ConCentRICs for Windows RIC Corp Class Libraries

Page 178: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

the doc parameter to the CRicDoc class, which you can get from your XXXXDOC.CPP program using the GetDocPtr function. You must provide a CStringList variable to be used for the selection criteria. If you need to rerun the search, with the same parameters, then you must save this parameter.

The type parameter indicates which search type will be used, 1 for Event and 2 for Calendar. If you send a –1 or –2 you will get an Event or Calendar Search respectively, but no Search on Statistics button will not be available. A type of 21 will give you a standard Event Search but a Search by Food Id button will be available.

The first time you run this function set rerun to FALSE. If you need to run the search again with the same parameters set this to TRUE and pass the same CStringList back in the criteria parameter. If you would like a single event back from the search then enter TRUE for full, if you would like a list of events back then enter FALSE for the full parameter. The function will then return the selected Event Id.

EventSelectedRICvoid EventSelectedRIC(eventid, fileyear, eventyear);

long eventid; // Event id

int fileyear; // File year for the Event

int eventyear; // Event Year for the Event

The EventSelectedRIC function will allow you to change the currently selected event. Pass the eventid, fileyear, and event year of an event, and this event will become the currently selected event. Anytime you have an eventid you should also have the fileyear and eventyear. The fileyear is the actual directory that contains the event's file, and the eventyear is the actual calendar year of the event. In most cases these two parameters will be the same, unless it is an overflow event.

EventUpdateRICBOOL EventUpdateRIC(key, doc=NULL);

CString key; // Key to the Event

CRicDoc* doc; // Pointer to the document's CRicDoc class

The EventUpdateRIC function will perform full event maintenance on an event, which is not based on the currently selected event. It will use the event specified in the key parameter. This is made up of three fields separated by tabs. These are the event id, fileyear, and eventyear. You can set the doc parameter to NULL, and only maintenance will be performed. If you set this to your document's CRicDoc class using the GetDocPtr function, then the document will be cleared and the profile for the event regenerated if any maintenance was performed.

EventYearRICint EventYearRIC(eventid);

long eventid; // Event Id

The EventYearRIC function will return the event year for the eventid provided. This is not necessarily the fileyear, but you can get that by passing the event year to the user.YearDirRIC(<event year>) function.

ConCentRICs for Windows RIC Corp Class Libraries Scheduling Class Library · 169

Page 179: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

This function might not work properly for the special user events which end in 000. These can appear in any event year, so when these events are passed, the function will return the current event year.

FindConflictsint FindConflicts(eventid, dateblk, lockey, sdate, edate, conlist);

long eventid; // Event Id

long dateblk; // Dateblock of current location

long lockey; // Location number of current location

CRicDate sdate; // Starting date for the conflict check

CRicDate edate; // Ending date for the conflict check

CStringList* conlist; // Pointer to a list of resulting conflicts

The FindConflicts function will search the calendar for any conflicts with the event and location provided. The event provided will not be returned as a conflict, unless the new location will overlap an existing location. The eventid, dateblk, and lockey parameters are all from the selected location to be checked for conflicts. The sdate and edate parameters must be set to the date range that you would like used for the conflict search. Any conflicts that are found will be passed back in the conlist parameter. This routine will display the conflicts automatically if any are found before returning. It is passing these back so you know what the conflicts are. If any conflicts were found then this routine will return a one (1), else it will return zero (0).

You can set the conlist parameter to NULL and the routine will return a status level and will not display the conflicts automatically, but the conflicts will be in the conlist parameter if you wish to display them later using the ListConflicts function. The list will contain an entry for each event in conflict. Each line in this list will contain the following fields separated by tabs: date of conflict, room, booking status, attendance, start time, end time, event id, short event name, \b event id.

GetEventsRICBOOL GetEventsRIC(keys, data, criteria, rerun=FALSE);

CStringList* keys; // Pointer to Keys of selected events

CStringList* data; // Pointer to Data of selected events

CStringList* criteria; // Pointer to the selection criteria

BOOL rerun; // Indicates if this is a first time or rerun

The GetEventsRIC function will perform an Event Search and will return you the keys and data of the selected events. You must provide a CStringList variable to store the selection criteria. If you need to rerun the selection with the same parameters then set rerun to TRUE and pass back the same criteria data, else set rerun to FALSE. This is the function that is used at the beginning of the Calendars project.

The keys will have the following fields separated by tabs: Event Id, File Year, Event Year, \n\nBooking status code color.

170 · Scheduling Class Library ConCentRICs for Windows RIC Corp Class Libraries

Page 180: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

The data will have the following fields separated by tabs: Event id, Booking Status, Start Date, End Date, and Event Name. All of these fields are ready to be displayed.

InvDialogRICvoid InvDialogRIC(locs, pos, items, dates, restrictions=””);

CStringList* locs; // Pointer to list of locations

POSITION pos; // Position of Selected Inventory Item

CStringList* items; // Pointer to

CString date; // Date/Time parameters for the item

CString restrictions; // Any Department restrictions the user has

The InvDialogRIC function will perform the standard maintenance for inventory items, also known as Equipment/Services. The locs, items, and date parameters are filled as required by Event Maintenance. The pos parameter contains the currently selected position in the locs parameter. This routine can make changes to the items parameter, and it is the responsibility of the calling function to update the appropriate event files.

InvRateDescRICCString InvRateDescRIC(dates, effdate, invkey, perf, qty=1, type=NULL);

cDATEBLK* dates; // Pointer to the date record

CRicDate effdate; // Effective date for the rates

long invkey; // Inventory key number for current item

int perf; // Number of Performances

long qty; // Number of Inventory items

long* type; // Pointer to long variable to store rate type

The InvRateDescRIC function will return a written description of how the charge rate was determined for this item. You must look up the dateblock record and pass a pointer to it. The effective date is the date to use for the base prices. The invkey indicates the inventory master item to be charged. The perf parameter indicates the number of performances. The qty parameter should contain the number of items to be charged. This routine will automatically determine what rate type is being used. It will pass this back in the type field if you wish to have that information.

InvRateRICdouble InvRateRIC(dates, effdate, invkey, perf, qty=1, type=NULL);

cDATEBLK* dates; // Pointer to the date record

CRicDate effdate; // Effective date for the rates

long invkey; // Inventory key number for current item

int perf; // Number of Performances

long qty; // Number of Inventory items

long* type; // Pointer to long variable to store rate type

ConCentRICs for Windows RIC Corp Class Libraries Scheduling Class Library · 171

Page 181: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

The InvRateRIC function will return the money amount rate to be charged for this item. You must look up the dateblock record and pass a pointer to it. The effective date is the date to use for the base prices. The invkey indicates the inventory master item to be charged. The perf parameter indicates the number of performances. The qty parameter should contain the number of items to be charged. This routine will automatically determine what rate type is being used. It will pass this back in the type field if you wish to have that information.

IsValidYearBOOL IsValidYear(list, year);

CWordArray* list; // Pointer to a list of valid event years

int year; // Event year to be tested

The IsValidYear function will determine if the year parameter is a valid event year. This function will return TRUE if it is and FALSE if it is not. All years are valid so all this really indicates that the overflow area should be used. You must provide this routine with the list of valid years. You can get the list parameter by using the LoadValidYears function.

ListConflictsBOOL ListConflicts(conflicts, title);

CStringList* conflicts; // Pointer to a list of the conflicts themselves

CString title; // Title to use for the conflict dialog box

The ListConflicts function will list the events contained in the conflicts parameter. This parameter is generated by the FindConflicts function. The events are shown in a dialog box. It will display the title parameter in the title bar for this dialog box.

LoadValidYearsvoid LoadValidYears(list);

CWordArray* list; // Pointer to a list to hold resulting years

The LoadValidYears function will list each of the defined event years for the current organization and place them in the list parameter. This is just a numeric list of years.

LocComboRICvoid LocComboRIC(cbox, lockey, auth=TRUE, maint=FALE, tabs=FALSE,

single=0);

CComboBox* cbox; // Pointer to Combo box to be loaded

long lockey; // Key to the location to be preselected

BOOL auth; // Use current authorization code instead of all

BOOL maint; // Maintenance is allowed on the locations

BOOL tabs; // Indicates that tabs will be used between fields

int single; // Indicates only single locations are shown

172 · Scheduling Class Library ConCentRICs for Windows RIC Corp Class Libraries

Page 182: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

The LocComboRIC function will load a combo box with valid locations for the current organization. The cbox parameter should contain the address of the combobox from a dialog box program. The lockey parameter can contain the key of a location to be preselected. If this is set to 0 then the first location will be preselected, and if it is set to -1 then no location will be preselected. Set auth to TRUE if you want the user's currently selected authorization code to be used, set to FALSE for all defined locations. Setting maint to TRUE will display any location that the user is authorized to perform maintenance, it will leave out the read only locations. Set maint to FALSE for any location the user is authorized to view. Set tabs to TRUE if each field is to be separated by tabs, else the fields are spaced. Set single to 0 for single and combination rooms, set it to 1 for only single locations or 3 for locations that only appear on the book.

The format of the resulting location list will have the following fields: Short Location Name, Full Location Name, internal key to the location, and the priority number of the location.

LocListBoxRICvoid LocListBoxRIC(lbox, lockey, auth=TRUE, maint=FALSE, tabs=FALSE,

single=0);

CListBox* lbox; // Pointer to List box to be loaded

long lockey; // Key to the location to be preselected

BOOL auth; // Use current authorization code instead of all

BOOL maint; // Maintenance is allowed on the locations

BOOL tabs; // Indicates that tabs will be used between fields

int single; // Indicates only single locations are shown

The LocListBoxRIC function will load a list box with valid locations for the current organization. The lbox parameter should contain the address of the listbox from a dialog box program. The lockey parameter can contain the key of a location to be preselected. If this is set to 0 then the first location will be preselected, and if it is set to -1 then no location will be preselected. Set auth to TRUE if you want the user's currently selected authorization code to be used, set to FALSE for all defined locations. Setting maint to TRUE will display any location that the user is authorized to perform maintenance, it will leave out the read only locations. Set maint to FALSE for any location the user is authorized to view. Set tabs to TRUE if each field is to be separated by tabs, else the fields are spaced. Set single to 0 for single and combination rooms, set it to 1 for only single locations or 3 for locations that only appear on the book.

The format of the resulting location list will have the following fields: Short Location Name, Full Location Name, internal key to the location, and the priority number of the location.

LocListRICvoid LocListRIC(list, auth=TRUE, maint=FALSE, tabs=FALSE, single=0);

CStringList* list; // Pointer to list to contain resulting locations

BOOL auth; // Use current authorization code instead of all

BOOL maint; // Maintenance is allowed on the locations

ConCentRICs for Windows RIC Corp Class Libraries Scheduling Class Library · 173

Page 183: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

BOOL tabs; // Indicates that tabs will be used between fields

int single; // Indicates only single locations are shown

The LocListRIC function will load a CStringList with valid locations for the current organization. The list parameter should contain the address of a CStringList variable that you define. Set auth to TRUE if you want the user's currently selected authorization code to be used, set to FALSE for all defined locations. Setting maint to TRUE will display any location that the user is authorized to perform maintenance, it will leave out the read only locations. Set maint to FALSE for any location the user is authorized to view. Set tabs to TRUE if each field is to be separated by tabs, else the fields are spaced. Set single to 0 for single and combination rooms, set it to 1 for only single locations or 3 for locations that only appear on the book.

The format of the resulting location list will have the following fields: Short Location Name, Full Location Name, internal key to the location, and the priority number of the location.

LocRateDescRICCString LocRateDescRIC(dates, effdate, lockey, rate, sqft, perf, eventid, dir);

cDATEBLK* dates; // Pointer to the date record

CRicDate effdate; // Effective date for the rates

long lockey; // Location key number for current location

long rate; // Rate key number for the current rate schedule

long sqft; // Number of Square Feet/Meets for rate use

int perf; // Number of Performances

long eventid; // Event Id

CString dir; // Directory were the current event data is found

The LocRateDescRIC function will return a written description of how the charge rate was determined for this location. You must look up the dateblock record and pass a pointer to it. The effective date is the date to use for the base prices. The lockey indicates the location master item to be charged. The rate parameter indicates the rate code to be charged. The sqft parameter should contain the net square footage of the room. This is only needed for Square Foot rates and can be set to zero otherwise. The perf parameter indicates the number of performances. The event id and dir are optional and can be set to zero and NULL if no real event is involved as is the case with the Rate Calculator function. If you are calculating a rate for a real location attached to an event, then pass the event id, and the directory that contains the event files. This will allow any rate adjustments to be picked up.

LocRateMaintRICint LocRateMaintRIC(file, delete, key);

cRATEFILE* file; // Pointer to open rate file

BOOL delete; // Indicates delete is allowed

CString key; // Key to the rate record

174 · Scheduling Class Library ConCentRICs for Windows RIC Corp Class Libraries

Page 184: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

The LocRateMaintRIC function will perform all of the functions necessary to update a rate code itself. You need to open the file and pass it as the file parameter. You can set delete to TRUE if the user can delete a rate schedule or FALSE if they can only do maintenance. The key field will contain the value of the rate schedule to be maintained.

LocRateRICdouble LocRateRIC(dates, effdate, lockey, rate, sqft, perf, eventid, dir);

cDATEBLK* dates; // Pointer to the date record

CRicDate effdate; // Effective date for the rates

long lockey; // Location key number for current location

long rate; // Rate key number for the current rate schedule

long sqft; // Number of Square Feet/Meets for rate use

int perf; // Number of Performances

long eventid; // Event Id

CString dir; // Directory were the current event data is found

The LocRateRIC function will return the money amount to be charged for this location. You must look up the dateblock record and pass a pointer to it. The effective date is the date to use for the base prices. The lockey indicates the location master item to be charged. The rate parameter indicates the rate code to be charged. The sqft parameter should contain the net square footage of the room. This is only needed for Square Foot rates and can be set to zero otherwise. The perf parameter indicates the number of performances. The event id and dir are optional and can be set to zero and NULL if no real event is involved as is the case with the Rate Calculator function. If you are calculating a rate for a real location attached to an event, then pass the event id, and the directory that contains the event files. This will allow any rate adjustments to be picked up.

LocValidRICint LocValidRIC(lockey, authkey, maint, onbook, codefile, coderef, codedata);

long lockey; // Location key number

long authkey; // Number of selected Authorization Key number

BOOL maint; // Indicates that maintenance is allowed

BOOL onbook; // Indicates that the location must be on the book

cCODEFILE* codefile; // Pointer to open codefile file

cCODEREF* coderef; // Pointer to open coderef file

cCODEDATA* codedata; // Pointer to open codedata file

The LocValidRIC function will verify that a location is valid for a user. Set the lockey to the location key being checked. The authkey should be set to the users current authorization key or 0 for all locations. Set Maint to be TRUE if the user can perform maintenance and all read-only rooms will be invalid. Set onbook to

ConCentRICs for Windows RIC Corp Class Libraries Scheduling Class Library · 175

Page 185: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

TRUE if the location must be on the book. Open the codefile, coderef, and codedata files, and pass the pointers to this function.

This function will return the priority of the location if it is valid. It will return a -1 if the location is not valid.

SchdBasicHelpBOOL SchdBasicHelp(data, cmd);

DWORD data; // Help Context Id number

UINT cmd; // Help command to be executed

The SchdBasicHelp function will show the general scheduling help. The data parameter will have the help context id number. The cmd parameter will contain the help command to be used. See the WINHELP command for the valid parameters.

SearchCodesRICvoid SearchCodesRIC(type, key, list);

int type; // Type of Search

long* key; // Pointer to the search key

CStringList* list; // Pointer to the search criteria

The SearchCodesRIC function will perform the Search Selection Criteria dialog box. Set type to 1 for event and 2 for location. If you want a predefined selection criteria set the number of it in the key field, or set it to zero for a new search. The list parameter will contain the search criteria.

SetEventCodesRICvoid SetEventCodesRIC(type, title, dir);

int type; // Type of Event Code to be set

CString title; // Title of the Code

CString dir; // Directory of the code to be set

The SetEventCodesRIC function will perform the Event Client/Staff maintenance dialog box. Over time it has become many other things. The type parameter will determine the action of the dialog box, see the chart below.1 = Event Reference, 2 = Clients, and 3 = Staff. The title will be the one displayed in the dialogs title bar. The directory is set to the organization directory for type 1, and the year directory for the other types.

Type Maintenance Activity

1 Event References

2 Clients

3 Staff

4 Locations

5 All Locations with Ini

176 · Scheduling Class Library ConCentRICs for Windows RIC Corp Class Libraries

Page 186: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

6 Single Locations with Ini

SetMaintRICint SetMaintRIC(doc, type=0);

CRicDoc* doc; // Pointer to the document's CRicDoc class

int type; // Type of maintenance to be set

The SetMaintRIC function will control the maintenance abilities of the user based on their security in Scheduling Administration. You need to pass the projects CRicDoc class pointer, which you can get from your XXXXDOC.CPP program using the GetDocPtr function. The chart below will show the possible values of the type parameter and the results that are returned.

Type Returned Value or Result

0 The document will have the maintenance section set automatically and a zero will be returned.

1 The security level required for an add will be returned.

2 The security level required for a change will be returned.

3 The security level required for a delete will be returned.

9 Will return the security level the current user has in the Schedule Administration application.

TraceCreateRICvoid TraceCreateRIC(trace, pView);

TraceRIC* trace; // Pointer to a TraceRIC object

CView* pView; // Pointer to the Document’s View object

The TraceCreateRIC function will bring up the Trace Control dialog box for the user logged in. You must first declare a TraceRIC object and pass it to this function along with the view’s object. This would need to be placed in your applications view program.

UpdateCheckListsvoid UpdateCheckLists(eventid, dir, type);

long eventid; // Event id

CString dir; // Directory where current event data is located

int type; // Type of automatic update to be performed

The UpdateCheckLists function will display a dialog box that will allow the users to see a list of all check lists that can be completed by the specified type. Type can have the following values: 0=None, 1=Booking Status Upgrade, 2=Contract Creation, 3=Deposit Received, 4=Event Document Publication and 5=Insurance Paid.

ConCentRICs for Windows RIC Corp Class Libraries Scheduling Class Library · 177

Page 187: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

The user can then select any item to be maintained. The event id needs to be set to the event to be checked. The directory is the pathname that contains all the files for this event.

178 · Scheduling Class Library ConCentRICs for Windows RIC Corp Class Libraries

Page 188: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

Accounting Class Library

Overview

IntroductionThe RIC Corp Accounting Library will contain all of the common accounting functions that are used by all applications. These functions include such things as Fund Control, Accounting Year Control, Accounting Parameter information, Account Number Control, Accounting Help, and all aspects of Journals from sending transactions to the journals through to the final posting of the journal.

Tie Project to AccountingWith the RIC Corp base libraries, all the functions are available immediately because the base library header is automatically included in your project. You added the base library itself when you initally built the project. The Accounting library must be added manually the first time. The instructions for this are in two separate sections. The first section called Tie Project to Accounting is used any time a project needs access to any of the accounting functions. The second section called Journal Postings is used when your project needs an option to post a journal.

Accounting FunctionsThe Accounting library provides functions that will perform must of the common things you need to do with the Accounting System. These functions will allow any application to perform Accounting activities with out having to know anything about the inner workings of the Accounting Application. Each of the functions are described in detail in their own section.

Accounting MethodsYou can retrieve the accounting method in use by using the AcctMethodRIC function. You can also get the method by looking it up on the codefile. Here is an example of how to look it up in the codefile.

int method;

cCODEFILE codefile;

codefile.JustOpen(acct.FundPathRIC() + “CODEFILE.SYS”);

ConCentRICs for Windows RIC Corp Class Libraries Accounting Class Library · 179

Page 189: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

ret = codefile.GetEqualOnCODEKEY(12, 32001, 1, 0);

if (ret == 0) method = codefile.GetPRIORITY();

Method can have any of the following values:

1 Cash

2 Accural

3 Modified Accural (Dixie Accounting)

Tie Project to Accounting

IntroductionThe items in this section are required when ever a project needs to use the Accounting library. You would perform these steps only once in the life time of your project. Once you complete these items you will be able to use the functions in the accounting libarary anywhere in your project. The functions themselves are detailed in their own chapter.

Project ResourcesYou must first include the accounting resources into your project. This is one of the items you must do separately for the 32-bit version, and again for the 16-bit version.

32-bit ResourcesSelect View menu and choose Resource Includes…

In the Read-Only Symbol Directives box add this line at the bottom of the box: #include "acctres.h"

In the Compile-Time Directives box add this line after the #include ricres.rc line: #include "acctres.rc" // RIC Corp accounting resources

Push the OK button

You will get a Microsoft Developer Studio warning box, push the OK button.

Open the project's resources

Push the + in front of the the Menu folder

Double-click on the IDR_XXXXTYPE object

Add the following items to the Options menu, between Organization and Fonts: ID = ID_CHGFUND Caption = &Change Fund… Prompt = < blank > ID = ID_CHGYEAR Caption = Change &Year… Prompt = < blank >

Add the following item to the Help menu, between What's This? and ConCentRICs: ID = ID_ACCTBASIC Caption = Accounting &Basics…

Save and Close the resources

16-bit ResourcesStart App Studio

180 · Accounting Class Library ConCentRICs for Windows RIC Corp Class Libraries

Page 190: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

On the File Menu, select the Set Includes… option

In the Read-Only Symbol Directives box add this line at the bottom of the box: #include "actres16.h"

In the Compile-Time Directives box add this line after the #include ricres16.rc line: #include "actres16.rc" // RIC Corp accounting resources

Push the OK button

You will get a Microsoft Developer Studio warning box, push the OK button.

In type: Menu Resource, select IDR_XXXXTYPE

Add the following items to the Options menu, between Organization and Fonts: ID = ID_CHGFUND Caption = &Change Fund… Prompt = < blank > ID = ID_CHGYEAR Caption = Change &Year… Prompt = < blank >

Add the following item to the Help menu, between What's This? and ConCentRICs: ID = ID_ACCTBASIC Caption = Accounting &Basics…

Close and Save App Studio

Library FileYou must add the Accounting Library to your project. You must do this in both the 32-bit and 16-bit versions of your project.

32-bit LibraryOn the Build Menu, select Settings…

Select the Link tab

Add acct.lib to the end of the library list

16-bit LibraryOn the Options Menu, select Project…

Push the Linker… button.

Add acct to the end of the library list

Main HeaderIn your project's main header file (XXXX.H) make the following changes:

After the line: #include "ricd.h"

Add the line: #include "acct.h"

After the line: afx_msg void OnHelp();

Add the line: afx_msg void OnAcctbasic();

Main ProgramIn your project's main program file (XXXX.CPP) make the following changes:

After all the "blue" lines add the following:

Add the line: extern CRicAcct acct;

After the line: ON_COMMAND(ID_HELP, OnHelp)

ConCentRICs for Windows RIC Corp Class Libraries Accounting Class Library · 181

Page 191: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

Add the line: ON_COMMAND(ID_ACCTBASIC, OnAcctbasic)

In the same program the following line will appear twice.

if (!user.SecurityRIC(X, "XXXX", &hLangInst)) return FALSE;

Add the following lines after both occurances of the above line:

if (!acct.AcctStartRIC()) return FALSE;

In the Win Help function after the line: DWORD helpid = data;

Add the line: if (acct.AcctBasicHelp(helpid, cmd)) return;

Add the following function at the end of the program:

void CEvstApp::OnAcctbasic()

{

acct.AcctBasicHelp(131292, HELP_CONTENTS);

}

Document ProgramIn your project's document program (XXXXDOC.CPP) make the following changes:

After all the "blue" lines add the following:

extern CRicAcct acct;

In the function OnMigrateDoc(CString title)

Make the following change ONLY if your project has any migration files that are fund/year based.

Before the line: dlg.m_Pathdir = user.PathDirRIC();

Add the lines: dlg.m_FundNum = acct.FundRIC();

dlg.m_FundDir = acct.FundPathRIC();

In the function MainInit()

Add else to the beginning of line: SetTitle(LSRIC(IDS_AP_MAIN));

then before it add the following lines:

acct.m_ChgMode = FALSE;

if (acct.AcctsValidRIC())

SetTitle(LSRIC(IDS_AP_MAIN) + " - " + acct.AcctNameRIC());

NOTE: From this point you can use the function acct.AcctsValidRIC(). It will return TRUE if accounting is active and valid. It will be FALSE if you should not use any accounting functions.

View HeaderIn your project's view header file (XXXXVIEW.H) make the following changes:

After the line: afx_msg void OnSetFocus(CWnd* pOldWnd);

Add the following lines:

afx_msg void OnChgfund();

182 · Accounting Class Library ConCentRICs for Windows RIC Corp Class Libraries

Page 192: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

afx_msg void OnUpdateChgfund(CCmdUI* pCmdUI);

afx_msg void OnChgyear();

afx_msg void OnUpdateChgyear(CCmdUI* pCmdUI);

View ProgramIn your project's view program file (XXXXVIEW.CPP) make the following changes:

After the line: extern FindRIC find;

Add the line: extern CRicAcct acct;

In the Message Map

After the line: ON_WM_SETFOCUS();

Add the lines: ON_COMMAND(ID_CHGFUND, OnUpdateChgfund)

ON_UPDATE_COMMAND_UI(ID_CHGFUND, OnUpdateChgfund)

ON_COMMAND((ID_CHGYEAR, OnUpdateChgyear)

ON_UPDATE_COMMAND_UI(ID_CHGYEAR, OnUpdateChgyear)

In the function OnDraw(CDC* pDC)

Before the line: vw.OnDrawRIC(pDC);

Add the following lines:

if (vw.m_Doc->FileNumRIC() == 0 && acct.m_ChgMode)

{

vw.m_Doc->DelDocRIC();

pDoc->MainInit();

Invalidate();

}

In the function OnContextMenu(CWnd* pWnd, CPoint point)

After the line: CStringList appitems;

Add the line: acct.AcctContextMenuRIC(&appitems);

Add the following functions:

void CXxxxView::OnChgfund()

{

acct.ChgFundYearRIC(1);

if (vw.m_Doc->FileNumRIC() == 0 && acct.m_ChgMode) Invalidate();

}

void CXxxxView::OnUpdateChgfund(CCmdUI* pCmdUI)

{

pCmdUI->Enable(acct.FundStateRIC());

}

ConCentRICs for Windows RIC Corp Class Libraries Accounting Class Library · 183

Page 193: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

void CXxxxView::OnChgyear()

{

acct.ChgFundYearRIC(2);

if (vw.m_Doc->FileNumRIC() == 0 && acct.m_ChgMode) Invalidate();

}

void CXxxxView::OnUpdateChgyear(CCmdUI* pCmdUI)

{

pCmdUI->Enable(acct.YearStateRIC());

}

Journal Postings

IntroductionThe items in this section are required if all the options in your project are dependent on a single event being selected. You must have previously completely the items in the section called Application Connection before you can complete the steps in this section.

Project ResourcesYou must first include the accounting resources into your project. This is one of the items you must do separately for the 32-bit version, and again for the 16-bit version.

Copy the following icons from the model resource file:

IDI_POSTDLG

IDI_POSTING

Open the IDR_XXXXTYPE menu resource and add the following to your Modules Menu:

ID = ID_POSTJRNL Caption = &Post Journal… Prompt = < blank >

Document HeaderIn your project's document header file (XXXXDOC.H) make the following changes:

Move MainInit from // Operations Private to // Operations Public

Add the following function declarations:

void PostJournal();

void JrnlSum();

After the line: afx_msg void OnLogout();

184 · Accounting Class Library ConCentRICs for Windows RIC Corp Class Libraries

Page 194: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

Add the lines: afx_msg void OnPostjrnl();

Document ProgramIn your project's document program (XXXXDOC.CPP) make the following changes:

After the line: ON_COMMAND(ID_LOGOUT, OnLogout)

Add the line: ON_COMMAND(ID_POSTJRNL, OnPostjrnl)

In the function CXxxxDoc::~CXxxxDoc()

Add the following lines to the end of the function:

if (acct.m_SumDoc == GetDocPtr())

{

acct.m_HoldJournal = 0;

acct.m_SumDoc = NULL;

}

In the function InitDocument()

Add the following case statements to the switch command:

case 26:

PostJournal();

break;

case 555:

JrnlSum();

break;

In the function OnMaintDoc()

Add the following case statement to the switch command:

case 26:

if (!acct.JournalMaint(filekey, recnum, delmode)) return;

acct.JournalPosting(GetDocPtr(), -2);

UpdateAllViews(NULL);

break;

In the function MainInit()

Add the following line:

doc.AddIconRIC("POSTING", IDI_POSTING,

IDS_AP_JOURNALPOSTING, IDI_POSTING);

Add the following functions:

void CXxxxDoc::PostJournal()

{

CString title;

title = acct.JournalPosting(GetDocPtr(), 1);

ConCentRICs for Windows RIC Corp Class Libraries Accounting Class Library · 185

Page 195: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

// Change the (1) above to your journal number

if (title == "")

{

user.SetFileNumRIC(999);

return;

}

SetTitle(title);

user.LogputRIC(GetTitle());

doc.SetModuleIdRIC(ID_POSTJRNL);

user.SetFileNumRIC(555);

SendMessage(GetActiveWindow(), WM_COMMAND,

ID_FILE_NEW, 0);

}

void CXxxxDoc::JrnlSum()

{

CString title;

title = acct.JournalSummary(GetDocPtr());

SetTitle(title);

doc.SetModuleIdRIC(ID_POSTJRNL);

doc.SetMaintLevelsRIC(0, 2, 0);

}

View ProgramIn your project's view program file (XXXXVIEW.CPP) make the following changes:

In the function OnSetFocus(CWnd* pOldWnd)

Before the line: CScrollView::OnSetFocus(pOldWnd);

Add the lines: if (vw.m_Doc == acct.m_SumDoc && acct.m_ChgSum)

{

acct.m_ChgSum = FALSE;

Invalidate();

}

Accounting Functions

IntroductionThe Accounting library provides functions that will perform must of the common things you need to do with the Accounting System. These functions will allow any

186 · Accounting Class Library ConCentRICs for Windows RIC Corp Class Libraries

Page 196: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

application to perform Accounting activities with out having to know anything about the inner workings of the Accounting Application.

The Accounting Library is a true class that is defined at the beginning of your project. This allows the selection of the current fund and accounting year when the project first starts to execute. This class is activity for the entire execution of your project. You may then use the class functions anywhere in your project.

Each of the available functions is listed below. The rest of this section describes each of the functions in detail.

Extraction - Public MembersFunction Description

AcctDebitRIC Returns current accounts debit status

AcctDescRIC Returns full name of current account

AcctKeyRIC Returns the internal key for current account

AcctMethodRIC Returns the accounting method used for fund

AcctNumRIC Returns a formated account number

AcctShortRIC Returns short description of current account

AcctsValidRIC Returns status of accounting connection

AcctTypeRIC Returns the account type of the current account

FirstMonthRIC Returns the first accounting month for fund

FundNameRIC Returns the name of the current fund

FundPathRIC Returns the directory path of the current fund

FundRIC Returns the fund number of the current fund

FundStateRIC Indicates that the current user can change funds

MajorDigitsRIC Returns the number of major digits in format

MinorDigitsRIC Returns the number of minor digits in format

NumberSymbolRIC Returns symbol used between format sections

PostMonthRIC Returns the current posting month for fund

TotalDigitsRIC Returns the totals characters in format display

YearNameRIC Returns the name of the current accounting year

YearPathRIC Returns the directory path of the accounting year

YearRIC Returns the internal number of accounting year

YearStateRIC Indicates the the current user can change years

YearStatusRIC Returns the status of the current accounting year

Implementation - Public MembersFunction Description

AcctBasicHelp Shows the Help for General Accounting

AcctContextMenuRIC Adds accounting options to right click menu

ConCentRICs for Windows RIC Corp Class Libraries Accounting Class Library · 187

Page 197: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

AcctNameRIC Returns the name of the current account

AcctLookup Sets a new current account

AcctSearch Allows user to search for an account number

AcctsStartRIC Accounting Initialization routine

ChgFundYearRIC Changes the current fund or year

ControlNumberRIC Retrieves a new control number for use

ConvertTXT Reads ASCII file places contents in CStringList

EventLookup Allows the user to look up an event id

EventSearch Allows the user to search for an event id

EventYear Returns the file year for any event id

FundList Returns a list of all funds in organization

GetFileName Allows the user to pick a system file name

InvDtl Create an Invoice Detail record

InvMstr Create an Invoice Master record

InvPay Create an Invoice Payment record

ItemLookup Get Description of an Item

ItemSearch Search for an Item

JournalPosting Posts a specified journal

JournalSummary Produces Journal summary report

JournalMaint Allows maintenance on journal entries

PendingPosting Adds internal transactions to Pending Posting

TransactionLinks Maintain additional data for a transaction

VendorCk Show a Check in a detail window of it’s own

VendorInquiry Start the Vendor Inquiry Process

VendorPo Show a PO in detail window of it’s own

WriteTransactions Adds external transactions to Pending Posting

YearList Returns a list of accounting years in fund

Data Members - Public MembersFunction Description

m_AcctList The chart of accounts in memory

m_ChgMode Indicates that an accounting parameter changed

m_ChgSum Indicates that the summary journal has changed

m_HoldJournal Contains the Journal number in the document

m_MajorList List of Major Categories

m_MinorList List of Minor Categories

m_SumDoc Pointer to the summary journal

m_TypeList List of Account Types

188 · Accounting Class Library ConCentRICs for Windows RIC Corp Class Libraries

Page 198: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicAcct::AcctBasicHelpBOOL AcctBasicHelp(data, cmd);

DWORD data; // Control Id of help item

UINT cmd; // Help command

The AcctBasicHelp function will show the general accounting help. The data parameter will have the help context id number. The cmd parameter will contain the help command to be used. See the WINHELP command for the valid parameters.

CRicAcct::AcctContextMenuRICvoid AcctContextMenuRIC(menuitems);

CStringList menuitems; // List of additional items for right click menu

The AcctContextMenuRIC function will add the standard accounting options required for the right click menu, but will also add any additional options you may want to have on this menu. You would normally call this function in your view program within the OnContextMenu function.

Each line of the menuitems parameter would have the format of priority tab &Description… tab Control Id number. This is an example from check processing to change the checking account: 069\tChec&king Account…\t32784. The priority number must be 3 digits each existing item is incremented by 10 to find the proper position. Don’t forget a short cut character in the description and the … on the end to keep with standards. The Id number would be the same number for the equivalent option on the pull down menus.

If an item is already on the tool bar then it should not be on the right click menu. Any item on a pull down menu that does not have an alternate method of calling it, then it should be on the right click menu.

CRicAcct::AcctDebitRICBOOL AcctDebitRIC();

The AcctDebitRIC function will return TRUE if the current account is a debit account. It will return FALSE if the current event is a credit account.

CRicAcct::AcctDescRICCString AcctDescRIC();

The AcctDescRIC function will the full name for the current account.

CRicAcct::AcctKeyRIClong AcctKeyRIC();

The AcctKeyRIC function will return the internal key for the current account.

CRicAcct::AcctLookupBOOL AcctLookup(acctkey);

ConCentRICs for Windows RIC Corp Class Libraries Accounting Class Library · 189

Page 199: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

long acctkey; // The internal key to the account number

The AcctLookup function will allow you to change the current account. The current account and all current account functions will be changed to the account specified in the acctkey parameter. This needs to be the internal number for the account.

CRicAcct::AcctMethodRICint AcctMethodRIC();

The AcctMethodRIC function will return the number of the accounting method used. Method 1 = Cash, 2 = Accural, 3 = Modified Accural (Dixie Accounting).

CRicAcct::AcctNameRICCString AcctNameRIC();

The AcctNameRIC function will return the name of the current selected fund and accounting year. It will show the full accounting fund name, followed by a dash, then the full description of the current account year.

CRicAcct::AcctNumRICCString AcctNumRIC();

CString AcctNumRIC(acctkey);

CString acctkey; // Internal key for account number

The AcctNumRIC function will return the formated account number. The formated account number is made up of three sections. The major, minor and account number sections. Each section is separated by a symbol. The size of each section and the symbol used, is set by the user, and can vary between funds, but it will be the same for an entire fund. This format can also be changed without having to regenerate the accounting files, since the formated account number is just a description field for the system. The system using the internal key number for all accounts. You should use this function to obtain the account number to be displayed to the user. If you use this function with no parameters then it will return the formatted display of the current account. If you pass an internal account key, then you will get the formatted display of that account.

CRicAcct::AcctSearchBOOL AcctSearch(level, none, partia=””l);

int level; // Level of the search

BOOL none; // Indicates no selection is allowed

CString partial; // Option to allow search start point

The AcctSearch function will allow the user to search for an account number. The level indicates which account types will be allowed in the search, 0 = All accounts, 1 = Posting Accounts, and 2 = Non-Posting Accounts. Set the none parameter to TRUE if the user is allowed to select a special account which indicates no account, set to FALSE if they must select an account or push the Cancel button. The partial field is optional and can be left off. If you include it then only those accounts that match the characters entered will be initially selected for

190 · Accounting Class Library ConCentRICs for Windows RIC Corp Class Libraries

Page 200: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

the search. This partial search is a "begins with" search. This function will return TRUE if an account was selected or FALSE if an account was not selected. You can get the account number, name, etc with the current account functions such as AcctKeyRIC, AcctNumRIC, AcctDescRIC, AcctShortRIC, AcctDebitRIC, AcctTypeRIC, etc.

CRicAcct::AcctShortRICCString AcctShortRIC();

The AcctShortRIC function will return the short name of the account.

CRicAcct::AcctsStartRICBOOL AcctsStartRIC();

The AcctsStartRIC function is used when your project first starts. It will set the current fund and accounting year. This function will return TRUE if a fund and year were set and it will return FALSE if a fund and year could not be determined.

CRicAcct::AcctsValidRICBOOL AcctsValidRIC();

The AcctsValidRIC function will return TRUE if there is a current fund and active accounting year. This means that the accounting functions can be used successfully. If the accounting functions should not be used then this routine will return FALSE.

CRicAcct::AcctTypeRIClong AcctTypeRIC();

The AcctTypeRIC function will return the type of account. You can print out the Account type list to see the return values of this function. It will return the key of the type.

CRicAcct::ChgFundYearRICvoid ChgFundYearRIC(type);

int type; // Type of change - Fund or Year

The ChgFundYearRIC function will allow the user to change the current accounting fund or the current accounting year. If the type is set to 1 then the fund will be changed. If the type is set to 2 then the Year will be changed. This function will display to the user a list of all the possible ones they can switch to, and they can then select the one they would like to use.

CRicAcct::ControlNumberRICCString ControlNumberRIC(control);

long control; // Type of control number needed

The ControlNumberRIC function will return a formatted control number. You indicate which control number you would like with the control parameter. You can

ConCentRICs for Windows RIC Corp Class Libraries Accounting Class Library · 191

Page 201: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

display a list of control numbers to see the possible values for this field. This function will return you the next available number and increment the number to the next possible control number. The return control number is in CString format due to the leading zeros that may be in the number. You can turn it into a long number if you need to with the following routine:

long num = CharToLongRIC(ControlNumberRIC(<control>));

CRicAcct::ConvertTXTBOOL ConvertTXT(filename, list);

CString filename; // Contains the full path and name of file

CStringList* list; // Pointer to resulting data loaded from file

The ConvertTXT function will open and read the ASCII file indicated by the filename parameter. It will place the contents of this file in the list parameter. This routine will create a new entry in the list variable each time a carriage return, line feed (\r\n) combination is encountered.

CRicAcct::EventLookupCString EventLookup(eventid);

long eventid; // Event Id

The EventLookup function will look up the event indicated by the id in the eventid parameter. This function will return blank if the event could not be found. If the event is found it will return a string of serveral fields separted by tabs. These fields are:

1 Event Id

2 Long Event Name

3 Short Event Name

4 Start Date (first in date)

5 End Date (last out date).

CRicAcct::EventSearchlong EventSearch();

The EventSearch function will allow the user to select an event. This function will return the event id of the selected event. If an event was not selected this routine will return a minus 1 (-1) if an event is not selected. This is not the same search as the Scheduling Event Search. This is a much shorter version that only allows you to select on date, but it is fast and small, and does not require the scheduling library to be included.

CRicAcct::EventYearint EventYear(eventid);

long eventid; // Event Id

192 · Accounting Class Library ConCentRICs for Windows RIC Corp Class Libraries

Page 202: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

The EventYear function will return the event year for the eventid provided. This is not necessarily the fileyear, but you can get that by passing the event year to the user.YearDirRIC(<event year>) function.

This function might not work properly for the special user events which end in 000. These can appear in any event year, so when these events are passed, the function will return the current event year.

CRicAcct::FirstMonthRICint FirstMonthRIC();

The FirstMonthRIC function will return the first month in the fiscal year for the current accounting Fund. The function will return 1 for Jan. 2 for Feb, 3 for March, 4 for April, etc.

CRicAcct::FundListvoid FundList(funds);

CStringList* funds; // Pointer to list of returned funds

The FundList function will build a list of defined accounting funds for the current organization. Each entry in the list will contain four fields separated by tabs: Fund Number, Fund Name, Beginning month of fund and Directory for the Fund specific files.

CRicAcct::FundNameRICCString FundNameRIC();

The FundNameRIC function will return the description of the currently selected fund.

CRicAcct::FundPathRICCString FundPathRIC();

The FundPathRIC function will return the full pathname where the fund specific files can be located for the currently selected fund.

CRicAcct::FundRICint FundRIC();

The FundRIC function will return the fund number of the currently selected fund.

CRicAcct::FundStateRICBOOL FundStateRIC();

The FundStateRIC function will return TRUE if a fund is currently selected or it will return FALSE if there is no fund selected. You should use the AcctsValidRIC function instead.

ConCentRICs for Windows RIC Corp Class Libraries Accounting Class Library · 193

Page 203: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicAcct::GetFileNameCString GetFileName(title, lastname);

CString title; // Title of File Selection

CString lastname; // Default filename to use for selection

The GetFileName function will ask the user to select a system file name. It will display the standard windows file selection dialog box. It will use the title parameter in the title bar of this dialog box. The lastname field is used to show a default selected filename. It is usually the last file name used. This function will return blank if no filename was selected, else it will return the full name and path of the selected file name.

CRicAcct::InvDtlvoid InvDtl(trans);

CString trans; // The transaction record

The InvDtl function will create an Invoice Detail record. The trans parameter will contain the fields required for the Invoice record separated by tab characters:

1 invno

2 acctno

3 index

4 ebscat

5 debcred

6 orgamt

7 curamt

8 taxamt

9 descr1

10 desc2

CRicAcct::InvMstrvoid InvMstr(trans);

CString trans; // The transaction record

The InvMstr function will create an Invoice Master record. The trans parameter will contain the fields required for the Invoice record separated by tab characters.

1 invno

2 eventid

3 nakey

4 orgbal

5 curbal

6 orgpaid

7 source

194 · Accounting Class Library ConCentRICs for Windows RIC Corp Class Libraries

Page 204: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicAcct::InvPayvoid InvDtl(trans);

CString trans; // The transaction record

The InvDtl function will create an Invoice Payment record. The trans parameter will contain the fields required for the Invoice record separated by tab characters.

1 invno

2 index

3 date

4 amount

5 refno

6 depositno

7 acctno

8 taxamt

CRicAcct::ItemLookupCString ItemLookup(type, key);

int type; // Type of item to be found

long key; // Key of the item

The ItemLookup function will return the description of an item. In the type parameter you indicate what kind of item you will be looking for. In the key parameter you give it the control number for the item. The chart below shows the possible types, the control number expected and the values they return.

Type Key Returned Value

1 Inventory Item Key Part Code\tDescription\tRow\tBin\t

2 Fixed Asset Key Decal Number\tDescription\t

3 Project Number Project Name

69 Deposit Number Deposit Description

CRicAcct::ItemSearchlong ItemSearch(type);

int type; // Type of search to be performed

The ItemSearch function will bring up an appropriate search screen to find an item. The type parameter indicates what item we will be searching for. This function will return the key of the selected item. If no key is selected a zero is returned. If the Cancel button is pressed then a –1 is returned. Types can have the following values:

1 Inventory Part

2 Fixed Asset

ConCentRICs for Windows RIC Corp Class Libraries Accounting Class Library · 195

Page 205: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

3 Project

69 Deposit Number

CRicAcct::JournalPostingCString JournalPosting(doc, journal);

CRicDoc* doc; // Pointer to the document's CRicDoc class

long journal; // Internal number of unique journal

The JournalPosting function will display the journal posting dialog box and will allow the user to create a draft journal or actually post the journal if their security level is high enough. You must pass this function the CRicDoc class which you can get from your XXXXDOC.CPP program with the GetDocPtr function. This function will create a report of the detail transactions in the journal. The journal that is displayed by the routine is the one indicated by the journal parameter. You can get a list of the journal numbers by displaying a list of Journal in the General Ledger, Table Parameters option. There is a special section in this chapter that outlines all the things you need to do to include a journal in your project.

CRicAcct::JournalSummaryCString JournalSummary(doc);

CRicDoc* doc; // Pointer to the document's CRicDoc class

The JournalSummary function will produce the summary report for a journal. This summarizes all of the detail transactions to show a single total for each account number used in the journal. This function is used in conjunction with the JournalPosting function. There is a special section in this chapter that outlines all the things you need to include a journal in your project.

CRicAcct::JournalMaintBOOL JournalMaint(filekey, recnum, delmode);

CString filekey; // Key to the journal record updated

int recnum; // Record number of updated item

BOOL delmode; // Indicates that the user can delete

The JournalMaint function will allow you to maintain a detail entry on a Journal Report. This function is used in conjunction with the JournalPosting function. There is a special section in this chapter that outlines all the things you need to include a journal in your project.

CRicAcct::m_AcctListCStringList m_AcctList;The m_AcctList variable will contain a list of the entire chart of accounts in memory. The system will fill this table the first time it has the need for an account number. After that it will use this table for Chart of Account information. Each record in this variable will represent one chart of account with the following fields separated by tabs:

1 Formatted Account Number

196 · Accounting Class Library ConCentRICs for Windows RIC Corp Class Libraries

Page 206: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

2 Account Description

3 Short Description

4 Account Key

5 Type of Account (key)

6 Major Category (key)

7 Minor Category (key)

8 Cross Reference Account

9 Debit (0) / Credit (1)

CRicAcct::m_ChgModeBOOL m_ChgMode;

The m_ChgMode variable will be set to TRUE if any of the Accounting Parameters have changed since the project first executed. This is usually set to FALSE.

CRicAcct::m_ChgSumBOOL m_ChgSum;

The m_ChgSum variable will be set to TRUE if the Journal Summary report has changed and needs to be regenerated. This is usually set to FALSE. This variable is used in conjunction with the JournalPosting function. There is a special section in this chapter that outlines all the things you need to include a journal in your project.

CRicAcct::m_HoldJournallong m_HoldJournal;The m_HoldJournal variable will contain the number of the journal currently in the project's document class. This will be zero if the document class is not a journal. This variable is used in conjunction with the JournalPosting function. There is a special section in this chapter that outlines all the things you need to include a journal in your project.

CRicAcct::m_MajorListCStringList m_MajorList;The m_MajorList variable will contain a list of all the Major Account Categories. Each record in the list will represent one category. They will have the following fields separated by tabs:

1 Account Number – Description

2 Major Key

3 Account Number

4 Type of Account

5 Debit (0) / Credit (1)

ConCentRICs for Windows RIC Corp Class Libraries Accounting Class Library · 197

Page 207: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicAcct::m_MinorListCStringList m_MinorList;The m_MinorList variable will contain a list of all the Minor Account Categories. All Minor Categories are associated with Major Categories. Each record in the list will represent one minor category. They will have the following fields separated by tabs:

1 Major Acct Num Connector Symbol Minor Acct Num – Description

2 Minor Key

3 Major Account Number and Minor Account Number

4 Type of Account

CRicAcct::m_SumDocCRicDoc* m_SumDoc;

The m_SumDoc variable will contain the pointer to the CRicDoc class that contains the Summary Journal. This is only important to a corresponding detail journal. This variable is used in conjunction with the JournalPosting function. There is a special section in this chapter that outlines all the things you need to include a journal in your project.

CRicAcct::m_TypeListCStringList m_TypeList;The m_TypeList variable will contain a list of all the Account Types defined to the system. Each entry in the list will represent one account type. Each entry will contain the following fields separated by tabs:

1 Account Type Description

2 Account Type Key

3 Posting Account 0=No 1=Yes

CRicAcct::MajorDigitsRICint MajorDigitsRIC();

The MajorDigitsRIC function will return the number of digits in the major section of a formatted account number. A formatted account number is made up of three sections: major, minor, and account number.

CRicAcct::MinorDigitsRICint MinorDigitsRIC();

The MinorDigitsRIC function will return the number of digits in the minor section of a formatted account number. A formatted account number is made up of three sections: major, minor, and account number.

CRicAcct::NumberSymbolRICCString NumberSymbolRIC();

198 · Accounting Class Library ConCentRICs for Windows RIC Corp Class Libraries

Page 208: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

The NumberSymbolRIC function will return the symbol used to separate the different sections of a formatted account number. A formatted account number is made up of three sections: major, minor, and account number. This symbol will appear between the major and minor sections. It will appear again between the minor and account number sections. This is usually set to a dash, but the user can use any symbol they want to use.

CRicAcct::PendingPostingBOOL PendingPosting(trans);

CStringList* trans; // Pointer to accounting transaction list

The PendingPosting function will take the transactions in the trans parameter and will update or add them to the Pending Posting file. The format for the transactions in the list are as follows, each of the fields are separated by tabs:

Field Description Source code = 0

1 Transaction Source code Indicates header record for update

2 Transaction Date Original Date

3 Control Number Original Time

4 Account Number Key Original Source Code

5 Debit/Credit Indicator Original Control Number

6 Transaction Amount Original Transacton Date

7 Transaction description N/A

\n N/A

1 Reference Number N/A

2 Reference Value N/A

NOTE: The last two fields: Reference Number and Reference Value can be repeated as many times as required for all the references associated with a transaction.

CRicAcct::PostMonthRICint PostMonthRIC();

The PostMonthRIC function will return the number of the default posting month in the currently selected fund/year. It will return 1 for Jan, 2 for Feb, 3 for March 4 for April, etc.

CRicAcct::TotalDigitsRICint TotalDigitsRIC();

The TotalDigitsRIC function will the total number of digits in a formatted account number. A formatted account number is made up of three sections: major, minor and account number. The sections are also separated with a symbol choosen by the user. This function will return the size of the major section plus the size of the minor section, plus the size of the account number section plus the size of two connector symbols.

ConCentRICs for Windows RIC Corp Class Libraries Accounting Class Library · 199

Page 209: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

CRicAcct::TransactionLinksBOOL TransactionLinks(refdata);

CString* refdata; // Pointer to a string of Transaction Link data

The TransactionLinks function will perform all maintenance necessary for Transaction Links. Transaction Links are additional information that can be associated with each and every account transaction. The refdata parameter contains all of the current Transaction Links and any additional ones will be added to it. This parameter contains: the link type \t link key \t and these are repeated as needed. This function will return TRUE if the OK button was pushed or it will return FALSE if the Cancel button was pushed.

CRicAcct::TranLinkLookupCString TranLinkLookup(type, key);

long type; // Type of Transaction Link to lookup

long key; // Key of the Transaction Link

The TranLinkLookup function will return the description of a transaction link. Put the type of Transaction link in the type parameter and the control number for the link in the key parameter. If the key value is found the system will return the description /t value for the entry. If the key was not found then NULL will be returned.

CRicAcct::VendorCkCString VendorCk(doc, key);

CRicDoc* doc; // Pointer to RIC Corp Document Class

CString key; // Key to the Check or Payment Request

The VendorCk function will produce a window that shows the details of a Check or Payment Request. The doc parameter will be used for the output. The key parameter indicates which check will be produced and it has the following fields separated by tabs:

1 2=Check Request 4=Check

2 Checking Account

3 Check Number or Payment Request Number

4 Directory that contains the item

CRicAcct::VendorInquiryCString VendorInquiry(doc, key=””, vendor=0);

CRicDoc* doc; // Pointer to RIC Corp Document Class

CString key; // Key to the entry

long vendor; // Vendor Number

The VendorInquiry function will start the vendor inquiry function. The doc parameter will be used for the output. The key and vendor parameters can be left off. If they are then a vendor search will appear. It will allow the user to select a user and it will then list all the entries for that vendor. You could enter a Name Key

200 · Accounting Class Library ConCentRICs for Windows RIC Corp Class Libraries

Page 210: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

in the vendor parameter. This will skip the name search portion of the Vendor Inquiry operation and will take you directly to the list of vendor activity. You could enter a key to go directly to a specific vendor’s activity. The key has the following fields separated by tabs:

1 1=Purchase Requisition 2=Check Request 3=PO 4=Check 9=Vendor

2 Type

3 Control number

4 Directory that contains the item

CRicAcct::VendorPoCString VendorPo(doc, key);

CRicDoc* doc; // Pointer to RIC Corp Document Class

CString key; // Key to the Purchase Order or Payment Request

The VendorPo function will produce a window that shows the details of a Purchse Order or Purchase Requisistion. The doc parameter will be used for the output. The key parameter indicates which check will be produced and it has the following fields separated by tabs:

5 1=Purchase Requisition 3=Purchase Order

6 zero (0)

7 Purchase Order Number or Purchase Requisition number

8 Directory that contains the item

CRicAcct::WriteTransactionsint WriteTransactions(postings, specs);

CStringList* postings; // Pointer to list of transaction records

CString specs; // Transactions specifications

The WriteTransactions function will take the transactions strings and add them to the pending posting file based on the transaction specifications. You should normally use the PendingPosting option. This option is primiarly used to load external transtions, since the fields could be in any order.

The transaction specification indicates what field position each of the fields are located that ConCentRICs requires. This is based on predefined file formats. The specs parameter contains the keys to this predefined format. The format of the transaction specifications is as follows:

Field Description

1 Description of predefined format

2 ID

3 Format details

4 Delete switch

5 Full indicator

ConCentRICs for Windows RIC Corp Class Libraries Accounting Class Library · 201

Page 211: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

6 Filename

The format for the transactions in the list are as follows, each of the fields are separated by tabs:

Field Description Source code = 0

1 Transaction Source code Indicates header record for update

2 Transaction Date Original Date

3 Control Number Original Time

4 Account Number Key Original Source Code

5 Debit/Credit Indicator Original Control Number

6 Transaction Amount Original Transacton Date

7 Transaction description N/A

\n N/A

1 Reference Number N/A

2 Reference Value N/A

NOTE: The last two fields: Reference Number and Reference Value can be repeated as many times as required for all the references associated with a transaction.

CRicAcct::YearListvoid YearList(years);

CStringList* years; // Pointer to a list to hold resulting years

The YearList function will build a list of defined accounting years for the currently selected fund. Each entry in the list will contain four fields separated by tabs: Year, Year Name, status of year and Directory for the Year specific files.

CRicAcct::YearNameRICCString YearNameRIC();

The YearNameRIC function will return the name of the currently selected accounting year.

CRicAcct::YearPathRICCString YearPathRIC();

The YearPathRIC function will return the directory path of the currently selected accounting year. This will be the directory path where the year specific files can be located.

CRicAcct::YearRICint YearRIC();

202 · Accounting Class Library ConCentRICs for Windows RIC Corp Class Libraries

Page 212: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

The YearRIC function will return the year of the currently selected accounting year.

CRicAcct::YearStateRICBOOL YearStateRIC();

The YearStateRIC function will return TRUE if there is an accounting year selected. It will return FALSE if there is no year selected. You should use the AcctsValidRIC function instead.

CRicAcct::YearStatusRICint YearStatusRIC();

The YearStatusRIC function will return the status of the currently selected accounting year. The chart belows shows the possible return values:

Value Description

1 Budget Year

2 Active Year

3 Historical Year

4 Stored Offline

ConCentRICs for Windows RIC Corp Class Libraries Accounting Class Library · 203

Page 213: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

Glossary of Terms

ConCentRICs for Windows RIC Corp Class Libraries Glossary of Terms · 205

Page 214: RIC Corp  · Web viewRIC Corp Class Libraries. Doc-To-Help Standard Manual. By Resource Information and Control Corporation. Copyright 1994 - 2004 Resource Information and Control

Index

CCAboutDlg class 139CPswdDlg class 140

PPublic Members Error! Not a valid bookmark in

entry on page 139

Vvariable Error! Not a valid bookmark in entry on

page 140

ConCentRICs for Windows RIC Corp Class Libraries Index · 207


Recommended