-
FlexPro
- Auf einen Blick
- Features & Optionen
- Einsatzgebiete
- Alle Vorteile
- Neu in FlexPro 2021
- FlexPro gratis testen
- FlexPro View OEM Freeware
- Kaufberatung
- Login
- Language
-
-
-
- +49 6894 929600
- infoweisang.com
- Google Maps
- Produkte
- News
- Support
- Unternehmen
- Jobs
- Kontakt
- Login
- Language
-
-
-
- +49 6894 929600
- infoweisang.com
- Google Maps
Using multiple custom functions
Home > Community > Automation and VBA > Using multiple custom functions
- Dieses Thema hat 2 Antworten sowie 2 Teilnehmer und wurde zuletzt vor vor 9 Jahren, 3 Monaten von
Peter Seitz aktualisiert.
-
AutorBeiträge
-
Februar 4, 2016 um 8:18 am Uhr #12901
Peter Seitz
MitgliedHello,
I’m using a custom function for an analysis like in your example “CustomFunction.FPD”.
Now I’d like to implement a second custom function, so I was going to expand my code like the following example:
In Module -> AutoFunctions
' register the function With CustomFPScriptFunctions.Add("MyCustomFunction1") .Description = "Output Matrix" .Indeterministic = False With .Parameters.Add("Arg1") .Description = "First argument" .AllowedTypes = fpParameterTypeNumeric End With Set oMyFunction = New MyFunctionImplementationObject1 .Register oMyFunction End With ' register the function With CustomFPScriptFunctions.Add("MyCustomFunction2") .Description = "Output Matrix" .Indeterministic = False With .Parameters.Add("Arg1") .Description = "First argument" .AllowedTypes = fpParameterTypeNumeric End With Set oMyFunction = New MyFunctionImplementationObject2 .Register oMyFunction End With
And in my classmodule -> MyFunctionImplementationObject1
Option Explicit Implements ICustomFPScriptFunctionCalculate1 Private Function ICustomFPScriptFunctionCalculate_Calculate1(SafeArrayOfArguments() As Variant) ICustomFPScriptFunctionCalculate_Calculate = SafeArrayOfArguments() End Function
And in my classmodule -> MyFunctionImplementationObject2
Option Explicit Implements ICustomFPScriptFunctionCalculate2 Private Function ICustomFPScriptFunctionCalculate_Calculate2(SafeArrayOfArguments() As Variant) ICustomFPScriptFunctionCalculate_Calculate = SafeArrayOfArguments() End Function
But as soon as I add another function in my AutoFunctions neither of the two added functions is working. I get the error message “The referred function does not exist”
Can you tell me what I’m doing wrong ?
Februar 4, 2016 um 8:18 am Uhr #8561Peter Seitz
MitgliedHello,
I’m using a custom function for an analysis like in your example “CustomFunction.FPD”.
Now I’d like to implement a second custom function, so I was going to expand my code like the following example:
In Module -> AutoFunctions
' register the function With CustomFPScriptFunctions.Add("MyCustomFunction1") .Description = "Output Matrix" .Indeterministic = False With .Parameters.Add("Arg1") .Description = "First argument" .AllowedTypes = fpParameterTypeNumeric End With Set oMyFunction = New MyFunctionImplementationObject1 .Register oMyFunction End With ' register the function With CustomFPScriptFunctions.Add("MyCustomFunction2") .Description = "Output Matrix" .Indeterministic = False With .Parameters.Add("Arg1") .Description = "First argument" .AllowedTypes = fpParameterTypeNumeric End With Set oMyFunction = New MyFunctionImplementationObject2 .Register oMyFunction End With
And in my classmodule -> MyFunctionImplementationObject1
Option Explicit Implements ICustomFPScriptFunctionCalculate1 Private Function ICustomFPScriptFunctionCalculate_Calculate1(SafeArrayOfArguments() As Variant) ICustomFPScriptFunctionCalculate_Calculate = SafeArrayOfArguments() End Function
And in my classmodule -> MyFunctionImplementationObject2
Option Explicit Implements ICustomFPScriptFunctionCalculate2 Private Function ICustomFPScriptFunctionCalculate_Calculate2(SafeArrayOfArguments() As Variant) ICustomFPScriptFunctionCalculate_Calculate = SafeArrayOfArguments() End Function
But as soon as I add another function in my AutoFunctions neither of the two added functions is working. I get the error message “The referred function does not exist”
Can you tell me what I’m doing wrong ?
Februar 5, 2016 um 9:38 am Uhr #9424Bernhard Kantz
TeilnehmerIf you remove the numbers after Calculate in the Implements directive and the function definition, your code should work.
Option Explicit Implements ICustomFPScriptFunctionCalculate Private Function ICustomFPScriptFunctionCalculate_Calculate(SafeArrayOfArguments() As Variant) ICustomFPScriptFunctionCalculate_Calculate = SafeArrayOfArguments() End Function
-
AutorBeiträge
- Du musst angemeldet sein, um auf dieses Thema antworten zu können.
Sie sehen gerade einen Platzhalterinhalt von Facebook. Um auf den eigentlichen Inhalt zuzugreifen, klicken Sie auf die Schaltfläche unten. Bitte beachten Sie, dass dabei Daten an Drittanbieter weitergegeben werden.
Mehr InformationenSie müssen den Inhalt von reCAPTCHA laden, um das Formular abzuschicken. Bitte beachten Sie, dass dabei Daten mit Drittanbietern ausgetauscht werden.
Mehr InformationenSie sehen gerade einen Platzhalterinhalt von Instagram. Um auf den eigentlichen Inhalt zuzugreifen, klicken Sie auf die Schaltfläche unten. Bitte beachten Sie, dass dabei Daten an Drittanbieter weitergegeben werden.
Mehr InformationenSie sehen gerade einen Platzhalterinhalt von X. Um auf den eigentlichen Inhalt zuzugreifen, klicken Sie auf die Schaltfläche unten. Bitte beachten Sie, dass dabei Daten an Drittanbieter weitergegeben werden.
Mehr Informationen