Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 3/22/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

GETCURRENTPOSITION, GETCURRENTPOSITION_W

Graphics Subroutines: Return the coordinates of the current graphics position. These routines are only available for Windows.

Module

USE IFQWIN

CALL GETCURRENTPOSITION (s)

CALL GETCURRENTPOSITION_W (s)

s

(Output) Derived type xycoord. Viewport coordinates of current graphics position. The derived type xycoord is defined in IFQWIN.F90 as follows:

TYPE xycoord
  INTEGER(2) xcoord   ! x-coordinate
  INTEGER(2) ycoord   ! y-coordinate
END TYPE xycoord

LINETO, MOVETO, and OUTGTEXT all change the current graphics position. It is in the center of the screen when a window is created.

Graphics output starts at the current graphics position returned by GETCURRENTPOSITION or GETCURRENTPOSITION_W. This position is not related to normal text output (from OUTTEXT or WRITE, for example), which begins at the current text position (see SETTEXTPOSITION). It does, however, affect graphics text output from OUTGTEXT.

Example

! Program to demonstrate GETCURRENTPOSITION
USE IFQWIN
TYPE (xycoord) position
INTEGER(2)     result
result = LINETO(INT2(300), INT2(200))
CALL GETCURRENTPOSITION( position )
IF (position%xcoord .GT. 50) THEN
  CALL MOVETO(INT2(50), position%ycoord, position)
  WRITE(*,*) "Text unaffected by graphics position"
END IF
result = LINETO(INT2(300), INT2(200))
END