>******************************************************************** >* Description.......: Main program of TableMaintenance application >* Calling Samples...: >* Parameter List....: pcMode, pcDBC, pcTable, pcMethod, pcUpdateType, pcFilter, pcFieldList, pcValues >* Created by........: Nadya Nosonovsky 03/14/2000 11:06:59 AM >* Modified by.......: Nadya Nosonovsky 09/26/2000 11:31:26 AM >******************************************************************** >* This application is called by job control or XForm, but it should also work >* as a standalone application. > >* takes 5 optional parameters >parameters pcMode, pcDBC, pcTable, pcMethod, pcUpdateType, pcFilter, pcFieldList, pcValues >* pcMode: Manual or Auto mode >* >* pcDBC: Database containing the table >* >* pcTable: File name of the table to be operated upon. >* >* pcMethod: Auto-Update method (if any) to be invoked >* >* pcUpdateType: Add or Edit >* >* pcFilter: Record identifier >* >* pcFieldList: List of fields (separated by semicolon) >* >* pcValues: List of values (separated by semicolon) > >private pcFormName >pcFormName='' > >if type('pcTable')'C' && pcTable was not specified > pcTable='' >endif > >if type('pcMode')'C' or empty(pcMode) && Mode was not specified correctly > pcMode='Manual' && Set it to be Manual >else > pcMode=proper(pcMode) >endif > >if type('pcDBC')'C' or empty(pcDBC) && DBC Name was not specified correctly > pcDBC='Lookups' && Set it to be Lookups >else > pcDBC=proper(pcDBC) >endif > >if type('pcMethod')'C' && Method for Auto Mode was not specified correctly > pcMethod='Update Lookups' && Set it to be Update Lookups >else > pcMethod=proper(pcMethod) >endif > >* Check environment >if not 'wgutility' $ lower(set('procedure')) > set procedure to wgutility additive >endif >if not 'wg' $ lower(set('classlib')) > set classlib to wg, wgcontrols, wglookups additive >endif > >do case >case pcMode='Manual' > if empty(pcTable) && Table name was not specified > do form TableChooser with pcDBC > if empty(pcTable) && User hits Close > return .f. > endif > > else && pcTable was specified > > use TableMaint again in 0 shared alias TableMaint > if seek(upper(pcTable),'TableMaint','TableName') > pcFormName=TableMaint.EditForm > endif > use in TableMaint && Close TableMaint > if !empty(pcFormName) > do form (pcFormName) && Modeless form > else > do form TableMaint && Generic modeless form > endif > endif > >case pcMode='Auto' > if pcMethod='Update Streets' > do UpdateStreets > endif > if pcMethod='Update Phones' > do UpdatePhones > endif > if pcMethod='Update Lookups' > do UpdateLookups > endif > if pcMethod='Update Lenders' > do UpdateLenders in UpdateLookups > endif > if pcMethod='Update Towns' > do UpdateTowns in UpdateLookups > endif > if pcMethod='Update Filing' > do UpdateFiling in UpdateLookups > endif > > if type('oJC')='O' > oJC.CurAppStat='C' && Set Current status of application > endif >endcase > >return && end of main program - return to calling app or VFP command level