×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Executable program

Executable program

Executable program

(OP)
Is possible to create an execuble program from a fortran program?
If yes, how can I do it?
Thank you in advance

RE: Executable program

Quote (j0zn)


If yes, how can I do it?
You have to compile it using a fortran compiler - for example: gfortran, g95, ...

RE: Executable program

wow, j0zn, where is that question coming from? Judging from all the threads that you have started, you have supposedly been writing Fortran programs for a few months now...I wouldn't expect this question from you at this time, unless...

RE: Executable program

(OP)
I am sorry guys for this poorly made question. I wanted to know if is possible create a program like the windows programs from fortran, click-open-programs or something like this...
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?

RE: Executable program

Yes - which compiler are you using?

RE: Executable program

Quote (j0zn)


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?
Yes it's possible with Fortran if you have a suitable library for it.

It's possible without Fortran too: You can create a wrapper program in other language, which creates the GUI, reads user input from it, sends it to the fortran program and after the calculation displays the output of the fortran program back in the GUI.
For simple case it's simple. I have this little example using Tcl/Tk:

Consider, we have this simplest Fortran program
fortcl.f95

CODE

program fortcl
  implicit none
 
  real :: val, sin
 
  read (*,*) val
  write(*,'(A12,F6.3)') "Result = ", sin(val)  
end 

Compile it (for example with gfortran or g95)

CODE

$ gfortran fortcl.f95 -o fortcl 

Then create this Tcl/Tk script in the same directory where is your fortran executable:
fortcl.tcl

CODE

#!/usr/bin/wish

# window title
wm title . Sinus

# input field 
entry  .e1

# button
button .b1 -text "Compute" -command fcall

# text field
label  .l1 -bg green

# pack the widgets
pack .e1 -padx 10 -pady 5
pack .b1 -padx 10 -pady 5
pack .l1 -padx 10 -pady 5
 
proc fcall { } { 
  # Communication with Fortran, printing the result 

  set val [.e1 get]

  if {[string is integer -strict $val] || [string is double -strict $val]} {
    # fortcl.exe is compiled and linked Fortran program
    set f [open "|./fortcl.exe" r+]

    puts $f $val
    flush $f
 
    gets $f wert
    close $f
  } else {
    # if input was not a number, create error message 
    set wert "Input ERROR !!!"
  }

  .l1 config -text $wert
} 

Now if you run the Tcl script, you get a simplest GUI for the simple fortran program.
I saw more comprehensive examples on the web.

RE: Executable program

IVF has the MS windows interface

Silverfrost has a cryptic version of the MS windows interface

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close