//***************************************************************************************** // Copyright (c) 2000 Michael Kurz // All rights reserved. // If you want to use this source in your applications conatct: // // $FileName : ASDB_Ext.pkg // $ProjectName : CODEMAX EDITOR // $Author : Michael Kurz // $Created : 02-20-2001 @ 19:00 // // Contents: // Constants and function for using the ASDB.Dat with CodeMax. // // $Rev History // //***************************************************************************************** // Method types (ASDB database) Define ASDB_TYPE_PROPERTY For 1 Define ASDB_TYPE_PROCEDURE For 2 Define ASDB_TYPE_SETPROCEDURE For 11 // Not in ASDB defined but for an consistent use. Define ASDB_TYPE_FUNCTION For 3 Define ASDB_TYPE_COMMAND For 4 Define ASDB_TYPE_BOTH For 5 // Searches a Class, returns VDFCLS.Code if found otherwise 0 (there's no code 0) Function VDFCls_Search Global String sCls Integer iM1 Integer iM2 Returns Integer Integer iCode Move 0 To iCode Send OpenTH3DB of ghoApplication VDFCLS.File_Number Clear VDFCLS move sCls to VDFCLS.Name Find eq VDFCLS by Index.1 If (Not(Found)) if ((iM1) or (iM2)) Begin send Info_Box (append("Class not found ",sCls)) End Move VDFCLS.CODE To iCode Send CloseTH3DB of ghoApplication VDFCLS.File_Number Function_Return iCode End_Function // Converts a Method type to a string (ASDB DataBase) Function ASDBType2Str Global Integer iType returns String if iType eq ASDB_TYPE_PROPERTY Function_Return "Property" if iType eq ASDB_TYPE_PROCEDURE Function_Return "Procedure" if iType eq ASDB_TYPE_FUNCTION Function_Return "Function" if iType eq ASDB_TYPE_COMMAND Function_Return "Command" if iType eq ASDB_TYPE_BOTH Function_Return "Function" End_Function // Parametertype (ASDB database) Define TYPE_MODE For 4 Define TYPE_RANGE For 5 Function ConvertParameterTyp2Str Global Integer iType String sParaName returns String if iType eq 1 Function_Return (Trim(sParaName)) if iType eq 2 Function_Return "ClassID" if iType eq 3 Function_Return "ObjectID" if iType eq 4 Function_Return "Mode" if iType eq 5 Function_Return "Range" if iType eq 6 Function_Return "Msg_ID" if iType eq 7 Function_Return "Get_ID" if iType eq 8 Function_Return "to" if iType eq 9 Function_Return "WindowMsg" if iType eq 10 Function_Return "dbFile" if iType eq 11 Function_Return "dbField" if iType eq 12 Function_Return "dbFile_Field" if iType eq 13 Function_Return "Image" End_Function // Not Used // // Creates an InfoString of the current record in ASDB DataBase //Function ASDBInfoString Global Integer iMode returns String // String sRet // if iMode eq 0 Begin // Append sRet (ASDBType2Str(ASDB.TYPE)) " " (Trim(Asdb.Name)) // if Asdb.Par1t ne 0 Append sRet " {" (ConvertParameterTyp2Str(Asdb.Par1t,Asdb.Par1)) "}" // if Asdb.Par2t ne 0 Append sRet " {" (ConvertParameterTyp2Str(Asdb.Par2t,Asdb.Par2)) "}" // if Asdb.Par3t ne 0 Append sRet " {" (ConvertParameterTyp2Str(Asdb.Par3t,Asdb.Par3)) "}" // if Asdb.Par4t ne 0 Append sRet " {" (ConvertParameterTyp2Str(Asdb.Par4t,Asdb.Par4)) "}" // if Asdb.Par5t ne 0 Append sRet " {" (ConvertParameterTyp2Str(Asdb.Par5t,Asdb.Par5)) "}" // End // Function_Return sRet //End_Function Function CreateParameterEntry Global Integer iType String sParaName Integer iCount Integer iWithType returns String String sType sName sRet if iType eq 1 Begin move (Trim(sParaName)) to sType Append sName (Left(sType,1)) "Para" iCount End Else Begin move "Integer" to sType Append sName "i" (ConvertParameterTyp2Str(iType,sParaName)) End if iType eq 8 Begin if iWithType Append sRet "returns " (Trim(sParaName)) End Else Begin if iWithType Append sRet sType " " Append sRet sName End Function_Return sRet End_Function // Note: Is only called when ASDB already opened. // Creates a List of the Current ASDB Record like: // integer iPara1 string sPara2 Function ASDBParametersList Global Integer iWithTypes returns String String sRet sParX sPara Integer iField iVon iBis iParXt Field_Map ASDB.File_Number "Par1t" to iVon Field_Map ASDB.File_Number "Par5" to iBis For iField from iVon to iBis Get_Field_Value ASDB.File_Number iField to iParXt Get_Field_Value ASDB.File_Number (iField+1) to sParX if iParXt eq 0 Break Else Begin move (CreateParameterEntry(iParXt,sParX,(iField-iVon)/2,iWithTypes)) to sPara Append sRet " " sPara End increment iField // 2 field per run - Type, Parameter End Function_Return sRet End_Function