Home AMX User Forum NetLinx Studio

Define_function & Arrays

Hello...

Anyway...does know how to return an array from a function and if it is possible?

For example....

DEFINE_FUNCTION CHAR TEST(ARRAY[])
{
LOCAL_VAR CHAR FINAL_ARRAY[20]

// do something with array

RETURN(FINAL_ARRAY)
}

Or can we get pointers like C++ to work in Netlinx??


Here is what I am getting from Netlinx log

1: 07-01-2004 THU 03:45:03 Interpreter CopyString (Reference) - Error 1 S=0x0000 D=0x1011
2: 07-01-2004 THU 03:45:03 Interpreter GetString - Error 1 Tk=0x0001
3: 07-01-2004 THU 03:45:03 Interpreter CopyString (Reference) - Error 2 S=0x1011 D=0x1001
4: 07-01-2004 THU 03:45:02 Interpreter CopyString (Reference) - Error 1 S=0x0000 D=0x1011


Anyway...does know what S=0x0000 D=0x1011 Tk=0x0001
is referring to?

Thanks... Bogdan


;)

Comments

  • Re: Define_function & Arrays

    You can send back arrays out of a function in this way:

    DEFINE_FUNCTION CHAR[20] TEST(ARRAY[])
    {
    LOCAL_VAR CHAR FINAL_ARRAY[20]

    // do something with array

    RETURN(FINAL_ARRAY)
    }

    Best regards,
    Marc
    Originally posted by bogdan
    Hello...

    Anyway...does know how to return an array from a function and if it is possible?

    For example....

    DEFINE_FUNCTION CHAR TEST(ARRAY[])
    {
    LOCAL_VAR CHAR FINAL_ARRAY[20]

    // do something with array

    RETURN(FINAL_ARRAY)
    }

    Or can we get pointers like C++ to work in Netlinx??


    Here is what I am getting from Netlinx log

    1: 07-01-2004 THU 03:45:03 Interpreter CopyString (Reference) - Error 1 S=0x0000 D=0x1011
    2: 07-01-2004 THU 03:45:03 Interpreter GetString - Error 1 Tk=0x0001
    3: 07-01-2004 THU 03:45:03 Interpreter CopyString (Reference) - Error 2 S=0x1011 D=0x1001
    4: 07-01-2004 THU 03:45:02 Interpreter CopyString (Reference) - Error 1 S=0x0000 D=0x1011


    Anyway...does know what S=0x0000 D=0x1011 Tk=0x0001
    is referring to?

    Thanks... Bogdan


    ;)
  • bogdanbogdan Posts: 42
    Thanks... Marc Scheibein

    It is working like a clock.
Sign In or Register to comment.