************************************************************ * AUTHOR : Nadya Nosonovsky * DESC : Main program for DataDict * PARAMETER : tcRunMode, tcDBCName, tcProcess, tcInputTable * CREATED : 06/03/1999 * MODIFIED : Nadya Nosonovsky 05/17/2001 01:02:30 PM * RETURNS : *--------------------------------------------------------------------- lparameters tcRunMode, tcDBCName, tcProcess, tcInputTable * tcRunMode - Various modes in which DataDict could be invoked - optional * tcNewDBC - Name of the DBC, which should be created (Clone or Generare mode) - optional * tcProcess - ParcelProc * tcInputTable - Name of the table to use in clone * =launch() && Set environment private pcTempDrive, FieldValPrefix, TableValPrefix && Make them visible everywhere in the project pcTempDrive=justdrive(sys(2023)) && VFP Temp drive FieldValPrefix ='IIF(VARTYPE(oValid)#"O".OR.Ovalid.nlocked<0,.F.,IIF(Ovalid.nlocked=0,.T.,<FUNCTION CALL HERE>))' TableValPrefix ='IIF(VARTYPE(oValid)#"O".OR.Ovalid.nlocked<0,.F.,IIF(Ovalid.nlocked=0,.T.,<FUNCTION CALL HERE>))' local lnParams, llReturn, lloJCExists store .t. to llReturn, llSetStatus lloJCExists=vartype(oJC)="O" lnParams=pcount() && Number of parameters **** Validate parameter first if m.lnParams=1 and vartype(m.tcRunMode)<>'C' && Something is wrong if m.lloJCExists oJC.CurAppStat="I" endif return .f. && quiet fail endif if m.lnParams>1 and (vartype(m.tcRunMode)<>'C' or vartype(m.tcDBCName)<>'C') && Something is wrong if m.lloJCExists oJC.CurAppStat="I" endif return .f. && quiet fail endif if m.lnParams>0 tcRunMode=upper(m.tcRunMode) endif if m.lnParams>1 tcDBCName=upper(m.tcDBCName) endif if !empty(m.tcRunMode) and inlist(m.tcRunMode,"RUN","REINDEX","PACK","CLONE") ** Create private DS local loPrivateDS if not ('privatedsclass') $ lower(set('procedure')) set procedure to PrivateDSClass additive endif loPrivateDS=newobject("DataDictDS","DataDictDS.prg") llReturn=loPrivateDS.DoFunction(m.tcRunMode, m.tcDBCName, m.tcProcess, m.tcInputTable) release loPrivateDS use in select('IndxDict') use in select('DataDict') use in select('ValCalls') if m.lloJCExists and empty(oJC.CurAppStat) oJC.CurAppStat=iif(m.llReturn,"C","I") endif release pcTempDrive, FieldValPrefix, TableValPrefix return m.llReturn endif do case case m.lnParams=0 && Default invokation do form DataDictionary && Main user form come without parameters case m.tcRunMode='DATADICT' do form DataDictionary && Main user form come without parameters case m.tcRunMode="LKUPS" do form LkupDictionary *-------------------------------------------------------------------------- * -- PKP: Added Run Mode = 'METHODS' for the methods Form *-------------------------------------------------------------------------- case m.tcRunMode="METHODS" do form Methods case m.tcRunMode="SUPP" do form SuppDictionary otherwise * There should not be otherwise! =messagebox('Run mode '+m.tcRunMode+' not supported!',48,'Unsupported parameter') llReturn=.f. endcase release pcTempDrive, FieldValPrefix, TableValPrefix return m.llReturnI run DataDict without parameters, so it shows the main form (non-modal). Then I click on Update button, which calls a simple modal form to choose databases to update. I pick one and it runs a program called ModifyStructure. This program in turn calls another program called modify_structure. This program reports about missing variable TableValPrefix.