#if defined(_AI_LIB_)
	#include "AIUseCPA.h"
	
	#include "specif/AIOption.h"
	#include "AIMacros.h"	
	#include "AI_Erm.h"
 
	/* so that exported functions are effectively exported !*/
	#include "Convert.h"
 
	#include "ProtVar.h"
	#include "EnumVar.h"
	#include "VarType.h"
 
#else
	#include <string.h>
	#include "specif/AIOption.h"
 
	#include "EnumVar.h"
	#include "VarType.h"
	#include "ConvVar.h"
 
	#include "ConvCst.h"
 
#endif /* _AI_LIB_*/
 
/******************************************************************************/
/* dsgvar types                                                               */
/******************************************************************************/
#define C_MAX_SIZE_DSGVAR_NAME 20
#define NB_MAX_DSGVAR_PARAM 4
#define NB_MAX_DSGVAR_DEFAULT_PARAM 12
 
typedef struct tdstDsgVarTypeTableEntry_
{
  /* string used in editor*/
#if defined(ACTIVE_EDITOR)
  char szEditorName[C_MAX_SIZE_DSGVAR_NAME+1]; 
#endif /* ACTIVE_EDITOR*/
#if defined (AI_USE_SCRIPT)
  /* string used in script*/
  char szScriptName[C_MAX_SIZE_DSGVAR_NAME+1];
#endif /* AI_USE_SCRIPT */
  enum tdeVariableType_ eVariableType;
#if defined(ACTIVE_EDITOR)
  char szParamType[2];
  char szParamSubType[2];
#endif /* ACTIVE_EDITOR*/
#if defined(_AI_LIB_)
  tdp_fn_ucGetDsgVarFunctionPtr p_fn_ucGetDsgVarFunction;
  tdp_fn_ucSetDsgVarFunctionPtr p_fn_ucSetDsgVarFunction;
#endif /* _AI_LIB_ */
} tdstDsgVarTypeTableEntry;
 
/*
static tdstDsgVarTypeTableEntry a_stDsgVarTypeTable[eNbDsgVarType]=
{
#if defined(_AI_LIB_)
	#if defined (AI_USE_SCRIPT)
		#if defined(ACTIVE_EDITOR)
			#define M_DEFINE_DSGVAR_TYPE(a,b,c,d,e,f,g,h) {b,c,d,e,f},
		#else
			#define M_DEFINE_DSGVAR_TYPE(a,b,c,d,e,f,g,h) {c,d,e,f}, 
		#endif // ACTIVE_EDITOR
	#else // AI_USE_SCRIPT 
		#if defined(ACTIVE_EDITOR)
			#define M_DEFINE_DSGVAR_TYPE(a,b,c,d,e,f,g,h) {b,d,e,f}, 
		#else
			#define M_DEFINE_DSGVAR_TYPE(a,b,c,d,e,f,g,h) {d,e,f},  
		#endif // ACTIVE_EDITOR
	#endif // AI_USE_SCRIPT 
#else
	#if defined (AI_USE_SCRIPT)
		#if defined(ACTIVE_EDITOR)
			#define M_DEFINE_DSGVAR_TYPE(a,b,c,d,e,f,g,h) {b,c,d}, 
		#else
			#define M_DEFINE_DSGVAR_TYPE(a,b,c,d,e,f,g,h) {c,d}, 
		#endif // ACTIVE_EDITOR
	#else // AI_USE_SCRIPT 
		#if defined(ACTIVE_EDITOR)
			#define M_DEFINE_DSGVAR_TYPE(a,b,c,d,e,f,g,h) {b,d}, 
		#else
			#define M_DEFINE_DSGVAR_TYPE(a,b,c,d,e,f,g,h) {d}, 
		#endif // ACTIVE_EDITOR
	#endif // AI_USE_SCRIPT 
#endif // _AI_LIB_ 
	#include "DefVar.h"
	#undef M_DEFINE_DSGVAR_TYPE
};
*/
 
