Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

GlobalMemoryStatusEx

kompute
Beginner
932 Views
Can anyone provide a sample for coding GlobalMemoryStatusEx? I was able to use the WindowAPI GlobalMemoryStatus which is a subroutine but not GlobalMemoryStatusEx which is a function.
0 Kudos
4 Replies
Steven_L_Intel1
Employee
932 Views
As you wish. Note the use of the TRANSFER intrinsic to convert the array of two INTEGER(4) fields to a single INTEGER(8).
0 Kudos
kompute
Beginner
932 Views

Thanks Steve,

You are hitting the nail right on the head! I had difficulty converting two int(4) arrays into a single int(8).

0 Kudos
jimdempseyatthecove
Honored Contributor III
932 Views

You can also use a union of two integer(4)'s with an integer(8). For legacy reasons many of the Windows functions require as an argument the address of a struct with two DWORDs. I prefer to union that structure with an integer(8). Just programming style.

Jim

0 Kudos
Steven_L_Intel1
Employee
932 Views
Sure, if you're coding your own structure, but the Win32 structure isn't defined that way in the module.
0 Kudos
Reply