//TH-Header //***************************************************************************************** // Copyright (c) 2001 Michael Kurz // All rights reserved. // If you want to use this source in your applications conatct: // // $FileName : D:\Entwicklung\Codemax\mEditorMacros.pkg // $ProjectName : Codemax // $Author : Michael Kurz // $Created : 17.05.2001 10:41 // // Contents: // Loading and saving Macros to Editor.Dat. // //***************************************************************************************** //TH-RevisionStart //TH-RevisionEnd Use vWin32fh.pkg Use mUserAndComputerName.pkg // EDITOR(20) file should not be used anymore (see Tools\TH3Workspace.pkg) //Open Editor // Deletes all Entries in Editor.Dat from a specific user an typ. Procedure Editor_DeleteAll String sUser String sTyp // Clear Editor // Move sUser To Editor.User // Move sTyp To Editor.Type // Repeat // Find Gt Editor by Index.1 // If Editor.User Ne sUser Indicate found False // If Editor.Type Ne sTyp Indicate found False // [found] Begin // Lock // Delete Editor // Unlock // End // Until [Not found] End_Procedure // Saves one Macro to the editor DataBase. Procedure Editor_SaveMacro String sUser Integer iMacro // Integer iSize // Move (CMGetMacro(iMacro,0)) To iSize // If iSize Eq 0 Procedure_Return // Local_Buffer sBuff pBuff iSize // Move (CMGetMacro(iMacro,pBuff)) To iSize // Clear Editor // Move sUser To Editor.User // Move "MACRO" To Editor.Type // Move iMacro To Editor.File // Lock // Find Eq Editor by Index.1 // Move iSize To Editor.Count // Move sBuff To Editor.Data // Saverecord Editor // Unlock End_Procedure // SAves all 10 possible macros with CodeMax. Procedure Editor_SaveAllMacros String sUser // Integer iC // Send Editor_DeleteAll sUser "MACRO" // Delete all old macros. // For iC From 0 To 9 // Send Editor_SaveMacro sUser iC // End End_Procedure Procedure FloatDeleteAllMacros // Send Editor_DeleteAll gsUserName "MACRO" End_Procedure // Saves one Macro to the editor DataBase. Procedure Editor_LoadMacro String sUser Integer iMacro // Integer iRet // Local_Buffer sBuff pBuff // Clear Editor // Move sUser To Editor.User // Move "MACRO" To Editor.Type // Move iMacro To Editor.File // Find Eq Editor by Index.1 // [found] Begin // Move (Left(Editor.Data,Editor.Count)) To sBuff // GetAddress Of sBuff To pBuff // Move (CMSetMacro(iMacro,pBuff)) To iRet // End End_Procedure // Tries to load all 10 Macros possible in Codemax. Procedure Editor_LoadAllMacros String sUser // Integer iC // For iC From 0 To 9 // Send Editor_LoadMacro sUser iC // End End_Procedure