HP Forums
13012 vs 12066 - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: 13012 vs 12066 (/thread-9998.html)



13012 vs 12066 - ggauny@live.fr - 01-22-2018 10:17 AM

Hello,

In version 12066 this line of code run without issue, but in the BETA 13012
I get a syntax error, I have tried many things but no solution.



JDn:=DateG2JJ(date); OK in 12066

In the BETA the cursor is positionned here : (see the sign !)

JDn:=DateG2JJ!(date); syntax error.

(If I destroy *JDn:=* no syntax error but I need the entire line.)

One may help ?


RE: 13012 vs 12066 - toml_12953 - 01-22-2018 10:53 AM

(01-22-2018 10:17 AM)ggauny@live.fr Wrote:  Hello,

In version 12066 this line of code run without issue, but in the BETA 13012
I get a syntax error, I have tried many things but no solution.



JDn:=DateG2JJ(date); OK in 12066

In the BETA the cursor is positionned here : (see the sign !)

JDn:=DateG2JJ!(date); syntax error.

(If I destroy *JDn:=* no syntax error but I need the entire line.)

One may help ?

Could you list routine DateG2JJ for us? There must be some variable in there that is now a keyword but wasn't used back in 12066.


RE: 13012 vs 12066 - ggauny@live.fr - 01-22-2018 11:17 AM

Hello,

Here is the routine :

DateG2JJ(date) // for date ≥ oct 15 1582 (2299161)
BEGIN

LOCAL year,month,day;
LOCAL cnt,diz;

// Cut the date YYYY.MMDD into sub parts
year:=IP(date); // YYYY
month:=IP(100*FP(date)); // MM
day:=IP(FP(FP(date)*100)*100); // DD

// Move the beginning of the year to
// March 1st (adding 1 day, e.g. feb 29th
// becomes easier if at the end)
IF month<3 THEN
year:=year-1;
month:=month+12;
END;

// Cut the year into parts
// (Needed for converting Gregorian
// calendar dates to JDN)
cnt:=IP(year/100); // [YY]YY
diz:=IP(year-100*IP(year/100)); //YY[YY]

// julian day number at noon
// from gregorian date YYYY.MMDD
RETURN IP((146097*cnt+6884480)/4)
+IP(1461*diz/4)
+IP((153*month-457)/5)
+day-1;
END;


Hope you can me help.


RE: 13012 vs 12066 - DrD - 01-22-2018 01:07 PM

The EXPORT command:

Code:

 // for date ≥ oct 15 1582 (2299161)
EXPORT DateG2JJ(date)
BEGIN

  LOCAL year,month,day;
  LOCAL cnt,diz;

// Cut the date YYYY.MMDD into sub parts
  year:=IP(date); // YYYY
  month:=IP(100*FP(date)); // MM
  day:=IP(FP(FP(date)*100)*100); // DD

// Move the beginning of the year to
// March 1st (adding 1 day, e.g. feb 29th
// becomes easier if at the end)
  IF month<3 THEN
    year:=year-1;
    month:=month+12;
  END;

// Cut the year into parts
// (Needed for converting Gregorian
// calendar dates to JDN)
  cnt:=IP(year/100); // [YY]YY
  diz:=IP(year-100*IP(year/100)); //YY[YY]

// julian day number at noon
// from gregorian date YYYY.MMDD
  RETURN (
          IP((146097*cnt+6884480)/4) + 
          IP(1461*diz/4) + 
          IP((153*month-457)/5) +day-1
         );
END;

-Dale-


RE: 13012 vs 12066 - Carlos295pz - 01-22-2018 02:40 PM

(01-22-2018 10:17 AM)ggauny@live.fr Wrote:  In the BETA the cursor is positionned here : (see the sign !)

JDn:=DateG2JJ!(date); syntax error.

A syntax error is commonly a compilation error, meaning that DateG2JJ has not been compiled correctly or does not yet exist.


If you are using DateG2JJ in previous lines with respect to where you have defined it, you can move it before the function that uses it
Code:
DateG2JJ(date) //Defined before being used in another function
BEGIN
  ....
END;

Other
BEGIN
  LOCAL JDn:=DateG2JJ(date);
END;

Or put lines before "DateG2JJ();"
Code:
DateG2JJ(); //Declared/reserved as a function, for its anticipated use

Other
BEGIN
  LOCAL JDn:=DateG2JJ(date);
END;

DateG2JJ(date)
BEGIN
  ....
END;

I do not think the error is due to the firmware, you can try 13217 instead of 13012


RE: 13012 vs 12066 - ggauny@live.fr - 01-22-2018 03:33 PM

Thanks, it run !