Transforming Fortran to Excel 2003 Programs

P

Pranas Rudys

What is the easiest way to change Fortran (or Basic for that matter)to
Excel 2003 Spreadsheet programs?

Are there any syntax or parsing programs available?

If not,
How are DO loops handled?
How are If statements done?

etc.
 
A

Arvi Laanemets

Hi

The easiest is simply to write a new code. And I'm afraid it's the only way.

a)
....
Do
Statements
...
Loop Until LogicalExpression
....

b)
....
Do While LogicalExpression
Statements
...
Loop

c)
....
If LogicalExpression Then Statement
....

d)
....
If LogicalExpression Then
Statements
...
ElseIf LogicalExpression2 Then
Statements
....
ElseIf LogicalExpression3 Then
Statements
...
....
Else
Statements
...
End If
....

e)
....
Variable=Iif(LogicalExpressin,TrueValue,FalseValue)
....

etc. Read VBA Help for a while, and ask after that more detailed questions -
we are happy to help.


Arvi Laanemets
 
B

beliavsky

What is the easiest way to change Fortran (or Basic for that matter)to
Excel 2003 Spreadsheet programs?

The easiest way is not to :). Create a DLL from the Fortran code and
call the DLL from Excel. If you don't know any Fortran, regard it as a
learning opportunity. There are free compilers available such as g77
for Fortran 77.

Also possible, but taking much more work and probably running slower,
is to convert the Fortran program to VBA and to call the VBA code from
Excel. You do realize that VBA is built into Excel?
 
P

Pranas Rudys

(e-mail address removed) wrote in message
The easiest way is not to :). Create a DLL from the Fortran code and
call the DLL from Excel. If you don't know any Fortran, regard it as a
learning opportunity. There are free compilers available such as g77
for Fortran 77.

Also possible, but taking much more work and probably running slower,
is to convert the Fortran program to VBA and to call the VBA code from
Excel. You do realize that VBA is built into Excel?

First: Yep! Old Fortran Programmer. But Creating DLL are a step out
now.
I have converted several GW Basic, QBasic and Quick Basic Programs to
Excel VBA by pasting the code directly into an Excel VBA Procedure.
Then assiging the input/output statements to cells on the spreadsheet
and using variables assigned to their ranges. It is sort of slow. I
was looking for an automatic way to do it.

And Oh yes I do code in VBA all the time.

Fortran programs are another matter. The syntax of the program is
slightly different.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top