static tdstDsgVarTypeTableEntry a_stDsgVarTypeTable[eNbDsgVarType]=
{
#if defined(_AI_LIB_)
	#if defined (AI_USE_SCRIPT)
		#if defined(ACTIVE_EDITOR)
			#define M_DEFINE_DSGVAR_TYPE(a,b,c,d,e,f,g,h,i,j) {b,c,d,e,f,g,h},
		#else
			#define M_DEFINE_DSGVAR_TYPE(a,b,c,d,e,f,g,h,i,j) {c,d,g,h}, 
		#endif /* ACTIVE_EDITOR*/
	#else /* AI_USE_SCRIPT */
		#if defined(ACTIVE_EDITOR)
			#define M_DEFINE_DSGVAR_TYPE(a,b,c,d,e,f,g,h,i,j) {b,d,e,f,g,h}, 
		#else
			#define M_DEFINE_DSGVAR_TYPE(a,b,c,d,e,f,g,h,i,j) {d,g,h},  
		#endif /* ACTIVE_EDITOR*/
	#endif /* AI_USE_SCRIPT */
#else
	#if defined (AI_USE_SCRIPT)
		#if defined(ACTIVE_EDITOR)
			#define M_DEFINE_DSGVAR_TYPE(a,b,c,d,e,f,g,h,i,j) {b,c,d,e,f}, 
		#else
			#define M_DEFINE_DSGVAR_TYPE(a,b,c,d,e,f,g,h,i,j) {c,d}, 
		#endif /* ACTIVE_EDITOR*/
	#else /* AI_USE_SCRIPT */
		#if defined(ACTIVE_EDITOR)
			#define M_DEFINE_DSGVAR_TYPE(a,b,c,d,e,f,g,h,i,j) {b,d,e,f}, 
		#else
			#define M_DEFINE_DSGVAR_TYPE(a,b,c,d,e,f,g,h,i,j) {d}, 
		#endif /* ACTIVE_EDITOR*/
	#endif /* AI_USE_SCRIPT */
#endif /* _AI_LIB_ */
	#include "DefVar.h"
	#undef M_DEFINE_DSGVAR_TYPE
};
 
 
#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */
enum tdeDsgVarTypeId_ fn_eGetNbDsgVarType()
{
  return(eNbDsgVarType);
}
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC */
 
 
#if defined(__DEBUG_AI__)
char *szFindDsgVarTypeScriptNameFromId(enum tdeDsgVarTypeId_ eDsgVarTypeId)
{
#if defined(__DEBUG_AI__)
   if (!M_IsDsgVarTypeIdValid(eDsgVarTypeId))
	   return(NULL);
#endif
   return(a_stDsgVarTypeTable[eDsgVarTypeId].szScriptName);
}
#endif 
 
#if defined(_AI_LIB_)
tdp_fn_ucGetDsgVarFunctionPtr fn_p_fn_pGetDsgVarGetFunctionPtr(enum tdeDsgVarTypeId_ eDsgVarTypeId)
{
	return(a_stDsgVarTypeTable[eDsgVarTypeId].p_fn_ucGetDsgVarFunction);
}
 
tdp_fn_ucSetDsgVarFunctionPtr fn_p_fn_pGetDsgVarSetFunctionPtr(enum tdeDsgVarTypeId_ eDsgVarTypeId)
{
	return(a_stDsgVarTypeTable[eDsgVarTypeId].p_fn_ucSetDsgVarFunction);
}
#endif
 
#if defined(ACTIVE_EDITOR)
char *fn_szFindStringTypeFromVariableType(tdeVariableType eType)
{
  int i;
  for(i=0;i<fn_eGetNbDsgVarType();i++)
  {
    if (a_stDsgVarTypeTable[i].eVariableType==eType)
    {
      return(a_stDsgVarTypeTable[i].szParamType);
    }
  }
  return(USE_NO_PARAM);
}
 
char *fn_szFindStringTypeFromDsgVarType(enum tdeDsgVarTypeId_ eDsgVarTypeId)
{
   return(a_stDsgVarTypeTable[eDsgVarTypeId].szParamType);
}
 
char *fn_szFindStringSubTypeFromDsgVarType(enum tdeDsgVarTypeId_ eDsgVarTypeId)
{
   return(a_stDsgVarTypeTable[eDsgVarTypeId].szParamSubType);
}
 
