Menu

FCBCall function with an ExternalAddress as argument returns an error

Help
Pierre
2022-01-26
2022-01-26
  • Pierre

    Pierre - 2022-01-26

    Hi,

    I would like to create a function call builder with an ExternalAddress argument.

    The FCBCall function generates this message:
    [ARGACCES2] Function 'myFunction' expected argument #1 to be of type external address.

    It's working with other arguments.

    Am I doing something wrong ?

    #include "include/clips.h"
    #include <stdio.h>
    
    static void myFunction(Environment *env, UDFContext *udfc, UDFValue *out)
    {
            printf("test");
    }
    
    int main()
    {
            Environment* env = CreateEnvironment();
            FunctionCallBuilder* fcb = CreateFunctionCallBuilder(env, 1);
    
            AddUDF(env, "myFunction", "", 1, 1, "e", myFunction, "myFunction", NULL);
    
            CLIPSExternalAddress* externalArgument = CreateCExternalAddress(env, NULL);
            FCBAppendCLIPSExternalAddress(fcb, externalArgument);
    
            FCBCall(fcb, "myFunction", NULL);
    
            FCBDispose(fcb);
            DestroyEnvironment(env);
    
            return 0;
     }
    

    Thanks you in advance for helping

     

Log in to post a comment.