Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
Mikalodeon
New Member.
1262 views

dll and float type

Jump to solution

Hopefully somone can give me some direction here.  I am required to call a dll passing a 'float' type as part of a structure. I'm not sure what this will translate to in acucobol. They use "QuadWord alignment (8 bytes)", I'm not sure if this is important or not.

Here is what I have regarding the function to call:

float  - 8 bytes floating point (this will be dollar amount with 2 decimal places)
string - length 30 (null terminated)
string - length 30 (null terminated)

Here is how I defined the structure in acucobol:

01  WS-Structure.
    03 WS-Float-Val    ?????????.
    03 WS-String1-Val  PIC X(30).
    03 WS-String2-Val  PIC X(30).

How should I define the float value?  Should I make it PIC 9(10)V99 COMP-5? How do I make sure it takes up 8 bytes?

I have a sample of the function call in delphi if that would help...

Thanks for any insight 🙂

 

 

0 Likes
1 Solution

Accepted Solutions
Micro Focus Contributor
Micro Focus Contributor

RE: dll and float type

Jump to solution

I believe that

   03 ws-float-val usage double.

will work. You can verify that it is the right size by compiling with a listing (-Ls gives the symbol table).

View solution in original post

0 Likes
3 Replies
Micro Focus Contributor
Micro Focus Contributor

RE: dll and float type

Jump to solution

I believe that

   03 ws-float-val usage double.

will work. You can verify that it is the right size by compiling with a listing (-Ls gives the symbol table).

View solution in original post

0 Likes
Ektoras Giorgos
New Member.

RE: dll and float type

Jump to solution
0 Likes
Mikalodeon
New Member.

RE: dll and float type

Jump to solution

Thanks I think that might do the trick (hopefully)... I won't know for sure until I can run it against some actual data..

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.