- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Compiling with Intel Visual Fortran Compiler XE 12.0.4.196 [IA-32]...
color_cube.f90
D:\\Bills Data\\Documents\\Visual Studio 2008\\Projects\\contours\\contours\\color_cube.f90(6): warning #6075: The data type of the actual argument does not match the definition. [G$CLEARSCREEN]
**************************************************************************************
This is supposed to be the way that it's called according to the example
given. Is this a BUG?
**************************************************************************************
subroutine color_cube()
use ifqwin
integer*4 color,ires
integer*2 ix,iy,iz,ix1,iy1
do i=0,255
call clearscreen(G$CLEARSCREEN)
print *,"z level:"
read *,iz
if(iz.lt.0)return
do ix=0,255
do iy=0,255
color=z"ff000000"
color=or(color,ix * 2**16)
color=or(color,iy * 2**8 )
color=or(color,iz)
! set 3x3 rect to same color
do 15 ix1=ix*3,ix*3+2
do 15 iy1=iy*3,iy*3+2
15 ires=setpixelrgb(ix1,iy1,color)
end do
end do
read(*,*)
end do
end subroutine
- Etiquetas:
- Intel® Fortran Compiler
Enlace copiado
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Try again with the correct spelling of the actual argument to the clearscreen call (the $ comes first).
Consider using IMPLICIT NONE.
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
I see my mistake, but I was wondering -
Why did it clear the screen anyway, just like it was supposed to?
That's what threw me off, anyway.
Is an uninitialized variable supposed to do that?
Yours; Bill
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
An uninitialized variable may not be supposed to do or not do anything.
In your example not only was the variable uninitialized, but it was also of the wrong type. If the real variable in memory, when interpreted as an integer by the library routine, happened to have a value that made sense to the library routine, there will be no error message and the screen gets cleared.
On some other day, with a different garbage value for the uninitialized variable, the outcome may be different. That is the nature of uninitialized variables and programs that employ them.

- Suscribirse a un feed RSS
- Marcar tema como nuevo
- Marcar tema como leído
- Flotar este Tema para el usuario actual
- Favorito
- Suscribir
- Página de impresión sencilla