Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
You have to compile it using a fortran compiler - for example: gfortran, g95, ...j0zn said:If yes, how can I do it?
Yes it's possible with Fortran if you have a suitable library for it.j0zn said:Is possible create a way of using a program without to use the terminal?
Is possible create a graphic interface to a program in fortran?
[COLOR=#a020f0]program[/color] fortcl
[COLOR=#2e8b57][b]implicit[/b][/color] [COLOR=#2e8b57][b]none[/b][/color]
[COLOR=#2e8b57][b] real[/b][/color] :: val, [COLOR=#008080]sin[/color]
[COLOR=#804040][b]read[/b][/color] ([COLOR=#804040][b]*[/b][/color],[COLOR=#804040][b]*[/b][/color]) val
[COLOR=#804040][b]write[/b][/color]([COLOR=#804040][b]*[/b][/color],[COLOR=#ff00ff]'(A12,F6.3)'[/color]) [COLOR=#ff00ff]"Result = "[/color], [COLOR=#008080]sin[/color](val)
[COLOR=#a020f0]end[/color]
$ gfortran fortcl.f95 -o fortcl
[COLOR=#0000ff]#!/usr/bin/wish[/color]
[COLOR=#0000ff]# window title[/color]
wm title . Sinus
[COLOR=#0000ff]# input field [/color]
[COLOR=#2e8b57][b]entry[/b][/color] .e1
[COLOR=#0000ff]# button[/color]
[COLOR=#2e8b57][b]button[/b][/color] .b1 -[COLOR=#6a5acd]text[/color] [COLOR=#ff00ff]"Compute"[/color] -[COLOR=#6a5acd]command[/color] fcall
[COLOR=#0000ff]# text field[/color]
[COLOR=#2e8b57][b]label[/b][/color] .l1 -bg green
[COLOR=#0000ff]# pack the widgets[/color]
[COLOR=#804040][b]pack[/b][/color] .e1 -[COLOR=#6a5acd]padx[/color] [COLOR=#ff00ff]10[/color] -[COLOR=#6a5acd]pady[/color] 5
[COLOR=#804040][b]pack[/b][/color] .b1 -[COLOR=#6a5acd]padx[/color] [COLOR=#ff00ff]10[/color] -[COLOR=#6a5acd]pady[/color] 5
[COLOR=#804040][b]pack[/b][/color] .l1 -[COLOR=#6a5acd]padx[/color] [COLOR=#ff00ff]10[/color] -[COLOR=#6a5acd]pady[/color] 5
[COLOR=#804040][b]proc[/b][/color] fcall { } {
[COLOR=#0000ff] # Communication with Fortran, printing the result [/color]
[COLOR=#804040][b]set[/b][/color] val [.e1 get]
[COLOR=#804040][b]if[/b][/color] {[[COLOR=#804040][b]string[/b][/color] is integer -strict [COLOR=#008080]$val[/color]] || [[COLOR=#804040][b]string[/b][/color] is double -strict [COLOR=#008080]$val[/color]]} {
[COLOR=#0000ff] # fortcl.exe is compiled and linked Fortran program[/color]
[COLOR=#804040][b]set[/b][/color] f [[COLOR=#804040][b]open[/b][/color] [COLOR=#ff00ff]"|./fortcl.exe"[/color] r+]
[COLOR=#804040][b]puts[/b][/color] [COLOR=#008080]$f[/color] [COLOR=#008080]$val[/color]
[COLOR=#804040][b]flush[/b][/color] [COLOR=#008080]$f[/color]
[COLOR=#804040][b]gets[/b][/color] [COLOR=#008080]$f[/color] wert
[COLOR=#804040][b]close[/b][/color] [COLOR=#008080]$f[/color]
} [COLOR=#804040][b]else[/b][/color] {
[COLOR=#0000ff] # if input was not a number, create error message [/color]
[COLOR=#804040][b]set[/b][/color] wert [COLOR=#ff00ff]"Input ERROR !!!"[/color]
}
.l1 config -text [COLOR=#008080]$wert[/color]
}