MathStudio  Blog  Share  Manual  Forums  Support 
script runs in SpaceTime but not MathStudio
  • Hi,

    The following script does not run in MathStudio. Can anyone tell me how to make it run? Thank you.

    Name=jd
    Parameters=year, month, day


    if (month<= 2)<br />year=year-1

    month=month+12
    end

    a=iPart(year/100)
    b=2-a + iPart(a/4)

    iPart(365.25*(year+4716))+iPart(30.6001*(month+1))+day+b-1524.5

    Note: year=year-1 is on the next line in the script
  • Hi,

    It seems to works for me, what do you expected to get as result?

    Francisco.
  • Hi Francisco,

    Thanks for looking into this. I enter for example, jd(2000,11,3) and it returns jd(2000, 11, 4)

    When I run it on an old version of Space Time on my Mac, I get the correct result of 4903705/2

    Is the syntax between Space Time and MathStudio the same? Thanks again.
  • Hi,

    I got 4903703/2
    but it works well for me.
    May be you've done an error in your script. Think to make a clear(all) if you got many variables in your worksheet.

    Best Regards, Frederic
  • Hi All,

    Thank you. It works after I typed it in by hand. I realized I had pasted the code from a text file and I guess a non-printing char was causing the problem. Thanks again.

Howdy, Stranger!

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

Login with Facebook Sign In with Google Sign In with OpenID Sign In with Twitter

In this Discussion