enum tdeDsgVarTypeId_ fn_eFindDsgVarTypeIdFromEditorName(char *szDsgVarType)
{
   short wDsgVarTypeEntry;
   for(wDsgVarTypeEntry=0;wDsgVarTypeEntry<fn_eGetNbDsgVarType();wDsgVarTypeEntry++)
   {
      if (!stricmp(a_stDsgVarTypeTable[wDsgVarTypeEntry].szEditorName,szDsgVarType))
      {
		  return((enum tdeDsgVarTypeId_) wDsgVarTypeEntry);
      }
   }
   return(fn_eGetNbDsgVarType());
}
 
char *szFindDsgVarTypeEditorNameFromId(enum tdeDsgVarTypeId_ eDsgVarTypeId)
{
#if defined(__DEBUG_AI__)
   if (!M_IsDsgVarTypeIdValid(eDsgVarTypeId))
	   return(NULL);
#endif
   return(a_stDsgVarTypeTable[eDsgVarTypeId].szEditorName);
}
#endif /* ACTIVE_EDITOR*/
 
/*#if defined(ACTIVE_EDITOR) */
enum tdeVariableType_ fn_GetDsgVarType(enum tdeDsgVarTypeId_ eDsgVarTypeId)
{
#if defined(__DEBUG_AI__)
   if (!M_IsDsgVarTypeIdValid(eDsgVarTypeId))
	   return(E_vt_None);
#endif
   return(a_stDsgVarTypeTable[eDsgVarTypeId].eVariableType);
}
/*#endif*/
 
#if defined (AI_USE_SCRIPT)
enum tdeDsgVarTypeId_ fn_eFindDsgVarTypeIdFromScriptName(char *szDsgVarType)
{
   short wDsgVarTypeEntry;
   for(wDsgVarTypeEntry=0;wDsgVarTypeEntry<fn_eGetNbDsgVarType();wDsgVarTypeEntry++)
   {
      if (!stricmp(a_stDsgVarTypeTable[wDsgVarTypeEntry].szScriptName,szDsgVarType))
      {
         return((enum tdeDsgVarTypeId_) wDsgVarTypeEntry);
      }
   }
   return(fn_eGetNbDsgVarType());
}
#endif /* AI_USE_SCRIPT */
 
/******************************************************************************/
/* for SAI save types                                                         */
/******************************************************************************/
/******************************************************************************/
/* for SAI save types                                                         */
/******************************************************************************/
#if !defined(_AI_LIB_) && defined(__SAI_Enum_h__)
  #define KNOW_SAI
#endif
 
#define MAX_LENGTH_SAVE_TYPE_EDITOR_NAME 20
#define MAX_LENGTH_SAVE_TYPE_SCRIPT_NAME 20
 
typedef struct tdstSaveTypeEntry_
{
#if defined(ACTIVE_EDITOR)
  char szEditorName[MAX_LENGTH_SAVE_TYPE_EDITOR_NAME];
#endif
#if defined (AI_USE_SCRIPT)
  char szScriptName[MAX_LENGTH_SAVE_TYPE_SCRIPT_NAME];
#endif /* AI_USE_SCRIPT */
#if defined(_AI_LIB_) || defined(KNOW_SAI) 
  SAI_tdeFlags eFlags;
#endif /* _AI_LIB_ || KNOW_SAI */
} tdstSaveTypeEntry;
 
 
tdstSaveTypeEntry a_st_SaveTypeTable[] =
{
#if defined (AI_USE_SCRIPT)
	#if defined(_AI_LIB_) || defined(KNOW_SAI)
		#if defined(ACTIVE_EDITOR)
			#define M_DEFINE_DSGVAR_SAVE_TYPE(a,b,c) {a,b,c},
		#else
			#define M_DEFINE_DSGVAR_SAVE_TYPE(a,b,c) {b,c},
		#endif /* ACTIVE_EDITOR*/
	#else
		#if defined(ACTIVE_EDITOR)
			#define M_DEFINE_DSGVAR_SAVE_TYPE(a,b,c) {a,b},
		#else
			#define M_DEFINE_DSGVAR_SAVE_TYPE(a,b,c) {b},
		#endif /* ACTIVE_EDITOR*/
	#endif
#else /* AI_USE_SCRIPT */
	#if defined(_AI_LIB_) || defined(KNOW_SAI)
		#if defined(ACTIVE_EDITOR)
			#define M_DEFINE_DSGVAR_SAVE_TYPE(a,b,c) {a,c},
		#else
			#define M_DEFINE_DSGVAR_SAVE_TYPE(a,b,c) {c},
		#endif /* ACTIVE_EDITOR*/
	#else
		#if defined(ACTIVE_EDITOR)
			#define M_DEFINE_DSGVAR_SAVE_TYPE(a,b,c) {a},
		#else
			#define M_DEFINE_DSGVAR_SAVE_TYPE(a,b,c) { },
		#endif /* ACTIVE_EDITOR*/
	#endif
#endif /* AI_USE_SCRIPT */
	#include "DefSAI.h"
	#undef M_DEFINE_DSGVAR_SAVE_TYPE
};
 
 
#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */
unsigned char fn_ucGetSaveTypeNumber()
{
  return((unsigned char) (sizeof(a_st_SaveTypeTable)/sizeof(a_st_SaveTypeTable[0])));
}
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC */
 
 
unsigned char fn_ucDefaultSaveTypeNumber()
{
  return(DEFAULT_DSGVAR_SAVE_TYPE_ENTRY);
}
 
