VBA

Moderators: PavlinII
Number of threads: 1614
Number of posts: 3000

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
converting fortran to vba - SOLVED - Posted by legalizeme on 26 Oct 2010 at 8:49 AM
I`m converting subroutine from fortran code into the excel. But I faced a problem, that these loops, which are working correctly under fortran, are not working "correctly" under vba. Lost all day trying to figure out problem without success.

Attachment: fortran2VBA.zip (2431 Bytes | downloaded 127 times)
Report
Re: converting fortran to vba Posted by quikcarl on 26 Oct 2010 at 1:55 PM
What loops? I didn't see any DO loops inside
the subroutine. Just a lot of IF-THEN-ELSE-
ENDIF statements. You might want to indent
inside the IF statements to see if there is
something missing and the FORTRAN compiler is
compensating.


Report
Re: converting fortran to vba Posted by legalizeme on 27 Oct 2010 at 3:04 AM
Please, dont focus on that loop, I didn`t add a loop in attachment, just subroutine. The thing is that this subroutine is inside the loop. abstractly it should look like

do until eof(sample_data)

get_step_parameters(sample_data)

call mysubroutine(parameters,form,sample,data,and,many,many2,more,parameters,which,are,calculated,from,previous,loop,by,reference) 

debug.print which,are

many=0
many2=0
more=0

sumBy=sumBy+by

loop


In the same if-then-else system i have a different results running it under fortran and under VBA. E.g. If I`m processing input_data file with 2250 records, the summoned parameters, like "sumBy" here, it differ about 0,5% of it`s value. In fortran it`s 1085, in VBA - 1045.

If someone wants to play around with this and prove me wrong, I`m adding full code in attachment.

Report
This post has been deleted. Posted by legalizeme on 27 Oct 2010 at 3:06 AM
This post has been deleted.
Report
Re: converting fortran to vba - SOLVED Posted by legalizeme on 27 Oct 2010 at 5:06 AM
problem solved.
before calling sub "snow" there were variable with default value all the time.






 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.