× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



>       I'm trying to call C functions for the first time. I get "name or
> indicator is not defined" compile errors with I use the following code:
>
>       /free
>         num = atoi(field);
>       //end-free

Did you define a prototype for atoi?  If not, that's the reason that
you're getting the "name or indicator not defined" error.

In addition to that, you need to bind to the QC2LE binding directory --
though forgetting this will generate a different error.

The following code works on my machine:

     H DFTACTGRP(*NO) BNDDIR('QC2LE')

      * The proc name in the "extproc" statement below
      * MUST be in all-lowercase.
     D atoi            PR            10I 0 extproc('atoi')
     D  alpha                          *   value options(*string)

     D num             s              7P 0
     D field           s            100A

      /free

            field = '12345 is a number';
            num = atoi(field);

            dsply ' ' ' ' num;
            *inlr = *on;

      /end-free


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.