- Community Home
- >
- Servers and Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: Access Basic COMMON,MAP, and VAR from a C prog...
-
-
Forums
- Products
- Servers and Operating Systems
- Storage
- Software
- Services
- HPE GreenLake
- Company
- Events
- Webinars
- Partner Solutions and Certifications
- Local Language
- China - 简体中文
- Japan - 日本語
- Korea - 한국어
- Taiwan - 繁體中文
-
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
- HPE Blog, Austria, Germany & Switzerland
- Blog HPE, France
- HPE Blog, Italy
- HPE Blog, Japan
- HPE Blog, Middle East
- HPE Blog, Latin America
- HPE Blog, Russia
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
- HPE Blog, Poland
-
Blogs
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Blog, Latin America
- HPE Blog, Middle East
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
-
Information
- Community
- Welcome
- Getting Started
- FAQ
- Ranking Overview
- Rules of Participation
- Tips and Tricks
- Resources
- Announcements
- Email us
- Feedback
- Information Libraries
- Integrated Systems
- Networking
- Servers
- Storage
- Other HPE Sites
- Support Center
- Aruba Airheads Community
- Enterprise.nxt
- HPE Dev Community
- Cloud28+ Community
- Marketplace
-
Forums
-
Forums
-
Blogs
-
Information
-
English
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2008 11:01 PM
07-01-2008 11:01 PM
I want to from my C functions access data from the BASIC main program.
I link the programs together and the main program has a MAP.
Example
MAP (TEST_MAP) STRING TEST_STR = 20
How can i access it from my C function.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2008 04:32 AM
07-02-2008 04:32 AM
Solution"HP C Userâ s Guide for OpenVMS Systems"
4.8.2 Program Sections Created by HP C
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
6 TEST_MAP 32 NOPIC OVR REL GBL NOSHR NOEXE RD WRT OCTA
Now pick the corresponding Storage-Class Code from "Table 4â 7 Combination Attributes"
And go back up to finds ways to declare those.
For example:
$ typ tmp.bas
COMMON (TEST_MAP) STRING TEST_STR = 20
TEST_STR = "Hello world"
CALL test_C
end
$ type test_c.c
#include stdio
#pragma extern_model common_block shr
extern struct {
char test[20];
char zero;
} TEST_MAP;
test_c() {
TEST_MAP.zero = 0;
printf ("-%s-\n", TEST_MAP.test);
return;
}
$ run tmp
-Hello world -
Note 1) You figure the details: This example still generates:
%LINK-W-MULPSC, conflicting attributes for psect TEST_MAP
Note 2) you can coerce PSECT attributes with LINK options.
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.
Enjoy!
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2008 04:34 AM
07-02-2008 04:34 AM
Re: Access Basic COMMON,MAP, and VAR from a C program
"pragma extern_model common_block shr"
This finds intersting example usages as well as reference to the HP C manuals:
For example:
http://www.pottsoft.com/home/c_course/course.html
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2008 05:14 AM
07-02-2008 05:14 AM
Re: Access Basic COMMON,MAP, and VAR from a C program
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2008 05:16 AM
07-02-2008 05:16 AM
Re: Access Basic COMMON,MAP, and VAR from a C program
Hewlett Packard Enterprise International
- Communities
- HPE Blogs and Forum
© Copyright 2022 Hewlett Packard Enterprise Development LP