Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


converting fortran to vba - SOLVED -

legalizemelegalizeme Member Posts: 6
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.


  • quikcarlquikcarl Member Posts: 59
    [b]What loops?[/b] 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

  • legalizemelegalizeme Member Posts: 6
    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)


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

    debug.print which,are




    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.

  • legalizemelegalizeme Member Posts: 6
    This post has been deleted.
  • legalizemelegalizeme Member Posts: 6
    problem solved.
    before calling sub "snow" there were variable with default value all the time.

Sign In or Register to comment.