- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: Access Basic COMMON,MAP, and VAR from a C prog...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- 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