Graphics Subroutines: Get the coordinates of the current graphics position.
Module: USE DFLIB
Syntax
TYPE xycoord
INTEGER(2) xcoord ! x-coordinate
INTEGER(2) ycoord ! y-coordinate
END TYPE xycoord
TYPE wxycoord
REAL(8) wx ! x-coordinate
REAL(8) wy ! y-coordinate
END TYPE wxycoord
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.
Compatibility
STANDARD GRAPHICS QUICKWIN GRAPHICS LIB
See Also: LINETO, MOVETO, OUTGTEXT, SETTEXTPOSITION, GETTEXTPOSITION
Example
! Program to demonstrate GETCURRENTPOSITION
USE DFLIB
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