• OBNC interface with C code return array of char

    From giahung1997tn@gmail.com@21:1/5 to All on Fri Mar 27 05:00:54 2020
    I want to interface with C code whose return a C string which is an array of char. I found it to be impossible.

    So I tried to declare a new type as array of char but it is impossible, too.

    To last resort I tried to declare a new type as pointer to char, then it is impossible too as the compiler will not allow pointer to non record type.

    I stuck at this stage because if I can't write the declaration module in Oberon how could I go further to do the actual implementation in C source file?

    Oberon is viewed as a compact and beautiful language but if it's too limited like that it's too useless for any practical purpose other than an academic research project.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From August Karlstrom@21:1/5 to giahung1997tn@gmail.com on Fri Mar 27 22:32:33 2020
    On 2020-03-27 13:00, giahung1997tn@gmail.com wrote:
    I want to interface with C code whose return a C string which is an
    array of char. I found it to be impossible. >
    So I tried to declare a new type as array of char but it is impossible, too.

    To last resort I tried to declare a new type as pointer to char, then
    it is impossible too as the compiler will not allow pointer to non
    record type.

    I stuck at this stage because if I can't write the declaration module
    in Oberon how could I go further to do the actual implementation in C
    source file?

    In Oberon, strings are returned as output parameters; i.e. variable
    parameters of type ARRAY OF CHAR. Therefor you need to adjust the
    signature of the procedure accordingly.

    Oberon is viewed as a compact and beautiful language but if it's too
    limited like that it's too useless for any practical purpose other
    than an academic research project.

    Why do you use it then?


    -- August

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From cfbsoftware@gmail.com@21:1/5 to giahun...@gmail.com on Fri Mar 27 17:11:02 2020
    On Friday, March 27, 2020 at 10:30:55 PM UTC+10:30, giahun...@gmail.com wrote:


    Oberon is viewed as a compact and beautiful language but if it's too limited like that it's too useless for any practical purpose other than an academic research project.

    We have a number of customers who would disagree with you. e.g.

    "Oberon in Atlantic City"

    https://www.astrobe.com/forum/viewtopic.php?f=3&t=505

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From giahung1997tn@gmail.com@21:1/5 to All on Sun Mar 29 22:34:35 2020
    Vào 04:32:35 UTC+7 Thứ Bảy, ngày 28 tháng 3 năm 2020, August Karlstrom đã viết:

    Why do you use it then?


    -- August

    I'm experiment with it but not seriously put on my faith on it. So after a while I have a conclusion that it is not for me. OK?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From giahung1997tn@gmail.com@21:1/5 to All on Sun Mar 29 22:32:57 2020
    Vào 07:11:03 UTC+7 Thứ Bảy, ngày 28 tháng 3 năm 2020, cfbso...@gmail.com đã viết:
    On Friday, March 27, 2020 at 10:30:55 PM UTC+10:30, giahun...@gmail.com wrote:


    Oberon is viewed as a compact and beautiful language but if it's too limited like that it's too useless for any practical purpose other than an academic research project.

    We have a number of customers who would disagree with you. e.g.

    "Oberon in Atlantic City"

    https://www.astrobe.com/forum/viewtopic.php?f=3&t=505

    This is embedded software. I want to use Oberon (OBNC) to develop software for the normal PC. Intefacing with C library is a must. But it too difficult. That's why I said Oberon is useless for my job.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)