Intel® Fortran Compiler 17.0 Developer Guide and Reference

GETCURRENTPOSITION, GETCURRENTPOSITION_W (W*S)

Graphics Subroutines: Return the coordinates of the current graphics position.

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

See Also