<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Access Basic COMMON,MAP, and VAR from a C program in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/access-basic-common-map-and-var-from-a-c-program/m-p/5117113#M44221</link>
    <description>Oh, be sure to google for things like:&lt;BR /&gt;"pragma extern_model common_block shr"&lt;BR /&gt;&lt;BR /&gt;This finds intersting example usages as well as reference to the HP C manuals:&lt;BR /&gt;&lt;BR /&gt;For example:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.pottsoft.com/home/c_course/course.html" target="_blank"&gt;http://www.pottsoft.com/home/c_course/course.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
    <pubDate>Wed, 02 Jul 2008 11:34:42 GMT</pubDate>
    <dc:creator>Hein van den Heuvel</dc:creator>
    <dc:date>2008-07-02T11:34:42Z</dc:date>
    <item>
      <title>Access Basic COMMON,MAP, and VAR from a C program</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/access-basic-common-map-and-var-from-a-c-program/m-p/5117111#M44219</link>
      <description>&lt;!--!*#--&gt;Hi...&lt;BR /&gt;&lt;BR /&gt;I want to from my C functions access data from the BASIC main program.&lt;BR /&gt;&lt;BR /&gt;I link the programs together and the main program has a MAP.&lt;BR /&gt;&lt;BR /&gt;Example&lt;BR /&gt;&lt;BR /&gt;MAP (TEST_MAP) STRING TEST_STR = 20&lt;BR /&gt;&lt;BR /&gt;How can i access it from my C function.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 02 Jul 2008 06:01:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/access-basic-common-map-and-var-from-a-c-program/m-p/5117111#M44219</guid>
      <dc:creator>Roger Strandberg SEB</dc:creator>
      <dc:date>2008-07-02T06:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: Access Basic COMMON,MAP, and VAR from a C program</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/access-basic-common-map-and-var-from-a-c-program/m-p/5117112#M44220</link>
      <description>The key to solving this is in  the&lt;BR /&gt;&lt;BR /&gt;"HP C Userâ  s Guide for OpenVMS Systems"&lt;BR /&gt;4.8.2 Program Sections Created by HP C&lt;BR /&gt;&lt;BR /&gt;You start by creating the BASIC program, compile with /LIST and look for the PSECT supporting the MAP there. You can also do a test link/MAP, ingnoring missing references and looking at map for the psect&lt;BR /&gt;&lt;BR /&gt;6   TEST_MAP                            32    NOPIC OVR REL GBL NOSHR NOEXE   RD   WRT OCTA&lt;BR /&gt;&lt;BR /&gt;Now pick the corresponding Storage-Class Code from "Table 4â  7 Combination Attributes"&lt;BR /&gt;&lt;BR /&gt;And go back up to finds ways to declare those.&lt;BR /&gt;&lt;BR /&gt;For example:&lt;BR /&gt;&lt;BR /&gt;$ typ tmp.bas&lt;BR /&gt;COMMON (TEST_MAP) STRING TEST_STR = 20&lt;BR /&gt;TEST_STR = "Hello world"&lt;BR /&gt;CALL test_C&lt;BR /&gt;end&lt;BR /&gt;&lt;BR /&gt;$ type test_c.c&lt;BR /&gt;#include stdio&lt;BR /&gt;#pragma extern_model common_block shr&lt;BR /&gt;extern struct {&lt;BR /&gt;   char test[20];&lt;BR /&gt;   char zero;&lt;BR /&gt; } TEST_MAP;&lt;BR /&gt;test_c() {&lt;BR /&gt;  TEST_MAP.zero = 0;&lt;BR /&gt;  printf ("-%s-\n", TEST_MAP.test);&lt;BR /&gt;  return;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;$ run tmp&lt;BR /&gt;-Hello world         -&lt;BR /&gt;&lt;BR /&gt;Note 1) You figure the details: This example still generates:&lt;BR /&gt;%LINK-W-MULPSC, conflicting attributes for psect TEST_MAP&lt;BR /&gt;&lt;BR /&gt;Note 2) you can coerce PSECT attributes with LINK options.&lt;BR /&gt;&lt;BR /&gt;Note 3) The 'zero' byte is for my example convenience. You need to know amd take into account that BASIC strings are NOT zero terminated.&lt;BR /&gt;&lt;BR /&gt;Enjoy!&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Wed, 02 Jul 2008 11:32:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/access-basic-common-map-and-var-from-a-c-program/m-p/5117112#M44220</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2008-07-02T11:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: Access Basic COMMON,MAP, and VAR from a C program</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/access-basic-common-map-and-var-from-a-c-program/m-p/5117113#M44221</link>
      <description>Oh, be sure to google for things like:&lt;BR /&gt;"pragma extern_model common_block shr"&lt;BR /&gt;&lt;BR /&gt;This finds intersting example usages as well as reference to the HP C manuals:&lt;BR /&gt;&lt;BR /&gt;For example:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.pottsoft.com/home/c_course/course.html" target="_blank"&gt;http://www.pottsoft.com/home/c_course/course.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Wed, 02 Jul 2008 11:34:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/access-basic-common-map-and-var-from-a-c-program/m-p/5117113#M44221</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2008-07-02T11:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: Access Basic COMMON,MAP, and VAR from a C program</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/access-basic-common-map-and-var-from-a-c-program/m-p/5117114#M44222</link>
      <description>Thx Hein!</description>
      <pubDate>Wed, 02 Jul 2008 12:14:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/access-basic-common-map-and-var-from-a-c-program/m-p/5117114#M44222</guid>
      <dc:creator>Roger Strandberg SEB</dc:creator>
      <dc:date>2008-07-02T12:14:51Z</dc:date>
    </item>
    <item>
      <title>Re: Access Basic COMMON,MAP, and VAR from a C program</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/access-basic-common-map-and-var-from-a-c-program/m-p/5117115#M44223</link>
      <description>Closing the thread due to good answer</description>
      <pubDate>Wed, 02 Jul 2008 12:16:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/access-basic-common-map-and-var-from-a-c-program/m-p/5117115#M44223</guid>
      <dc:creator>Roger Strandberg SEB</dc:creator>
      <dc:date>2008-07-02T12:16:52Z</dc:date>
    </item>
  </channel>
</rss>

