Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

windows task automation 1

Status
Not open for further replies.

rk_19

Structural
Aug 7, 2012
71
hi, i wish to know if fortran can help in windows automation.
the job expected is: fortran code (in exe) should invoke a third party software on windows10(call the 3rd party software as ABC). the input file for ABC is a text file, upon the completion of run, the fortran exe should read through the output file (text) of ABC, search for a particular value, exe does some calculations( sort of criteria check). based on it, the input file of ABC is edited again and ABC is run by the fortran exe code - upon completion, again criteria check is done. if condition is met, the program stops, else, the input file is edited and rerun - process continues till the criteria is met.. all this happens automatically after the first run is initiated. my colleagues use perl for such work, is there a way to avoid a new programming language

thanks
 
Replies continue below

Recommended for you

You can use a mix of fortran and windows batch or everything in vbscript/javascript. If you use vbscript or javascript, there is no need to install anything since they are part of windows.
 
hi xwb, i dont know any programmng lang other than fortran, so i wish to know if i can survive with fortran for my requirement.
 

While it may be possible to do what you want with Fortran, it is not necessarily the best tool for the job. What you describe seem to be more of a job for a shell kind of environment (bash, batch) or, yes, one of those versatile scripting languages like Perl, or even better...Python ;-)

New year is coming up, may I suggest a new year resolution? Learn Python...it is easy and very, very, very useful for many things; additionally, it is becoming the scripting language for other programs open-source and commercial alike.






 
If you are in a windows environment, and you don't wish to install anything, learn javascript/windows batch. It may be outside your comfort zone but you can do quite useful stuff with it.

If you are in a Linux environment, python and bash would be the way to go. It is a lot easier than perl - perl written by a Cobol programmer looks completely different from perl by a C programmer, which again looks completely different from perl by a bash programmer. At least python looks the same, whoever writes it.

You can use python in a windows environment but it will need installing. This may be a problem if you are developing on one machine and running on a different one. Javascript/Windows batch will work on any version of Windows from 95 upwards.
 
gsal/xwb, thanks for the suggestions.. i am working on windows env... whats your take on learning AUTOIT for my requirement.
 
Autoit is similar to vbscript but with more features. You will still need to install it on other machines. I have only used it twice and that was for automating tests by imitating what users type. It should be able to do what you wish.
 
GUI features aren't standard Fortran - it depends a lot on which GUI you are using.

For instance, if you are using Intel IVF or CVF or DEC Fortran or some descendant of MS Power Fortran 4, you can use events to transmit key strokes, wheel scrolls etc. Note that this is the old Win32 SDK - not the fancy .net stuff. There are tools to do all sorts of things (have a look at spy.exe, which comes with the std MS distribution). Having said that, you'd have a problem finding someone to maintain it once you leave the company: there aren't that many people out there who know how to program the windows SDK in Fortran. The last place I worked at that used Fortran (site had 2500 employees, 15-20% software engineers), it was only me. Most of them are C/C++ programmers who don't seem to understand something as simple as Fortran and they are getting rarer as .net and C# take over the windows GUI systems.

If you are using Silverfrost, there is a very limited GUI capability. It cannot do automated clicks, button pushes or find window handles

If you are using gfortran, I've got no idea - interfacing gfortran with anything microsoft is a nightmare that you don't want. Some of the gfortran parameters are position dependant. If you are using a C interface, make sure your compiler is at least 2003 or 2008 compatible.

Some gui systems like FLTK use a different system. Their handles aren't the same as Win32 handles.

If it is an X-windows or GTK port, it may be possible. I have used automated clicking and looking for dialogs on X-windows but not GTK. If it is X-windows/Moitf, it is a pretty ancient system.

I don't know about winteracter, forge or dislin.
 
As other folks suggested, you could use both Windows Batch script and Fortran executable to fulfill your goal without learning a new programming language. However, if it is a long-term-supported project, I would recommend getting to learn a new scripting language such as Python, Perl, which is able to better maintain and scale up your project.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor