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

Code Error

JohnNichols
Valued Contributor III
1,036 Views
program test
 ! The following USE statement provides Fortran interfaces to Windows routines
 USE IFWIN
! Begin data declarations
 integer lines,length
 logical status
 integer fhandle
 Type(T_COORD) wpos
! Set buffer size variables
 length = 80
 lines = 90
! Begin executable code
! Allocate a console
 status = AllocConsole() ! get a console window of the currently set size
 fhandle = GetStdHandle(STD_OUTPUT_HANDLE)
 wpos.x = length ! must be >= currently set console window line length
 wpos.y = lines ! must be >= currently set console window number of lines
 ! Set a console buffer bigger than the console window. This provides
 ! scroll bars on the console window to scroll through the console buffer
 status = SetConsoleScreenBufferSize(fhandle, wpos)
 ! Write to the screen as needed. Add a READ to pause before deallocation
 write (*,*) "This is the console output! It might display instructions or data "
 write (*,*) " "
 write (*,*) "Press any key when done viewing "
 read (*,*)
! Deallocate the console to free its resources.
 status = FreeConsole() 

end program test

page 85 of the manual there is a spelling mistake on line 15 of the above code. 

6 Replies
andrew_4619
Honored Contributor III
1,024 Views

it will fail on a 64 bit build  as fhandle is hard coded at 32 bit.....

JohnNichols
Valued Contributor III
1,014 Views

It did not work at all.  Suggestions to make it 32 and 64 bit.  But I just tested in 32 and 64 bit and it appears to work on both.

0 Kudos
Barbara_P_Intel
Employee
974 Views

Thanks, @JohnNichols. I submitted a bug report, DOC-10919.

I declared fhandle as a 64bit INTEGER, too, to eliminate that warning message. That message might just confuse a novice.


0 Kudos
jimdempseyatthecove
Honored Contributor III
928 Views

John, there is an integer kind called HANDLE specified in multiple of the Windows modules (e.g.kernel32).

  integer(HANDLE) :: fhandle

Jim Dempsey

0 Kudos
JohnNichols
Valued Contributor III
916 Views

Jim:

The latest sign on is a nightmare, I will have to increase my self medication of Diet Dr Pepper to cope with the stress.  Find a code in an email program and then send a code to a phone, and then find the phone your daughter used all night to play games and she says, sorry Dad, it is dead.  Charge phone, code has expired, start again, actually read the email account inbox, as I never use this account except as the logon for Intel and on the phone when it is charged and this started yesterday morning, get a Microsoft code, even in my Sunday - o God is it Sunday, make the pain stop, reach for the can it is empty, traverse the house to the frig, frig is empty, find the slab of cans in the boot and carry to the frig, thankfully it was freezing last night so I have a cold tinnie.   Wonder what Microsoft has to do with Intel beside the obvious, remember Moore's law of Dr Diet Pepper, the cans will run out at midnight. 

Get a nice email from @Barbara_P_Intel  and chuckle.  I wonder what poor small cubicle in the world, Karen lives in.  I cannot send Karen an email, so could you say thank you.  

Thank the Norse gods for Jim and then end.  

 

John

have to work out how EXCEL uses t Stat in their Linear Regression analysis.  Has to be code somewhere.  

0 Kudos
Barbara_P_Intel
Employee
833 Views

Typo fixed in the next release of the DGR (Developer Guide and Reference). It'll be available later this spring.



0 Kudos
Reply