' ---------------------------------------------------------------------------
' uCalcVB.vb: VB.NET Include file for uCalc Fast Math Parser 4.00
' Designed for : Visual Basic .NET 2010 and 2012
' Instructions: Add this file to your project's directory (from the menu:
'               Project / Add Existing Item...) and copy uCalc DLLs to
'               your bin and/or bin\Debug directory (or any directory in
'               the path) and you're ready to go.
'
' This file auto-generated by : VisualBasicNET.uc using uCalc Transform 3.0
' Auto-generation timestamp: 08/14/14
' VisualBasicNET.uc prepared by : Daniel Corbier
' Visit www.ucalc.com for additional resources.
' ---------------------------------------------------------------------------

Imports System.Runtime.InteropServices
Public Module uCalcVBNET
   ' Definition properties
   Public Const ucAlphaNumeric As Integer = 1
   Public Const ucArgSeparator As Integer = 2
   Public Const ucCodeBlock As Integer = 3
   Public Const ucCodeBlockMatch As Integer = 4
   Public Const ucMemberAccess As Integer = 5
   Public Const ucQuotedText As Integer = 6
   Public Const ucStatementSep As Integer = 7
   Public Const ucWhiteSpace As Integer = 8
   Public Const ucCurrentThread As Integer = 9
   Public Const ucLocalVar As Integer = 10
   Public Const ucStaticVar As Integer = 11
   Public Const ucDefineNow As Integer = 11 ' same as ucStaticVar
   Public Const ucTempDef As Integer = 12
   Public Const ucEvalInsert As Integer = 13
   Public Const ucEvalDuringParse As Integer = 14
   Public Const ucExpandInsert As Integer = 15
   Public Const ucFileInclude As Integer = 16
   Public Const ucCurrentSpace As Integer = 17
   Public Const ucDefSpace As Integer = 18
   Public Const ucEvalSpace As Integer = 19
   Public Const ucFunction As Integer = 64
   Public Const ucOperator As Integer = 128
   Public Const ucVariable As Integer = 256
   Public Const ucSyntax As Integer = 512
   Public Const ucLiteral As Integer = 1024
   Public Const ucSymbol As Integer = 2048
   Public Const ucReducible As Integer = 4096
   Public Const ucLock As Integer = 8192
   Public Const ucInfix As Integer = 16384
   Public Const ucPrefix As Integer = 32768
   Public Const ucPostfix As Integer = 49152
   
   ' uCalc Commands
   Public Const uc_Define As Integer = 1
   Public Const uc_DefineSyntax As Integer = 2
   Public Const uc_Eval As Integer = 3
   Public Const uc_EvalStr As Integer = 4
   Public Const uc_Evaluate As Integer = 5
   Public Const uc_EvaluateLng As Integer = 6
   Public Const uc_EvaluateStr As Integer = 7
   Public Const uc_GetCaseSensitivity As Integer = 8
   Public Const uc_GetDefaultPass As Integer = 9
   Public Const uc_GetDefaultPrecedence As Integer = 10
   Public Const uc_GetDefaultRank As Integer = 11
   Public Const uc_GetCodeAddr As Integer = 12
   Public Const uc_GetDefaultThread As Integer = 13
   Public Const uc_GetDefaultType As Integer = 14
   Public Const uc_GetDefSeparator As Integer = 15
   Public Const uc_GetDefSpace As Integer = 16
   Public Const uc_GetErrorNumber As Integer = 17
   Public Const uc_GetEvalSpace As Integer = 18
   Public Const uc_GetParentThread As Integer = 20
   Public Const uc_GetSyntaxEqual As Integer = 21
   Public Const uc_Parse As Integer = 22
   Public Const uc_ReleaseItem As Integer = 23
   Public Const uc_SetCaseSensitivity As Integer = 24
   Public Const uc_SetCodeAddr As Integer = 25
   Public Const uc_SetDefaultPrecedence As Integer = 26
   Public Const uc_SetDefaultRank As Integer = 27
   Public Const uc_SetDefaultThread As Integer = 28
   Public Const uc_SetDefaultType As Integer = 29
   Public Const uc_SetDefSeparator As Integer = 30
   Public Const uc_SetErrorNumber As Integer = 31
   Public Const uc_SetParentThread As Integer = 32
   Public Const uc_SetSyntaxEqual As Integer = 33
   Public Const uc_NewThread As Integer = 34
   Public Const uc_RegExWordBoundaryChars As Integer = 35
   Public Const uc_RegExEscapeChar As Integer = 36
   Public Const uc_License As Integer = 37
   
   ' License options
   Public Const uc_License_Demo As Integer = 0
   Public Const uc_License_FMP_Free As Integer = 1
   Public Const uc_License_FMP_Standard_32 As Integer = 2
   Public Const uc_License_FMP_Standard_64 As Integer = 3
   Public Const uc_License_FMP_32_and_64 As Integer = 4
   Public Const uc_License_LanguageBuilder As Integer = 5
   Public Const uc_License_GeneralParser As Integer = 6
   Public Const uc_License_Interpreter As Integer = 7
   Public Const uc_License_ConsoleCalc As Integer = 8
   Public Const uc_License_WindowsCalc As Integer = 9
   Public Const uc_License_StringLib As Integer = 10
   Public Const uc_License_Transform As Integer = 11
   Public Const uc_License_TransformLib As Integer = 12
   Public Const uc_License_Search As Integer = 13
   Public Const uc_License_SearchLib As Integer = 14
   Public Const uc_License_Library1 As Integer = 15
   Public Const uc_License_Library2 As Integer = 16
   Public Const uc_License_Beta As Integer = 17
   Public Const uc_License_Debugger As Integer = 18
   Public Const uc_License_uCalc_All As Integer = 50
   Public Const uc_License_Developer As Integer = 100
   Public Const uc_License_EndUser As Integer = 101
   Public Const uc_AddDebugger As Integer = 39
   Public Const Debug_ReleaseItem As Integer = 1
   Public Const Debug_StdFuncCall As Integer = 2
   Public Const Debug_UserFuncCall As Integer = 3
   Public Const Debug_GetTextToken As Integer = 4
   Public Const Debug_ErrorHandler As Integer = 5
   Public Const Debug_ParseExpr As Integer = 6
   Public Const Debug_ParseItem As Integer = 7
   Public Const Debug_EvalOperation As Integer = 8
   Public Const Debug_DefSyntax As Integer = 9
   Public Const Debug_Define As Integer = 10
   Public Const Debug_DefinePart As Integer = 11
   Public Const Debug_Expand As Integer = 12
   Public Const Debug_ExpandSuccess As Integer = 13
   Public Const Debug_ExpandMiss As Integer = 14
   Public Const Debug_ExpandFail As Integer = 15
   Public Const Debug_GetSyntaxBlock As Integer = 16
   Public Const Debug_GetCodeBlock As Integer = 17
   Public Const Debug_LineNumber As Integer = 18
   Public Const Debug_TotalTally As Integer = 19
   Public Const Debug_Breakpoint As Integer = 20
   Public Const Debug_Delay As Integer = 21
   Public Const Debug_JumpTo As Integer = 22
   Public Const Debug_StepAction As Integer = 23
   Public Const uc_AddErrorHandler As Integer = 40
   Public Const uc_GetSymbolTable As Integer = 41
   Public Const uc_GetSteps As Integer = 42
   Public Const uc_GetStepsCount As Integer = 43
   Public Const uc_SetTypeOutput As Integer = 45
   Public Const uc_Group As Integer = 46
   Public Const uc_GetTag As Integer = 47
   Public Const uc_SetTag As Integer = 48
   Public Const uc_GetCallbackData As Integer = 50
   Public Const uc_SetCallbackReturn As Integer = 51
   Public Const uc_GetErrorExpression As Integer = 60
   Public Const uc_SetExpression As Integer = 61
   Public Const uc_GetSymbol As Integer = 62
   Public Const uc_SetSymbol As Integer = 63
   Public Const uc_GetLocation As Integer = 64
   Public Const uc_GetTokenType As Integer = 65
   Public Const uc_GetTokenProperties As Integer = 66
   Public Const uc_TrigMode As Integer = 67
   Public Const uc_ItemClone As Integer = 70
   Public Const uc_DataConvert As Integer = 71
   Public Const uc_DataCopy As Integer = 72
   Public Const uc_DataAlloc As Integer = 72
   Public Const uc_DataFree As Integer = 73
   Public Const uc_DataReset As Integer = 74
   
   ' FPU commands
   Public Const uc_SetFPU As Integer = 75
   Public Const uc_SetFPU_HostProg As Integer = 76
   Public Const uc_GetFPU As Integer = 77
   Public Const uc_GetFPU_HostProg As Integer = 78
   Public Const uc_ToggleFPU As Integer = 79
   Public Const uc_ToggleFPU_HostProg As Integer = 80
   Public Const uc_ErrorClear As Integer = 85
   Public Const uc_RestoreErrorMessageBox As Integer = 86
   Public Const uc_SetErrorMessage As Integer = 91
   Public Const uc_GetErrorMessage As Integer = 92
   Public Const uc_SerialNumber As Integer = 93
   Public Const uc_SetTurbo As Integer = 94
   Public Const uc_Expand As Integer = 95
   Public Const uc_GetNextToken As Integer = 96
   Public Const uc_GetItemData As Integer = 97
   Public Const uc_SetItemData As Integer = 98
   Public Const uc_GetThreadAddr As Integer = 99
   Public Const uc_GetCodeBlock As Integer = 100
   Public Const uc_Status_CurrentPass As Integer = 101
   Public Const uc_Status_MaxPass As Integer = 102
   Public Const uc_Status_Location As Integer = 103
   Public Const uc_Status_NestedLevel As Integer = 104
   Public Const uc_Status_TextLength As Integer = 105
   Public Const uc_Find As Integer = 110
   Public Const uc_FindAddMatch As Integer = 111
   Public Const uc_FindGetIndex As Integer = 112
   Public Const uc_FindGetCount As Integer = 113
   Public Const uc_FindGetStart As Integer = 114
   Public Const uc_FindGetLength As Integer = 115
   Public Const uc_FindGetText As Integer = 116
   Public Const uc_FindReset As Integer = 117
   Public Const uc_FindReplace As Integer = 118
   Public Const uc_FindFilter As Integer = 119
   Public Const uc_FindSetFilter As Integer = 120
   Public Const uc_FindFilterSort As Integer = 1
   Public Const uc_FindFilterUnique As Integer = 2
   Public Const uc_FindFilterTally As Integer = 4
   Public Const uc_FindFilterSeparator As Integer = 8
   Public Const uc_FindFilterStartText As Integer = 16
   Public Const uc_FindFilterEndText As Integer = 32
   Public Const uc_FindContext_Other As Integer = 0
   Public Const uc_FindContext_Found As Integer = 1
   Public Const uc_FindContext_Replaced As Integer = 2
   Public Const uc_FindZoomIn As Integer = 1
   Public Const uc_FindTransformInPlace As Integer = 2
   Public Const uc_Properties As Integer = 1
   Public Const uc_Thread As Integer = 2
   Public Const uc_Address As Integer = 3
   Public Const uc_SymbolName As Integer = 4
   Public Const uc_Rank As Integer = 5
   Public Const uc_Precedence As Integer = 6
   Public Const uc_OverloadHandle As Integer = 7
   Public Const uc_OverloadCount As Integer = 8
   Public Const uc_ByteSize As Integer = 9
   Public Const uc_ArgCount As Integer = 10
   Public Const uc_DataType As Integer = 12
   Public Const uc_Handle As Integer = 13
   Public Const uc_Value As Integer = 14
   Public Const uc_Property As Integer = 15
   
   ' Error numbers
   Public Const uc_Err_None As Integer = 0
   Public Const uc_Err_Dynamically_Defined As Integer = 1
   Public Const uc_Err_Syntax_Error As Integer = 2
   Public Const uc_Err_Undefined_Identifier As Integer = 3
   Public Const uc_Err_FileNotFound As Integer = 4
   Public Const uc_Err_Unrecognized_Token As Integer = 5
   Public Const uc_Err_Unrecognized_Command As Integer = 6
   Public Const uc_Err_Datatype_Mismatch As Integer = 7
   Public Const uc_Err_Invalid_Argument_Count As Integer = 8
   Public Const uc_Err_Invalid_Definition As Integer = 9
   Public Const uc_Err_CodeBlock_Error As Integer = 10
   Public Const uc_Err_Undefined_Callback As Integer = 11
   Public Const uc_Err_ErrMsgAlreadyDefined As Integer = 12
   Public Const uc_Err_ItemCannotBeModified As Integer = 13
   Public Const uc_Err_Unrecognized_Member As Integer = 14
   Public Const uc_Err_Unbalanced_Quote As Integer = 15
   Public Const uc_Err_Array_Bounds_Exceeded As Integer = 20
   Public Const uc_Err_Float_Denormal_Operand As Integer = 21
   Public Const uc_Err_Float_Divide_By_Zero As Integer = 22
   Public Const uc_Err_Float_Inexact_Result As Integer = 23
   Public Const uc_Err_Float_Invalid_Operation As Integer = 24
   Public Const uc_Err_Float_Overflow As Integer = 25
   Public Const uc_Err_Float_Stack_Check As Integer = 26
   Public Const uc_Err_Float_Underflow As Integer = 27
   Public Const uc_Err_Integer_Divide_By_Zero As Integer = 28
   Public Const uc_Err_Integer_Overflow As Integer = 29
   Public Const uc_Err_Privileged_Instruction As Integer = 30
   
   ' Error response
   Public Const ucAbort As Integer = 0
   Public Const ucResume As Integer = 1
   Public Const ucReRaise As Integer = 2
   
   ' FPU Control Word Settings
   Public Const uc_FPU_Mask_InvalidOp As Integer = 1
   Public Const uc_FPU_Mask_DenormalOp As Integer = 2
   Public Const uc_FPU_Mask_ZeroDivide As Integer = 4
   Public Const uc_FPU_Mask_Overflow As Integer = 8
   Public Const uc_FPU_Mask_Underflow As Integer = 16
   Public Const uc_FPU_Mask_PrecisionLoss As Integer = 32
   Public Const uc_FPU_Precision_Single As Integer = 0
   Public Const uc_FPU_Precision_Double As Integer = 256
   Public Const uc_FPU_Precision_Extended As Integer = 768
   Public Const uc_FPU_Round_Even As Integer = 0
   Public Const uc_FPU_Round_Down As Integer = 1024
   Public Const uc_FPU_Round_Up As Integer = 2048
   Public Const uc_FPU_Round_Toward As Integer = 3072
   
   ' Data type handler callback action modes
   Public Const uc_TypeHandler_Store As Integer = 2
   Public Const uc_TypeHandler_StringOutput As Integer = 3
   Public Const uc_TypeHandler_Free As Integer = 4
   Public Const uc_TypeHandler_FuncRet As Integer = 5
   Public Const uc_TypeHandler_Copy As Integer = 6
   Public Const uc_TypeHandler_Alloc As Integer = 7
   Public Const uc_TypeHandler_Reset As Integer = 8
   Public Const uc_Callback_Undefined As Integer = 0 ' Returns error
   
   ' Data Type callbacks
   Public Const uc_Complex As Integer = 1
   Public Const uc_Currency As Integer = 2
   Public Const uc_Double As Integer = 3
   Public Const uc_Extended As Integer = 4
   Public Const uc_Int8 As Integer = 5
   Public Const uc_Int8u As Integer = 6
   Public Const uc_Int16 As Integer = 7
   Public Const uc_Int16u As Integer = 8
   Public Const uc_Int32 As Integer = 9
   Public Const uc_Int32u As Integer = 10
   Public Const uc_Int64 As Integer = 11
   Public Const uc_Int64u As Integer = 12
   Public Const uc_Single As Integer = 13
   Public Const uc_String As Integer = 14
   Public Const uc_String_LPCSTR As Integer = 15
   Public Const uc_String_Fixed As Integer = 16
   Public Const uc_String_Wide As Integer = 17
   Public Const uc_Stack As Integer = 18
   Public Const uc_Table As Integer = 19
   Public Const uc_SortedList As Integer = 20
   Public Const uc_Void As Integer = 21
   Public Const uc_User_Type As Integer = 22
   Public Const uc_Convert_Generic As Integer = 23
   Public Const uc_Convert_Same As Integer = 24
   Public Const uc_Convert_Double_Extended As Integer = 25
   Public Const uc_Convert_Int8_Extended As Integer = 26
   Public Const uc_Convert_Int8u_Extended As Integer = 27
   Public Const uc_Convert_Int16_Extended As Integer = 28
   Public Const uc_Convert_Int16u_Extended As Integer = 29
   Public Const uc_Convert_Int32_Extended As Integer = 30
   Public Const uc_Convert_Int32u_Extended As Integer = 31
   Public Const uc_Convert_Int64_Extended As Integer = 32
   Public Const uc_Convert_Int64u_Extended As Integer = 33
   Public Const uc_Convert_Single_Extended As Integer = 34
   Public Const uc_Convert_Void_Extended As Integer = 35
   Public Const uc_Convert_Extended_Double As Integer = 37
   Public Const uc_Convert_Extended_Single As Integer = 38
   Public Const uc_Convert_Extended_Int16u As Integer = 39
   Public Const uc_Convert_Extended_Int32 As Integer = 40
   Public Const uc_Convert_Complex_Extended As Integer = 41
   Public Const uc_Convert_Extended_Complex As Integer = 42
   
   ' Default built-in routines
   Public Const uc_Op_Negate As Integer = 43
   Public Const uc_Op_UnaryPlus As Integer = 44
   Public Const uc_Op_Percentage As Integer = 45
   Public Const uc_Op_StrConcat As Integer = 46
   Public Const uc_Op_Add_Int32 As Integer = 47
   Public Const uc_Op_Add As Integer = 48
   Public Const uc_Op_Add_Complex As Integer = 49
   Public Const uc_Op_Subtract_Int32 As Integer = 50
   Public Const uc_Op_Subtract As Integer = 51
   Public Const uc_Op_Multiply_Int32 As Integer = 52
   Public Const uc_Op_Multiply As Integer = 53
   Public Const uc_Op_Multiply_Complex As Integer = 54
   Public Const uc_Op_Divide_Int32 As Integer = 55
   Public Const uc_Op_Divide As Integer = 56
   Public Const uc_Op_Mod_Int32 As Integer = 57
   Public Const uc_Op_Mod As Integer = 58
   Public Const uc_Op_PowerOf_ExtToExt As Integer = 59
   Public Const uc_Op_PowerOf_ExtToLng As Integer = 60
   Public Const uc_Op_PowerOf_CplxToCplx As Integer = 61
   Public Const uc_Op_GreaterThan As Integer = 62
   Public Const uc_Op_GreaterOrEqual As Integer = 63
   Public Const uc_Op_LessThan As Integer = 64
   Public Const uc_Op_LessOrEqual As Integer = 65
   Public Const uc_Op_Equal As Integer = 66
   Public Const uc_Op_NotEqual As Integer = 67
   Public Const uc_Op_GreaterThan_Str As Integer = 68
   Public Const uc_Op_GreaterOrEqual_Str As Integer = 69
   Public Const uc_Op_LessThan_Str As Integer = 70
   Public Const uc_Op_LessOrEqual_Str As Integer = 71
   Public Const uc_Op_Equal_Str As Integer = 72
   Public Const uc_Op_NotEqual_Str As Integer = 73
   Public Const uc_Op_Not_Int32 As Integer = 74
   Public Const uc_Op_And_Int32 As Integer = 75
   Public Const uc_Op_Or_Int32 As Integer = 76
   Public Const uc_Op_Xor_Int32 As Integer = 77
   Public Const uc_Op_Eqv_Int32 As Integer = 78
   Public Const uc_Op_Imp_Int32 As Integer = 79
   Public Const uc_Op_AndAlso As Integer = 80
   Public Const uc_Op_OrElse As Integer = 81
   Public Const uc_Op_Factorial As Integer = 82
   Public Const uc_Func_IIf As Integer = 83
   Public Const uc_Func_IIf_Str As Integer = 84
   Public Const uc_Func_Sin As Integer = 85
   Public Const uc_Func_Cos As Integer = 86
   Public Const uc_Func_Tan As Integer = 87
   Public Const uc_Func_Atan As Integer = 88
   Public Const uc_Func_Ceil As Integer = 89
   Public Const uc_Func_Abs As Integer = 90
   Public Const uc_Func_Abs_Int32 As Integer = 91
   Public Const uc_Func_Exp As Integer = 92
   Public Const uc_Func_Log As Integer = 93
   Public Const uc_Func_Floor As Integer = 94
   Public Const uc_Func_SquareRoot As Integer = 95
   Public Const uc_Func_BaseConvert As Integer = 96
   Public Const uc_Func_ExprHandle As Integer = 97
   Public Const uc_Func_VarPtr As Integer = 98
   Public Const uc_Func_uCalc As Integer = 99
   Public Const uc_Func_uCalcStr As Integer = 100
   Public Const uc_Func_ucAddr As Integer = 101
   Public Const uc_Func_ValueAtAddr As Integer = 102
   Public Const uc_Func_SpecialArg As Integer = 103
   Public Const uc_Op_StringMult As Integer = 104
   Public Const uc_Func_For As Integer = 105
   Public Const uc_Func_Loop As Integer = 107
   Public Const uc_Func_LoadLibrary As Integer = 108
   Public Const uc_Func_GetProcAddress As Integer = 109
   Public Const uc_NullString As Integer = 110
   Public Const uc_True As Integer = 111
   Public Const uc_Func_Peek As Integer = 112
   Public Const uc_Func_Poke As Integer = 113
   Public Const uc_Func_Int As Integer = 115
   Public Const uc_Func_Frac As Integer = 116
   Public Const uc_Func_Sgn As Integer = 117
   Public Const uc_Func_PushData_Stack As Integer = 120
   ' Public Const uc_Func_PopHandle_Stack As Integer = 121
   Public Const uc_Func_PopNum_Stack As Integer = 122
   Public Const uc_Func_PopStr_Stack As Integer = 123
   Public Const uc_Func_ReadHandle_Stack As Integer = 124
   Public Const uc_Func_ReadNum_Stack As Integer = 125
   Public Const uc_Func_ReadStr_Stack As Integer = 126
   Public Const uc_Func_Count_Stack As Integer = 127
   Public Const uc_Op_Concat_Stack As Integer = 128
   Public Const uc_Func_Populate_Stack As Integer = 129
   Public Const uc_Insert_Table As Integer = 130
   Public Const uc_Delete_Table As Integer = 131
   Public Const uc_Index_Table As Integer = 132
   Public Const uc_Handle_Table As Integer = 133
   Public Const uc_HandleB_Table As Integer = 134
   Public Const uc_ReadData_Table As Integer = 135
   Public Const uc_ReadNum_Table As Integer = 136
   Public Const uc_Func_Min As Integer = 137
   Public Const uc_Func_Max As Integer = 138
   Public Const uc_Func_Min_Str As Integer = 139
   Public Const uc_Func_Max_Str As Integer = 140
   Public Const uc_SetVariableValue As Integer = 141
   Public Const uc_SetVariableValueAnyType As Integer = 141
   Public Const uc_SetVariableValueLong As Integer = 142
   Public Const uc_SetVariableValueDouble As Integer = 143
   Public Const uc_SetVariableValueExtended As Integer = 144
   Public Const uc_ResetVariable As Integer = 145
   
   ' Misc other callbacks
   Public Const uc_EvaluateAddr As Integer = 150
   Public Const uc_EvaluateTurboAddr As Integer = 151
   Public Const uc_ExceptionHelper As Integer = 152
   Public Const uc_DefaultErrorHandler As Integer = 153
   Public Const uc_Raise_Error As Integer = 154
   Public Const uc_Func_IsIncomplete As Integer = 155
   Public Const uc_ScriptTimerStart As Integer = 160
   Public Const uc_LoadTimeTix As Integer = 161
   Public Const uc_Op_Ext_Plus_Complex As Integer = 190
   Public Const uc_Op_Ext_Times_Complex As Integer = 191
   Public Const uc_Func_If_ElseIf As Integer = 195
   Public Const uc_Func_SetSyntaxParams As Integer = 196
   Public Const uc_Func_SpecialUCase As Integer = 197
   Public Const uc_Func_Rand As Integer = 198
   Public Const uc_Func_GetmatchArg As Integer = 199
   Public Const uc_Func_PatternNum As Integer = 200
   Public Const uc_Func_PatternStr As Integer = 201
   Public Const uc_Convert_Stack_Table As Integer = 220
   Public Const uc_Convert_Stack_SortedList As Integer = 221
   Public Const uc_Convert_Table_Stack As Integer = 222
   Public Const uc_Convert_SortedList_Stack As Integer = 223
   Public Const uc_Expand_List As Integer = 1
   Public Const uc_Expand_StackPtr As Integer = 2
   Public Const uc_HandleToken As Integer = 21 ' &h15
   
   ' Trig Mode
   Public Const uc_ReturnTrigMode As Integer = 0
   Public Const uc_Radians As Integer = 1
   Public Const uc_Degrees As Integer = 2
   Public Const uc_Grad As Integer = 3
   
   ' Misc
   Public Const ucTrue As Integer = 1
   Public Const ucFalse As Integer = 0
   Public Const uc_Rank_First As Integer = 1
   Public Const uc_Rank_Last As Integer = -1
   
   ' Pattern options
   Public Const uc_Pattern_ArgCount As Integer = 1
   Public Const uc_Pattern_ArgIndex As Integer = 2
   Public Const uc_Pattern_ArgLength As Integer = 3
   Public Const uc_Pattern_ArgLocation As Integer = 4
   Public Const uc_Pattern_ArgText As Integer = 5
   Public Const uc_Pattern_DocumentLength As Integer = 6
   Public Const uc_Pattern_DocumentText As Integer = 7
   Public Const uc_Pattern_CriteriaCount As Integer = 8
   Public Const uc_Pattern_CriteriaIndex As Integer = 9
   Public Const uc_Pattern_MatchLength As Integer = 10
   Public Const uc_Pattern_MatchLocation As Integer = 11
   Public Const uc_Pattern_MatchText As Integer = 12
   Public Const uc_Pattern_MatchTally As Integer = 13
   Public Const uc_Pattern_SkipTally As Integer = 14
   
   ' String Library
   Public Const uc_StringLibNum As Integer = 230
   Public Const uc_StringLibStr As Integer = 231
   Public Const ucs_SetStringDefaults As Integer = 4
   Public Const ucs_Start As Integer = 5
   Public Const ucs_Limit As Integer = 6
   Public Const ucs_StartAfter As Integer = 7
   Public Const ucs_StopAfter As Integer = 8
   Public Const ucs_Between As Integer = 9
   Public Const ucs_Nth As Integer = 10
   Public Const ucs_File As Integer = 11
   Public Const ucs_Pos As Integer = 12
   Public Const ucs_Length As Integer = 13
   Public Const ucs_Text As Integer = 14
   Public Const ucs_Count As Integer = 15
   Public Const ucs_CountSkipped As Integer = 16
   Public Const ucs_InStr As Integer = 17
   Public Const ucs_Tally As Integer = 18
   Public Const ucs_UCase As Integer = 19
   Public Const ucs_LCase As Integer = 20
   Public Const ucs_MCase As Integer = 21
   Public Const ucs_Replace As Integer = 22
   Public Const ucs_Remove As Integer = 23
   Public Const ucs_Mid As Integer = 24
   Public Const ucs_Left As Integer = 25
   Public Const ucs_Right As Integer = 26
   Public Const ucs_Len As Integer = 27
   Public Const ucs_Extract As Integer = 28
   Public Const ucs_Remain As Integer = 29
   Public Const ucs_Skip As Integer = 30
   Public Const ucs_Delim As Integer = 31
   Public Const ucs_Retain As Integer = 32
   Public Const ucs_Range As Integer = 33
   Public Const ucs_Compare As Integer = 34
   Public Const ucs_Equals As Integer = 35
   Public Const ucs_Split As Integer = 36
   Public Const ucs_StringItem As Integer = 37
   Public Const ucs_StringItemCount As Integer = 38
   
   ' String Libarary Options
   Public Const ucByte As Integer = 1
   Public Const ucChar As Integer = 2
   Public Const ucWord As Integer = 4
   Public Const ucToken As Integer = 8
   Public Const ucBlock As Integer = 16
   Public Const ucExpr As Integer = 32
   Public Const ucQuote As Integer = 64
   Public Const ucSpace As Integer = 128
   Public Const ucCase As Integer = 256
   ' End Of String Library Options
   Public Delegate Sub ucFunctionDelegate(ByVal Expr As Integer)
   Public Delegate Function ucErrorHandlerDelegate(ByVal t As Integer) As Integer
   Public Delegate Function ucCheckForStop(ByVal FindContext As Integer, ByVal t As Integer) As Integer
   
   ' Main Functions
   Public Declare Function ucAddr Lib "uCalc32v400.dll" (ByVal AddressIndex As Integer) As Integer
   Public Declare Function uCalc Lib "uCalc32v400.dll" (ByVal ucCommand As Integer, <MarshalAsAttribute(UnmanagedType.AnsiBStr)>Optional ByRef TextIn As String = "", Optional ByVal a As Integer = 0, Optional ByVal b As Integer = 0, Optional ByVal c As Integer = 0, Optional ByVal t As Integer = 0) As Integer
   Public Declare Function uCalc Lib "uCalc32v400.dll" (ByVal ucCommand As Integer, <MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef TextIn As String, ByVal a As ucCheckForStop, Optional ByVal b As Integer = 0, Optional ByVal c As Integer = 0, Optional ByVal t As Integer = 0) As Integer
   Public Declare Function uCalc Lib "uCalc32v400.dll" (ByVal ucCommand As Integer, <MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef TextIn As String, ByVal a As ucFunctionDelegate, Optional ByVal b As Integer = 0, Optional ByVal c As Integer = 0, Optional ByVal t As Integer = 0) As Integer
   
   ' Insert Other Exports
   Public Declare Function ExceptionHelper Lib "uCalc32v400.dll" (ByVal Expr As Integer, ByVal SystemError As Integer) As Integer
   Public Declare Function ucEvaluate Lib "uCalc32v400.dll" (ByVal Item As Integer) As Double
   Public Declare Function ucArgLng Lib "uCalc32v400.dll" (ByVal Expr As Integer, ByVal index As Integer) As Integer
   Public Declare Function ucArg Lib "uCalc32v400.dll" (ByVal Expr As Integer, ByVal index As Integer) As Double
   Public Declare Sub ucArgStr_ Lib "uCalc32v400.dll" Alias "ucArgStr" (<MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef ReturnStr As String, ByVal Expr As Integer, ByVal index As Integer)
   Public Function ucArgStr(ByVal Expr As Integer, ByVal index As Integer) As String
      Dim ReturnStr As String = ""
      ucArgStr_(ReturnStr,  Expr ,  index )
      If ReturnStr Is Nothing Then Return "" Else Return ReturnStr
   End Function
   Public Declare Function ucArgHandle Lib "uCalc32v400.dll" (ByVal Expr As Integer, ByVal index As Integer) As Integer
   Public Declare Function ucArgCount Lib "uCalc32v400.dll" (ByVal Expr As Integer) As Integer
   Public Declare Sub ucReturnLng Lib "uCalc32v400.dll" (ByVal Expr As Integer, ByVal ReturnValue As Integer)
   Public Declare Sub ucReturn Lib "uCalc32v400.dll" Alias "ucReturnDbl" (ByVal Expr As Integer, ByVal ReturnValue As Double)
   Public Declare Sub ucReturnStr Lib "uCalc32v400.dll" (ByVal Expr As Integer, <MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef ReturnValue As String)
   Public Declare Function ucGetVariableValue Lib "uCalc32v400.dll" (ByVal Item As Integer) As Double
   Public Declare Function ucGetVariableValueLng Lib "uCalc32v400.dll" (ByVal Item As Integer) As Integer
   Public Declare Sub ucGetVariableValueStr_ Lib "uCalc32v400.dll" Alias "ucGetVariableValueStr" (<MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef ReturnStr As String, ByVal Item As Integer)
   Public Function ucGetVariableValueStr(ByVal Item As Integer) As String
      Dim ReturnStr As String = ""
      ucGetVariableValueStr_(ReturnStr,  Item )
      If ReturnStr Is Nothing Then Return "" Else Return ReturnStr
   End Function
   Public Declare Sub ucSetVariableValueLng Lib "uCalc32v400.dll" (ByVal Item As Integer, ByVal NewValue As Integer)
   Public Declare Sub ucSetVariableValue Lib "uCalc32v400.dll" Alias "ucSetVariableValueDbl" (ByVal Item As Integer, ByVal NewValue As Double)
   Public Declare Sub ucSetVariableValueStr Lib "uCalc32v400.dll" (ByVal Item As Integer, <MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef NewValue As String)
   Public Declare Function ucExprThread Lib "uCalc32v400.dll" (ByVal Expr As Integer) As Integer
   Public Declare Function ucLicense Lib "uCalc32v400.dll" (ByVal Product As Integer, Optional ByVal L1 As UInteger = 0, Optional ByVal L2 As UInteger = 0, Optional ByVal L3 As UInteger = 0, Optional ByVal L4 As UInteger = 0, Optional ByVal L5 As UInteger = 0) As Integer
   ' End Insert
   Public Declare Sub uCalcStr_ Lib "uCalc32v400.dll" Alias "uCalcStr" (<MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef ReturnStr As String, ByVal ucCommand As Integer, <MarshalAsAttribute(UnmanagedType.AnsiBStr)>Optional ByRef TextIn As String = "", Optional ByVal a As Integer = 0, Optional ByVal b As Integer = 0, Optional ByVal c As Integer = 0, Optional ByVal t As Integer = 0)
   Public Function uCalcStr(ByVal ucCommand As Integer, Optional ByRef TextIn As String = "", Optional ByVal a As Integer = 0, Optional ByVal b As Integer = 0, Optional ByVal c As Integer = 0, Optional ByVal t As Integer = 0) As String
      Dim ReturnStr As String = ""
      uCalcStr_(ReturnStr,  ucCommand ,   TextIn ,   a ,   b ,   c ,   t )
      If ReturnStr Is Nothing Then Return "" Else Return ReturnStr
   End Function
   Public Declare Function ucClose32bitDLL Lib "uCalc32v400.dll" (ByVal ReserverdArg As Integer) As Integer
   Public Declare Function ucDefine Lib "uCalc32v400.dll" (<MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef Definition As String, Optional ByVal Arg1 As Integer = 0, Optional ByVal Arg2 As Integer = 0, Optional ByVal Arg3 As Integer = 0, Optional ByVal t As Integer = 0) As Integer
   Public Declare Function ucDefineConstant Lib "uCalc32v400.dll" (<MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef Definition As String, Optional ByVal t As Integer = 0) As Integer
   Public Declare Function ucDefineFunction Lib "uCalc32v400.dll" (<MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef Definition As String, Optional ByVal FunctionAddress As ucFunctionDelegate = Nothing, Optional ByVal t As Integer = 0) As Integer
   Public Declare Function ucDefineOperator Lib "uCalc32v400.dll" (<MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef Definition As String, Optional ByVal FunctionAddress As ucFunctionDelegate = Nothing, Optional ByVal t As Integer = 0) As Integer
   Public Declare Function ucDefineSyntax Lib "uCalc32v400.dll" (<MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef Definition As String, Optional ByVal Rank As Integer = 0, Optional ByVal t As Integer = 0) As Integer
   Public Declare Function ucDefineVariable Lib "uCalc32v400.dll" (<MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef Definition As String, Optional ByVal VarAddress As Integer = 0, Optional ByVal t As Integer = 0) As Integer
   Public Declare Function ucEval Lib "uCalc32v400.dll" (<MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef Expr As String, Optional ByVal t As Integer = 0) As Double
   Public Declare Sub ucEvalStr_ Lib "uCalc32v400.dll" Alias "ucEvalStr" (<MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef ReturnStr As String, <MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef Expr As String, Optional ByVal ExprType As Integer = 0, Optional ByVal t As Integer = 0)
   Public Function ucEvalStr( ByRef Expr As String, Optional ByVal ExprType As Integer = 0, Optional ByVal t As Integer = 0) As String
      Dim ReturnStr As String = ""
      ucEvalStr_(ReturnStr,   Expr ,   ExprType ,   t )
      If ReturnStr Is Nothing Then Return "" Else Return ReturnStr
   End Function
   Public Declare Sub ucEvaluateStr_ Lib "uCalc32v400.dll" Alias "ucEvaluateStr" (<MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef ReturnStr As String, ByVal ucItem As Integer)
   Public Function ucEvaluateStr(ByVal ucItem As Integer) As String
      Dim ReturnStr As String = ""
      ucEvaluateStr_(ReturnStr,  ucItem )
      If ReturnStr Is Nothing Then Return "" Else Return ReturnStr
   End Function
   Public Declare Sub ucExpand_ Lib "uCalc32v400.dll" Alias "ucExpand" (<MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef ReturnStr As String, <MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef Expr As String, Optional ByVal t As Integer = 0)
   Public Function ucExpand( ByRef Expr As String, Optional ByVal t As Integer = 0) As String
      Dim ReturnStr As String = ""
      ucExpand_(ReturnStr,   Expr ,   t )
      If ReturnStr Is Nothing Then Return "" Else Return ReturnStr
   End Function
   Public Declare Function ucFPU Lib "uCalc32v400.dll" (ByVal FPU_Command As Integer, Optional ByVal FPU_Option As Integer = 0) As Integer
   Public Declare Function ucGetTrigMode Lib "uCalc32v400.dll" () As Integer
   Public Declare Function ucInitialize Lib "uCalc32v400.dll" (Optional ByVal NewThread As Integer = 0) As Integer
   Public Declare Function ucNewThread Lib "uCalc32v400.dll" (Optional ByVal ParentThread As Integer = 0, Optional ByVal MakeThisDefault As Integer = 0) As Integer
   Public Declare Function ucParse Lib "uCalc32v400.dll" (<MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef Expr As String, Optional ByVal ExprType As Integer = 0, Optional ByVal t As Integer = 0) As Integer
   Public Declare Function ucReleaseItem Lib "uCalc32v400.dll" (ByVal ucItem As Integer) As Integer
   Public Declare Sub ucRun_ Lib "uCalc32v400.dll" Alias "ucRun" (<MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef ReturnStr As String, <MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef RunOption As String, <MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef TextIn As String, Optional ByVal ExpandCount As Integer = 0, Optional ByVal t As Integer = 0)
   Public Function ucRun( ByRef RunOption As String,  ByRef TextIn As String, Optional ByVal ExpandCount As Integer = 0, Optional ByVal t As Integer = 0) As String
      Dim ReturnStr As String = ""
      ucRun_(ReturnStr,   RunOption ,   TextIn ,   ExpandCount ,   t )
      If ReturnStr Is Nothing Then Return "" Else Return ReturnStr
   End Function
   Public Declare Function ucSetOutput Lib "uCalc32v400.dll" (Optional ByVal FunctionAddress As ucFunctionDelegate = Nothing, <MarshalAsAttribute(UnmanagedType.AnsiBStr)>Optional ByRef FuncName As String = "", <MarshalAsAttribute(UnmanagedType.AnsiBStr)>Optional ByRef DataType As String = "", Optional ByVal t As Integer = 0) As Integer
   Public Declare Function ucSetTrigMode Lib "uCalc32v400.dll" (ByVal TrigMode As Integer) As Integer
   
   ' Error handling
   Public Declare Function ucAddErrorHandler Lib "uCalc32v400.dll" (Optional ByVal ErrorHandlerAddress As ucErrorHandlerDelegate = Nothing, Optional ByVal t As Integer = 0) As Integer
   Public Declare Function ucError Lib "uCalc32v400.dll" (Optional ByVal t As Integer = 0) As Integer
   Public Declare Sub ucErrorMessage_ Lib "uCalc32v400.dll" Alias "ucErrorMessage" (<MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef ReturnStr As String, Optional ByVal ErrorNumber As Integer = 0, Optional ByVal t As Integer = 0)
   Public Function ucErrorMessage(Optional ByVal ErrorNumber As Integer = 0, Optional ByVal t As Integer = 0) As String
      Dim ReturnStr As String = ""
      ucErrorMessage_(ReturnStr,   ErrorNumber ,   t )
      If ReturnStr Is Nothing Then Return "" Else Return ReturnStr
   End Function
   Public Declare Sub ucErrorExpression_ Lib "uCalc32v400.dll" Alias "ucErrorExpression" (<MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef ReturnStr As String, Optional ByVal t As Integer = 0)
   Public Function ucErrorExpression(Optional ByVal t As Integer = 0) As String
      Dim ReturnStr As String = ""
      ucErrorExpression_(ReturnStr,   t )
      If ReturnStr Is Nothing Then Return "" Else Return ReturnStr
   End Function
   Public Declare Function ucErrorLocation Lib "uCalc32v400.dll" (ByVal t As Integer) As Integer
   Public Declare Sub ucErrorSymbol_ Lib "uCalc32v400.dll" Alias "ucErrorSymbol" (<MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef ReturnStr As String, ByVal t As Integer)
   Public Function ucErrorSymbol(ByVal t As Integer) As String
      Dim ReturnStr As String = ""
      ucErrorSymbol_(ReturnStr,  t )
      If ReturnStr Is Nothing Then Return "" Else Return ReturnStr
   End Function
   Public Declare Function ucRaiseError Lib "uCalc32v400.dll" (ByVal Expr As Integer, ByVal ErrorNumber As Integer) As Integer
   Public Declare Function ucRaiseErrorMessage Lib "uCalc32v400.dll" (ByVal Expr As Integer, <MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef ErrorMessage As String) As Integer
   Public Declare Function ucSetError Lib "uCalc32v400.dll" (ByVal ErrorNumber As Integer, Optional ByVal t As Integer = 0) As Integer
   Public Declare Function ucSetErrorMessage Lib "uCalc32v400.dll" (ByVal ErrorIndex As Integer, <MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef ErrorMessage As String, Optional ByVal t As Integer = 0) As Integer
   Public Declare Function ucSetErrorNumber Lib "uCalc32v400.dll" (ByVal ErrorNumber As Integer, Optional ByVal t As Integer = 0) As Integer
   
   ' uCalc String Library
   Public Declare Function ucLoadStringLibInFMP Lib "uCalc32v400.dll" (Optional ByVal tHandle As Integer = 0) As Integer
   
   ' uCalc String Library Routine Exports
   Public Declare Function ucBetween Lib "uCalc32v400.dll" (ByVal a As Integer, ByVal b As Integer) As Integer
   Public Declare Function ucCompare Lib "uCalc32v400.dll" (<MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef String1 As String, <MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef String2 As String, Optional ByVal Options As Integer = 0) As Integer
   Public Declare Function ucCount Lib "uCalc32v400.dll" () As Integer
   Public Declare Function ucCountSkipped Lib "uCalc32v400.dll" () As Integer
   Public Declare Function ucDelim Lib "uCalc32v400.dll" (<MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef Delim As String, <MarshalAsAttribute(UnmanagedType.AnsiBStr)>Optional ByRef L As String = "", <MarshalAsAttribute(UnmanagedType.AnsiBStr)>Optional ByRef R As String = "") As Integer
   Public Declare Function ucEquals Lib "uCalc32v400.dll" (<MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef String1 As String, <MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef String2 As String, Optional ByVal Options As Integer = 0) As Integer
   Public Declare Function ucInStr Lib "uCalc32v400.dll" (ByVal Start As Integer, <MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef MainString As String, <MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef Pattern As String, Optional ByVal Options As Integer = 0) As Integer
   Public Declare Function ucLen Lib "uCalc32v400.dll" (<MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef MainString As String, Optional ByVal Options As Integer = 0) As Integer
   Public Declare Function ucLength Lib "uCalc32v400.dll" (Optional ByVal x As Integer = 0) As Integer
   Public Declare Function ucLimit Lib "uCalc32v400.dll" (ByVal Limit As Integer) As Integer
   Public Declare Function ucNth Lib "uCalc32v400.dll" (ByVal Number As Integer) As Integer
   Public Declare Function ucPos Lib "uCalc32v400.dll" (Optional ByVal x As Integer = 0) As Integer
   Public Declare Function ucSetStringDefaults Lib "uCalc32v400.dll" (ByVal Options As Integer) As Integer
   Public Declare Function ucSkip Lib "uCalc32v400.dll" (<MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef MainString As String) As Integer
   Public Declare Function ucSplit Lib "uCalc32v400.dll" (<MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef MainString As String, <MarshalAsAttribute(UnmanagedType.AnsiBStr)>Optional ByRef Delim As String = "", Optional ByVal Options As Integer = 0) As Integer
   Public Declare Function ucStart Lib "uCalc32v400.dll" (ByVal Position As Integer) As Integer
   Public Declare Function ucStartAfter Lib "uCalc32v400.dll" (ByVal Number As Integer) As Integer
   Public Declare Function ucStopAfter Lib "uCalc32v400.dll" (ByVal Number As Integer) As Integer
   Public Declare Function ucStringItemCount Lib "uCalc32v400.dll" () As Integer
   Public Declare Function ucTally Lib "uCalc32v400.dll" (<MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef MainString As String, <MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef Pattern As String, Optional ByVal Options As Integer = 0) As Integer
   Public Declare Sub ucExtract_ Lib "uCalc32v400.dll" Alias "ucExtract" (<MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef ReturnStr As String, <MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef MainString As String, <MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef Pattern As String, Optional ByVal Options As Integer = 0)
   Public Function ucExtract( ByRef MainString As String,  ByRef Pattern As String, Optional ByVal Options As Integer = 0) As String
      Dim ReturnStr As String = ""
      ucExtract_(ReturnStr,   MainString ,   Pattern ,   Options )
      If ReturnStr Is Nothing Then Return "" Else Return ReturnStr
   End Function
   Public Declare Sub ucFile_ Lib "uCalc32v400.dll" Alias "ucFile" (<MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef ReturnStr As String, <MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef NameOfFile As String)
   Public Function ucFile( ByRef NameOfFile As String) As String
      Dim ReturnStr As String = ""
      ucFile_(ReturnStr,   NameOfFile )
      If ReturnStr Is Nothing Then Return "" Else Return ReturnStr
   End Function
   Public Declare Sub ucLCase_ Lib "uCalc32v400.dll" Alias "ucLCase" (<MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef ReturnStr As String, <MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef MainString As String, <MarshalAsAttribute(UnmanagedType.AnsiBStr)>Optional ByRef Pattern As String = "", Optional ByVal Options As Integer = 0)
   Public Function ucLCase( ByRef MainString As String, Optional ByRef Pattern As String = "", Optional ByVal Options As Integer = 0) As String
      Dim ReturnStr As String = ""
      ucLCase_(ReturnStr,   MainString ,   Pattern ,   Options )
      If ReturnStr Is Nothing Then Return "" Else Return ReturnStr
   End Function
   Public Declare Sub ucLeft_ Lib "uCalc32v400.dll" Alias "ucLeft" (<MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef ReturnStr As String, <MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef MainString As String, ByVal Number As Integer, Optional ByVal Options As Integer = 0)
   Public Function ucLeft( ByRef MainString As String, ByVal Number As Integer, Optional ByVal Options As Integer = 0) As String
      Dim ReturnStr As String = ""
      ucLeft_(ReturnStr,   MainString ,  Number ,   Options )
      If ReturnStr Is Nothing Then Return "" Else Return ReturnStr
   End Function
   Public Declare Sub ucMCase_ Lib "uCalc32v400.dll" Alias "ucMCase" (<MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef ReturnStr As String, <MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef MainString As String, <MarshalAsAttribute(UnmanagedType.AnsiBStr)>Optional ByRef Pattern As String = "", Optional ByVal Options As Integer = 0)
   Public Function ucMCase( ByRef MainString As String, Optional ByRef Pattern As String = "", Optional ByVal Options As Integer = 0) As String
      Dim ReturnStr As String = ""
      ucMCase_(ReturnStr,   MainString ,   Pattern ,   Options )
      If ReturnStr Is Nothing Then Return "" Else Return ReturnStr
   End Function
   Public Declare Sub ucMid_ Lib "uCalc32v400.dll" Alias "ucMid" (<MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef ReturnStr As String, <MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef MainString As String, ByVal Start As Integer, Optional ByVal Length As Integer = 0, Optional ByVal Options As Integer = 0)
   Public Function ucMid( ByRef MainString As String, ByVal Start As Integer, Optional ByVal Length As Integer = 0, Optional ByVal Options As Integer = 0) As String
      Dim ReturnStr As String = ""
      ucMid_(ReturnStr,   MainString ,  Start ,   Length ,   Options )
      If ReturnStr Is Nothing Then Return "" Else Return ReturnStr
   End Function
   Public Declare Sub ucRange_ Lib "uCalc32v400.dll" Alias "ucRange" (<MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef ReturnStr As String, ByVal Start As Integer, ByVal Finish As Integer, <MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef Expression As String, Optional ByVal Options As Integer = 0)
   Public Function ucRange(ByVal Start As Integer, ByVal Finish As Integer,  ByRef Expression As String, Optional ByVal Options As Integer = 0) As String
      Dim ReturnStr As String = ""
      ucRange_(ReturnStr,  Start ,  Finish ,   Expression ,   Options )
      If ReturnStr Is Nothing Then Return "" Else Return ReturnStr
   End Function
   Public Declare Sub ucRemain_ Lib "uCalc32v400.dll" Alias "ucRemain" (<MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef ReturnStr As String, <MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef MainString As String, <MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef Pattern As String, Optional ByVal Options As Integer = 0)
   Public Function ucRemain( ByRef MainString As String,  ByRef Pattern As String, Optional ByVal Options As Integer = 0) As String
      Dim ReturnStr As String = ""
      ucRemain_(ReturnStr,   MainString ,   Pattern ,   Options )
      If ReturnStr Is Nothing Then Return "" Else Return ReturnStr
   End Function
   Public Declare Sub ucRemove_ Lib "uCalc32v400.dll" Alias "ucRemove" (<MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef ReturnStr As String, <MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef MainString As String, <MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef Pattern As String, Optional ByVal Options As Integer = 0)
   Public Function ucRemove( ByRef MainString As String,  ByRef Pattern As String, Optional ByVal Options As Integer = 0) As String
      Dim ReturnStr As String = ""
      ucRemove_(ReturnStr,   MainString ,   Pattern ,   Options )
      If ReturnStr Is Nothing Then Return "" Else Return ReturnStr
   End Function
   Public Declare Sub ucReplace_ Lib "uCalc32v400.dll" Alias "ucReplace" (<MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef ReturnStr As String, <MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef MainString As String, <MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef Pattern As String, <MarshalAsAttribute(UnmanagedType.AnsiBStr)>Optional ByRef Replacement As String = "", Optional ByVal Options As Integer = 0)
   Public Function ucReplace( ByRef MainString As String,  ByRef Pattern As String, Optional ByRef Replacement As String = "", Optional ByVal Options As Integer = 0) As String
      Dim ReturnStr As String = ""
      ucReplace_(ReturnStr,   MainString ,   Pattern ,   Replacement ,   Options )
      If ReturnStr Is Nothing Then Return "" Else Return ReturnStr
   End Function
   Public Declare Sub ucRetain_ Lib "uCalc32v400.dll" Alias "ucRetain" (<MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef ReturnStr As String, <MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef MainString As String, <MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef Pattern As String, <MarshalAsAttribute(UnmanagedType.AnsiBStr)>Optional ByRef Filter As String = "", Optional ByVal Options As Integer = 0)
   Public Function ucRetain( ByRef MainString As String,  ByRef Pattern As String, Optional ByRef Filter As String = "", Optional ByVal Options As Integer = 0) As String
      Dim ReturnStr As String = ""
      ucRetain_(ReturnStr,   MainString ,   Pattern ,   Filter ,   Options )
      If ReturnStr Is Nothing Then Return "" Else Return ReturnStr
   End Function
   Public Declare Sub ucRight_ Lib "uCalc32v400.dll" Alias "ucRight" (<MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef ReturnStr As String, <MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef MainString As String, ByVal Number As Integer, Optional ByVal Options As Integer = 0)
   Public Function ucRight( ByRef MainString As String, ByVal Number As Integer, Optional ByVal Options As Integer = 0) As String
      Dim ReturnStr As String = ""
      ucRight_(ReturnStr,   MainString ,  Number ,   Options )
      If ReturnStr Is Nothing Then Return "" Else Return ReturnStr
   End Function
   Public Declare Sub ucStringItem_ Lib "uCalc32v400.dll" Alias "ucStringItem" (<MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef ReturnStr As String, ByVal Index As Integer)
   Public Function ucStringItem(ByVal Index As Integer) As String
      Dim ReturnStr As String = ""
      ucStringItem_(ReturnStr,  Index )
      If ReturnStr Is Nothing Then Return "" Else Return ReturnStr
   End Function
   Public Declare Sub ucUCase_ Lib "uCalc32v400.dll" Alias "ucUCase" (<MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef ReturnStr As String, <MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef MainString As String, <MarshalAsAttribute(UnmanagedType.AnsiBStr)>Optional ByRef Pattern As String = "", Optional ByVal Options As Integer = 0)
   Public Function ucUCase( ByRef MainString As String, Optional ByRef Pattern As String = "", Optional ByVal Options As Integer = 0) As String
      Dim ReturnStr As String = ""
      ucUCase_(ReturnStr,   MainString ,   Pattern ,   Options )
      If ReturnStr Is Nothing Then Return "" Else Return ReturnStr
   End Function
   Public Declare Function uCalcRaw Lib "uCalc32v400.dll" (<MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef ReturnStr_ As String, ByVal uc As Integer, <MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef TextIn As String, ByVal Misc1 As Integer, ByVal Misc2 As Integer, ByVal ReturnPtr As Integer, ByVal tHandle As Integer) As Integer
   
   ' Deprecated notations
   ' Note: The following alternative notations are preserved for backwards compatibility and may not be supported in the future.
   Public Declare Function ucParam Lib "uCalc32v400.dll" Alias "ucArg" (ByVal ExprHandle As Integer, ByVal Index As Integer) As Double
   Public Declare Sub ucParamStr_ Lib "uCalc32v400.dll" Alias "ucArgStr" (<MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef ReturnStr As String, ByVal ExprHandle As Integer, ByVal Index As Integer)
   Public Function ucParamStr(ByVal ExprHandle As Integer, ByVal Index As Integer) As String
      Dim ReturnStr As String = ""
      ucParamStr_(ReturnStr,  ExprHandle ,  Index )
      If ReturnStr Is Nothing Then Return "" Else Return ReturnStr
   End Function
   Public Declare Function ucParamCount Lib "uCalc32v400.dll" Alias "ucArgCount" (ByVal ExprHandle As Integer) As Integer
   Public Declare Function ucParamHandle Lib "uCalc32v400.dll" Alias "ucArgHandle" (ByVal ExprHandle As Integer, ByVal Index As Integer) As Integer
   Public Declare Function ucErrLocation Lib "uCalc32v400.dll" Alias "ucErrorLocation" (ByVal t As Integer) As Integer
   Public Declare Sub ucErrSymbol_ Lib "uCalc32v400.dll" Alias "ucErrorSymbol" (<MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef ReturnStr As String, ByVal t As Integer)
   Public Function ucErrSymbol(ByVal t As Integer) As String
      Dim ReturnStr As String = ""
      ucErrSymbol_(ReturnStr,  t )
      If ReturnStr Is Nothing Then Return "" Else Return ReturnStr
   End Function
   Public Declare Function ucSetErrMsg Lib "uCalc32v400.dll" Alias "ucSetErrorMessage" (ByVal Index As Integer, <MarshalAsAttribute(UnmanagedType.AnsiBStr)> ByRef Msg As String) As Integer
   
End Module
   