I'm doing graphics to a graphics object on screen, and (sometimes) to a printer graphics object. The program baulks at something which is hard to describe. The graphics have 2 lines of text. The position on screen for this text is different for the hard copy than it is on the screen. If I write the two text lines with:
IIY = 25
IJY = 45
CALL DRAW_CHARACTERS@(TITLE2,10,IIY,RGB@(0,0,0))
CALL DRAW_CHARACTERS@(TITLE1,10,IJY,RGB@(0,0,0))
(TITLE1 and TITLE2 being 80-character strings)
then the text is drawn, although it isn't where I want it on the hard copy. So, I pass a variable to the subprogram (that draws the particular graphics) which is named NDEV that is 1 for hard copy, and 0 for screen graphics. At several points in the subprogram, I check on NDEV, and do such things as adjusting line thicknesses etc. I then try to use NDEV as follows:
IF (NDEV .EQ. 0) THEN
IIY = 25
IJY = 45
CALL DRAW_CHARACTERS@(TITLE2,10,IIY,RGB@(0,0,0))
CALL DRAW_CHARACTERS@(TITLE1,10,IJY,RGB@(0,0,0))
ELSE
IIY = 25
IJY = 45
CALL DRAW_CHARACTERS@(TITLE2,10,IIY,RGB@(0,0,0))
CALL DRAW_CHARACTERS@(TITLE1,10,IJY,RGB@(0,0,0))
ENDIF
Notice that the coordinates are the same. Obviously, I want IIY and IJY to be different, but I have cut and pasted identical FORTRAN in here, so that whichever route is taken the same sequence occurs. This code causes the program to crash - in my standard WinXP I get the 'chord' sound and all the windows close instantly. But when I revert to no IF, it works - no crash. Bizarrely, when NDEV=0, the graphics come up on screen faultlessly.
Anyone know what I'm doing that causes this odd behaviour?
Eddie