You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Local scope variables with `block` construct
The 2008 Fortran standard introduced the notion of `block` which enables using local scope variables within a program or procedure.
**Example:**```{play-code-block} fortran
module your_module implicit none integer :: n = 2end moduleprogram main implicit none real :: x block use your_module, only: n ! you can import modules within blocks real :: y ! local scope variable y = 2.0 x = y ** n print *, y end block ! print *, y ! this is not allowed as y only exists during the block's scope print *, x ! prints 4.00000000end program
The text was updated successfully, but these errors were encountered:
Following this comment https://fortran-lang.discourse.group/t/fortran-returns-to-top-20-tiobe-index/1069/184 by @Beliavsky
What about adding something like this to the page https://github.com/fortran-lang/webpage/blob/main/source/learn/quickstart/variables.md?plain=1 ?
The text was updated successfully, but these errors were encountered: