- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Hello!
Many another languages support a very helpful feature: with end with block
Can it one day be realized in Fortran?
Example:
Many another languages support a very helpful feature: with end with block
Can it one day be realized in Fortran?
Example:
[fortran]type TStruct real Value1 real Value2 real Value3 end type type(TStruct) Struct ! long notation
Struct%Value3 = Struct%Value1 + Struct%Value2 ! much better: with Struct Value3 = Value1 + Value2 end with[/fortran]
- Etiquetas:
- Intel® Fortran Compiler
Enlace copiado
2 Respuestas
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
The associate cosntruction is what you are after, but it is more general than just such a "with" construction.
It was introduced in Fortran 2003.
The example could become:
associate( s => struct )
s%value3 = s%value1 + s%value2
end associate
but it gets its power from:
associate( s1 => struct, s2 => someOtherStruct, s3 => aThirdOne )
...
end associate
Regards,
Arjen
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
thank you very much for answer. I was not able to reply for a long time.

Responder
Opciones de temas
- 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