#if defined(_AI_LIB_) || defined(KNOW_SAI)
#if defined (AI_USE_SCRIPT)


#if defined(WIN32) && defined(_DEBUG) /* on PC, and in debug versions */
#ifdef __cplusplus
extern "C"
{
#endif
	extern ACP_tdxBool g_bIsLoadingAnAlways ;
#ifdef __cplusplus
}
#endif
#endif /* WIN32 && _DEBUG */

SAI_tdeFlags fn_eFindSaveTypeFromScriptName(char *szSaveType, char *_p_szPersoName, unsigned char _ucVarId )
{
	unsigned char i;
	for (i=0;i<fn_ucGetSaveTypeNumber();i++)
	{
		if (!stricmp(a_st_SaveTypeTable[i].szScriptName,szSaveType))
		{
			/* it is strictly forbidden for an actor to jave a dsgvar saved in the general save file if it is not in the fix load block */
			#if !defined ( ACTIVE_EDITOR )
			if
			(
				( a_st_SaveTypeTable[i].eFlags & SAI_ePlayerSaveMask )
				&& !GAM_fn_bIsEngineInFixMode()
			)
			{
				char szErrorMsg[200];
				sprintf(
					szErrorMsg,
					"Perso %s has dsgvar %d with a Player save type, but it is not loaded with the Fix block.",
					_p_szPersoName,
					_ucVarId
				);
				M_AIFatalErrorMsg(E_uwAIFatalInvalidDsgvarSaveType,szErrorMsg);
			}
			#if defined(WIN32) && defined(_DEBUG) /* on PC, and in debug versions */
			else if
			(
				g_bIsLoadingAnAlways /* if loading an always */
				&& ( a_st_SaveTypeTable[i].eFlags & SAI_eAllSaveMask ) /* and there is a save type */
			)
			{
				char szErrorMsg[200];
				sprintf(
					szErrorMsg,
					"Perso %s has dsgvar %d with a save type, but it is an always.",
					_p_szPersoName,
					_ucVarId
				);
				M_AIFatalErrorMsg(E_uwAIFatalInvalidDsgvarSaveType,szErrorMsg);
			}
			#endif /* WIN32 && _DEBUG */
			#endif /* ! ACTIVE_EDITOR */
			return(a_st_SaveTypeTable[i].eFlags);
		}
	}
	return(a_st_SaveTypeTable[fn_ucDefaultSaveTypeNumber()].eFlags);
}
#endif /* AI_USE_SCRIPT */
 
SAI_tdeFlags fn_eFindSaveTypeFromSaveTypeNumber(unsigned char ucSaveTypeNumber)
{
  return(a_st_SaveTypeTable[ucSaveTypeNumber].eFlags);
}
#endif /* _AI_LIB_ || KNOW_SAI */
 
#if defined (AI_USE_SCRIPT)
char *fn_szFindScriptNameFromSaveTypeNumber(unsigned char ucSaveTypeNumber)
{
  return(a_st_SaveTypeTable[ucSaveTypeNumber].szScriptName);
}
#endif /* AI_USE_SCRIPT */
 
#if defined(ACTIVE_EDITOR)
char *fn_szFindEditorNameFromSaveTypeNumber(unsigned char ucSaveTypeNumber)
{
  return(a_st_SaveTypeTable[ucSaveTypeNumber].szEditorName);
}
 
