FCBCall function with an ExternalAddress as argument returns an error

37 views
Skip to first unread message

Pierre-Alexandre Ibba

unread,
Jan 26, 2022, 3:36:54 PM1/26/22
to CLIPSESG
Hello everyone, 

I would like to create a function call builder with an ExternalAddress argument.
The FCBCall function generate 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


CLIPS Support

unread,
Jan 26, 2022, 5:29:18 PM1/26/22
to CLIPSESG
Checked in a bug fix to the SourceForge SVN repository: https://sourceforge.net/p/clipsrules/code/HEAD/tree/branches/64x/core/cstrnutl.c
Reply all
Reply to author
Forward
0 new messages