• Subject: Re: Terminating a C proram
  • From: "Pantzopoulos, Mike" <mikepantzopoulos@xxxxxxxx>
  • Date: Wed, 9 Aug 2000 00:19:41 -0400

Title: Re: Terminating a C proram

Thanks to all who helped with a response to the above subject. My summary of the answers and further research so far is:

  1. EPM does not exist and  is of no concern to the current C compiler and run-time.. This means that the Jennifer Hamilton book is well out of date? I couldn't find any mention of Activation Groups in the index, and the first (and only!) publishing date was October 1992!!. For $200 Australian I would expect that the publishers keep the book up to date. I feel a little skinned

  3. All I am trying to achieve is a consistency with RPG- to retain the C program and its lower level RPG invocations in memory until the business function has ended, in which case I will pass through a request code that results in the lower level programs setting on *INLR and then results in the C program ending as well.

  4. I looked up the ILE C Programmers Guide(appendixH) where it states.....keeping an activation group active after the program has exited means that all the storage associated with that program is still allocated and in a 'last-used' state. When the program is called again, initialization, as defined by the language, is not done. All variables have the last value assigned to them in the previous run of he program. In addition all of the settings in the ILE C run-time are in 'last-used' state such as signal(),strtok() etc......." .(reference H1.1).

  5. ..............no mention of the static attribute............

    In the same section they provide some example code and so I  created two C programs (copied from H1-1 in the users guide), one called TESTRTRN (with a return;) and the other TESTEXIT(with the return replaced by an exit() with test harnesses as follows:

    #include <stdio.h>                                                     
            int invocation_count=0;                                            
            int main(void)                                                     
            invocation_count++; /* increment counter */                        
            printf("Exit called: ");  ..........for the TESTRTRN program......printf("Return called: ");                                         

            printf("%d\n", invocation_count);                                  
            getchar(); /*  this holds the screen open */                       
    exit();..........for the TESTRTRN program........... return;                                                           


This thread ...

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

This mailing list archive is Copyright 1997-2019 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].