#if defined(_AI_LIB_) || defined(KNOW_SAI)
SAI_tdeFlags fn_eFindSaveTypeFromEditorName(char *szSaveType)
{
  unsigned char i;
  for (i=0;i<fn_ucGetSaveTypeNumber();i++)
  {
    if (!stricmp(a_st_SaveTypeTable[i].szEditorName,szSaveType))
	{
      return(a_st_SaveTypeTable[i].eFlags);
	}
  }
  return(a_st_SaveTypeTable[fn_ucDefaultSaveTypeNumber()].eFlags);
}
 
char *fn_szFindEditorNameFromSaveType(SAI_tdeFlags eFlags)
{
  unsigned char i;
  for (i=0;i<fn_ucGetSaveTypeNumber();i++)
  {
    if (a_st_SaveTypeTable[i].eFlags==eFlags)
	{
      return(a_st_SaveTypeTable[i].szEditorName);
	}
  }
  return(a_st_SaveTypeTable[fn_ucDefaultSaveTypeNumber()].szEditorName);
}
 
char *fn_szFindScriptNameFromSaveType(SAI_tdeFlags eFlags)
{
  unsigned char i;
  for (i=0;i<fn_ucGetSaveTypeNumber();i++)
  {
    if (a_st_SaveTypeTable[i].eFlags==eFlags)
	{
      return(a_st_SaveTypeTable[i].szScriptName);
	}
  }
  return(a_st_SaveTypeTable[fn_ucDefaultSaveTypeNumber()].szScriptName);
}
 
unsigned char fn_ucFindSaveTypeNumberFromScriptName(char *szSaveType)
{
  unsigned char i;
  for (i=0;i<fn_ucGetSaveTypeNumber();i++)
  {
    if (!stricmp(a_st_SaveTypeTable[i].szScriptName,szSaveType))
	{
      return(i);
	}
  }
  return(fn_ucGetSaveTypeNumber());
}
#endif /* _AI_LIB_ || KNOW_SAI*/
 
#endif /* ACTIVE_EDITOR*/
 
 
/******************************************************************************/
/* for OTI init types                                                         */
/******************************************************************************/
#if !defined(_AI_LIB_) && defined(__OBJINIT_h__)
  #define KNOW_OTI
#endif
 
#define MAX_LENGTH_INIT_TYPE_EDITOR_NAME 20
#define MAX_LENGTH_INIT_TYPE_SCRIPT_NAME 20
 
typedef struct tdstInitTypeEntry_
{
#if defined(ACTIVE_EDITOR)
  char szEditorName[MAX_LENGTH_INIT_TYPE_EDITOR_NAME];
#endif
#if defined (AI_USE_SCRIPT)
  char szScriptName[MAX_LENGTH_INIT_TYPE_SCRIPT_NAME];
#endif /* AI_USE_SCRIPT */
#if defined(_AI_LIB_) || defined(KNOW_OTI) 
  tdeObjectTreeInit eFlags;
#endif /* _AI_LIB_ || KNOW_OTI */
} tdstInitTypeEntry;
 
 
tdstInitTypeEntry a_st_InitTypeTable[] =
{
#if defined (AI_USE_SCRIPT)
	#if defined(_AI_LIB_) || defined(KNOW_OTI)
		#if defined(ACTIVE_EDITOR)
			#define M_DEFINE_DSGVAR_INIT_TYPE(a,b,c) {a,b,c},
		#else
			#define M_DEFINE_DSGVAR_INIT_TYPE(a,b,c) {b,c},
		#endif /* ACTIVE_EDITOR*/
	#else
		#if defined(ACTIVE_EDITOR)
			#define M_DEFINE_DSGVAR_INIT_TYPE(a,b,c) {a,b},
		#else
			#define M_DEFINE_DSGVAR_INIT_TYPE(a,b,c) {b},
		#endif /* ACTIVE_EDITOR*/
	#endif
#else /* AI_USE_SCRIPT */
	#if defined(_AI_LIB_) || defined(KNOW_OTI)
		#if defined(ACTIVE_EDITOR)
			#define M_DEFINE_DSGVAR_INIT_TYPE(a,b,c) {a,c},
		#else
			#define M_DEFINE_DSGVAR_INIT_TYPE(a,b,c) {c},
		#endif /* ACTIVE_EDITOR*/
	#else
		#if defined(ACTIVE_EDITOR)
			#define M_DEFINE_DSGVAR_INIT_TYPE(a,b,c) {a},
		#else
			#define M_DEFINE_DSGVAR_INIT_TYPE(a,b,c) { },
		#endif /* ACTIVE_EDITOR*/
	#endif
#endif /* AI_USE_SCRIPT */
	#include "DefOTI.h"
	#undef M_DEFINE_DSGVAR_INIT_TYPE
};
 
 
#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */
unsigned char fn_ucGetInitTypeNumber()
{
  return((unsigned char) (sizeof(a_st_InitTypeTable)/sizeof(a_st_InitTypeTable[0])));
}
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC */
 
 
unsigned char fn_ucDefaultInitTypeNumber()
{
  return(DEFAULT_DSGVAR_INIT_TYPE_ENTRY);
}
 
