Re: DYNAMIC ARRAY

Mike Aubury <[email protected]> Thu, 8 Jul 2021 08:58:43 +0100
Newsgroups gmane.comp.lang.4gl.aubit.general
Message-ID <CAGAq4WFQWLdHa0Va1xTh7Zxf=Xs-x+DEvXsaLBG_X4zJ4Y+MvQ@mail.gmail.com>
You shouldnt "really" be passing arrays around at all.
Just put all the code using it into a single module and use a module level
variable for it to keep it all contained..

<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Virus-free.
www.avg.com
<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Thu, 8 Jul 2021 at 07:46, Iwan AB <[email protected]> wrote:

> Hi,
>
> I found quite interesting that in Aubit4GL, dynamic array can be used with
> INPUT ARRAY or DISPLAY ARRAY statements -- excellent!!, contrary to
> Informix-4GL (I used I-4GL 7.32), as stated in reference manual that
> dynamic array cannot be used with INPUT ARRAY or DISPLAY ARRAY statements.
> But, in Informix-4GL, dynamic array can be passed to or returned from
> functions. I tested in Aubit4GL, it's said that passing dynamic array to a
> function is not implented yet.
>
> Assertion failed: passing dynamic arrays is not implemented yet
> (File:dynmem.c Line:178)
> Err:Program pa.4ge stopped at 'pa.4gl', line number 5.
> Error status number -30289.
> Assertion failed.
>
> I try using COPYOF
>
> MAIN
>    DEFINE a DYNAMIC ARRAY OF CHAR(1)
>    ALLOCATE ARRAY a[1]
>    LET a[1] = "A"
>    #CALL p1(a)
>    CALL p2(COPYOF(a))
> END MAIN
>
> {
> FUNCTION p1(b)
>    DEFINE  b DYNAMIC ARRAY OF CHAR(1)
>    DISPLAY b[1]
> END FUNCTION
> }
>
> FUNCTION p2(COPYOF b)
>    DEFINE  b DYNAMIC ARRAY OF CHAR(1)
>    DISPLAY b[1]
> END FUNCTION
>
> it came up with the following errot at runtime
>
> 4gl function call stack :
>     MAIN
>
> Err:Program pa.4ge stopped at 'pa.4gl', line number 16.
> Error status number -30284.
> Invalid conversion.
>
> 4gl function call stack :
>     pa.4gl (Line 6) calls  p2(b=Not printable)
>     MAIN
>
> Regards,
>
> Iwan
>
>
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> Virus-free.
> www.avast.com
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
> <#m_-1151946136569213359_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
> _______________________________________________
> Aubit4gl-discuss mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss
>

_______________________________________________
Aubit4gl-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/aubit4gl-discuss