× 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.



Hi Spencer,

On 4/26/2019 3:54 PM, Spencer Elliott wrote:
I have examined the input (argv[n]) field in my program and it appears that 2 integers preceded the data.
[SNIP]
PARM KWD(MONPATH) TYPE(*CHAR) LEN(128) MIN(1) ALWUNPRT(*NO) +
ALWVAR(*YES) VARY(*YES *INT4)


I did not have the problem you describe...  I only had one integer, the one that contains the parameter length.  Here's the ILE C program I used to test:


#include <stdio.h>
#include <string.h>

int main(int argc, char **argv) {

   typedef struct varchar128_t {
      int len;
      char value[128];
   } varchar128;

   char buf[129];

   varchar128 *monpath = (varchar128 *)argv[1];
   printf("monpath->len = %d\n", monpath->len);

   memset(buf, '\0', sizeof(buf));
   memcpy(buf, monpath->value, monpath->len);
   printf("monpath->value = %s\n", buf);

   return 0;
}


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.