#if defined(_AI_LIB_) || defined(KNOW_OTI)
#if defined (AI_USE_SCRIPT)
tdeObjectTreeInit fn_eFindInitTypeFromScriptName(char *szInitType)
{
  unsigned char i;
  for (i=0;i<fn_ucGetInitTypeNumber();i++)
  {
    if (!stricmp(a_st_InitTypeTable[i].szScriptName,szInitType))
	{
      return(a_st_InitTypeTable[i].eFlags);
	}
  }
  return(a_st_InitTypeTable[fn_ucDefaultInitTypeNumber()].eFlags);
}
#endif /* AI_USE_SCRIPT */
 
tdeObjectTreeInit fn_eFindInitTypeFromInitTypeNumber(unsigned char ucInitTypeNumber)
{
  return(a_st_InitTypeTable[ucInitTypeNumber].eFlags);
}
#endif /* _AI_LIB_ || KNOW_OTI*/
 
#if defined (AI_USE_SCRIPT)
char *fn_szFindScriptNameFromInitTypeNumber(unsigned char ucInitTypeNumber)
{
  return(a_st_InitTypeTable[ucInitTypeNumber].szScriptName);
}
#endif /* AI_USE_SCRIPT */
 
#if defined(ACTIVE_EDITOR)
char *fn_szFindEditorNameFromInitTypeNumber(unsigned char ucInitTypeNumber)
{
  return(a_st_InitTypeTable[ucInitTypeNumber].szEditorName);
}
 
#if defined(_AI_LIB_) || defined(KNOW_OTI)
tdeObjectTreeInit fn_eFindInitTypeFromEditorName(char *szInitType)
{
  unsigned char i;
  for (i=0;i<fn_ucGetInitTypeNumber();i++)
  {
    if (!stricmp(a_st_InitTypeTable[i].szEditorName,szInitType))
	{
      return(a_st_InitTypeTable[i].eFlags);
	}
  }
  return(a_st_InitTypeTable[fn_ucDefaultInitTypeNumber()].eFlags);
}
 
char *fn_szFindEditorNameFromInitType(tdeObjectTreeInit eFlags)
{
  unsigned char i;
  for (i=0;i<fn_ucGetInitTypeNumber();i++)
  {
    if (a_st_InitTypeTable[i].eFlags==eFlags)
	{
      return(a_st_InitTypeTable[i].szEditorName);
	}
  }
  return(a_st_InitTypeTable[fn_ucDefaultInitTypeNumber()].szEditorName);
}
 
char *fn_szFindScriptNameFromInitType(tdeObjectTreeInit eFlags)
{
  unsigned char i;
  for (i=0;i<fn_ucGetInitTypeNumber();i++)
  {
    if (a_st_InitTypeTable[i].eFlags==eFlags)
	{
      return(a_st_InitTypeTable[i].szScriptName);
	}
  }
  return(a_st_InitTypeTable[fn_ucDefaultInitTypeNumber()].szScriptName);
}
 
unsigned char fn_ucFindInitTypeNumberFromScriptName(char *szInitType)
{
  unsigned char i;
  for (i=0;i<fn_ucGetInitTypeNumber();i++)
  {
    if (!stricmp(a_st_InitTypeTable[i].szScriptName,szInitType))
	{
      return(i);
	}
  }
  return(fn_ucGetInitTypeNumber());
}
#endif /* _AI_LIB_ || KNOW_OTI*/
 
#endif /* ACTIVE_EDITOR*/
